Circuit Drift LabsAll projects

Tone Calculator

Arrange any tone on this site, raw frequencies and silences into a sequence, with exact timing. Type a formula into the display or build it with the keys, then play it, save it, share it or download it as a WAV. Hover or focus any key for help, and see the reference below.

Formula reference

The calculator turns a short text formula into sound. Everything below also appears in the full language reference. Load any of the examples above to experiment.

Basics

Items play one after another. +, commas, spaces and new lines all mean “then”. Anything after // is a comment. Tones last 500 ms unless you say otherwise.

WriteMeaningExample
#411Key presses: each character is one press (DTMF unless keys= says otherwise)DT@2s 1s #411
@timeHow long the item before it sounds; a bare number after @ is milliseconds5@2s, 1@80
time aloneSilence (you may add Si, or write Si@, _@, rest@)50ms, 1sSi
//Comment to the end of the lineDT@1s // dial tone
Durations and tempo
WriteMeaningExample
250ms 2s 1.5secMilliseconds and secondsKP@100ms
bpm=nTempo for note lengths (default 120)bpm=90
1/4 1/8 1/16Note lengths at the tempo: at 120 bpm a quarter is 0.5 sC4@1/4, rest 1/8
1/4.Dotted: 1.5× as longD4@1/8.
1/8tTriplet: ⅔ as long(C4 D4 E4)@1/8t
What can be played
WriteMeaningExample
KeysDigits, *, # and single capital A–D*67, A
Catalog tonesAny tone on the site by label, alias, id or name; brackets for names with spaces or starting with a digitDT KP Dialtone [MF 1] [acts-quarter]
Frequencies1–20000 Hz440Hz, 1.2kHz
NotesEqual temperament, A4 = 440 Hz; always with an octaveC4 F#3 Bb5
GlidesSlide between two frequencies or notes300Hz..3000Hz@2s, C4..C5
NoiseWhite noisenoise@300ms
Dial stringsQuoted numbers with letters and pauses (see below)"1-800-FLOWERS"

Steady catalog tones behave like frequencies. Repeating tones (busy BT, ringback RT, howler ROH) repeat to fill the length you give them. Fixed sequences (coins, SIT, pulse digits) keep their own timing. Data bursts (SAME, MDC1200…) cannot be used.

Stacking, groups and repeats
WriteMeaningExample
a&bSound together; stacking groups runs them in parallel697Hz&1209Hz, C4&E4&G4
%n / %-6dBRelative level of one item697Hz%60&1209Hz
( … )Group(1 2 3)
( … )@timeDefault tone length inside the group(KP 121 ST)@68ms
N( … ), ( … )xN, item xNRepeat (up to 10000)10(2600Hz@2ms 2ms), KP x2

A length after a stack of plain tones covers the whole stack (697Hz&1209Hz@1s); a length right after a group covers just that group.

Parallel tracks and absolute placement
WriteMeaningExample
{ a | b | c }Tracks played at the same time; may span lines{ DT@3s | 1s 5551212 }
at time: itemPlace an item at an exact time from the start of the current part, without moving onDT@4s at 1s: 1@150ms
Shaping the sound
WriteMeaningExample
:sine :square :triangle :sawWaveform (band-limited, no aliasing)220Hz@1s:square
~fade(t), ~fadein( ), ~fadeout( )Fades440Hz@2s~fade(300ms)
~am(rate[, depth%])Warble (amplitude modulation)400Hz@3s~am(33Hz)
~fm(rate, depth)Vibrato (frequency modulation)A4@2s~fm(6Hz, 20Hz)
~detune(p% or ±fHz)Shift every frequency5~detune(2%)
~gain(±dB)Change level(1 2 3)~gain(-6dB)

Modifiers apply to whatever they follow: one tone, a stack or a whole group. Several can follow each other: 3000Hz..200Hz@120ms:saw~fadeout(60ms).

Settings

Settings affect everything after them. Inside a group or track they last until its end.

SettingValuesDefaultEffect
tone=time or note length500msdefault tone length
gap=timenonesilence added between consecutive tones
keys=dtmf mf pulsedtmfwhat digits and dial-string letters play
level=0–100 or dB100overall level
bpm=20–400120tempo for note lengths
ramp=time4msfade on every tone
wave=sine square triangle sawsinedefault waveform
glide=lin explinglide by equal hertz or equal musical steps
twist=dB0dBDTMF high tone level relative to the low tone
jitter=timenonerandom ± variation of tone and gap lengths
seed=whole number1random seed (rand, jitter, noise)
pause=time2slength of , in dial strings
wait=time2sdial tone played for ; in dial strings
Dial strings

Text in double quotes is dialed like a stored phone number. Letters become keypad digits (2 ABC, 3 DEF, 4 GHI, 5 JKL, 6 MNO, 7 PQRS, 8 TUV, 9 WXYZ). , pauses (pause=, default 2 s), ; plays dial tone for wait= (default 2 s). Spaces, dashes, brackets, dots, + and / are ignored.

tone=90ms gap=90ms
"1-800-FLOWERS"
"9;5551212,,123#"
keys=pulse gap=700ms "CALL"
Variables, macros and sections

Define on its own line, use anywhere after it. Variables can hold frequencies, durations, keys, dial strings or whole sections.

$E = 329.63Hz
$num = 5551212
$beep($f, $len) = $f@$len 80ms     // a macro with parameters
$intro = (                          // a multi-line section
  DT@1s 300ms
  tone=80ms gap=80ms 411
)
$E@450ms $num $beep(1000Hz, 100ms) $intro x2
Loops
for $f in 300Hz..1500Hz step 100Hz: $f@80ms 20ms
for $n in C4..C5: $n@1/8                  // notes step in semitones
for $t in 100ms..20ms step 20ms: (tone=$t 1234)
for $k in (1, 4, 7, *, 0, #): $k@150ms 150ms
for $o in (C4, C5): (for $s in (0, 4, 7): $o@1/16 )

The body is the rest of the line or a ( … ) group that may span lines. Up to 10,000 iterations.

Randomness
WriteMeaningExample
rand(a, b, c)One of the optionsrand(KP, ST)
rand(1..9)A key in the range555 rand(1..9)
rand(300Hz..900Hz)Any frequency in the range20(rand(300Hz..900Hz)@50ms)
jitter=Human-like timing variationjitter=20ms

Random results are repeatable, so playback and the WAV always match. Change seed= for a different result.

Cadences

cadence(tone, on, off, on, off, …) writes an on/off rhythm: cadence(440Hz&480Hz, 2s, 4s)x3 is North American ringback; cadence(400Hz&450Hz, 400ms, 200ms, 400ms, 2s) the British double ring.

Editor features
  • Live check below the display; click an error to select the problem.
  • Autocomplete: type part of a tone, setting, ~modifier, :waveform, note or [catalog id; ↑/↓ then Enter or Tab inserts, Esc closes.
  • ✨ TIDY makes spacing and units consistent without changing the sound; comments are kept.
  • In plain English explains each step; the timeline shows overlapping parts in lanes and the step list shows the expanded formula.
  • Ctrl+Enter (⌘+Enter) plays, Esc stops. 💾 SAVE, export/import and 🔗 LINK keep and share formulas.
Rendering and limits
  • Playback and WAV use the same rendered samples (44.1 kHz WAV, 16-bit mono). The loudest moment is scaled to −6 dBFS.
  • Every tone fades in/out by 4 ms (or ramp=) inside its stated length to avoid clicks.
  • Limits: 120 s, 20,000 notes, 10,000 repeats or loop steps, 1–20000 Hz, tones of at least 1 ms.

This tool arranges sounds for listening and audio files. It has no connection to any telephone line or radio. Historical trunk tones (2600 Hz, MF, coin tones) have no effect on modern networks.