RTTTL Melodies
Ring Tone Text Transfer Language — a compact plain‑text format for simple melodies — is used here to drive a piezo‑buzzer emulator in your browser. The examples below show a few of my own RTTTL concoctions, and you can try your own in the playbox. A short syntax guide follows for anyone curious about how these strings work.
Bach, Inventio 8
inventio_8:d=16,o=5,b=160:p,f,p,a,p,f,p,c6,p,a,p,f6,p,e6,d6,c6,d6,c6,a#,a,a#,a,g,8f,p;
A brief RTTTL rendering of the opening bars of Bach’s Invention No. 8, reduced to its essentials but still unmistakably Bach. I use this fragment as my hourly chime in Home Assistant, where a piezo buzzer does its best to honour the composer.
Pac‑Man
pacman:d=4,o=5,b=112:p,32b,32p,32b6,32p,32f#6,32p,32d#6,32p,32b6,32f#6,16p,16d#6,16p,32c6,32p,32c7,32p,32g6,32p,32e6,32p,32c7,32g6,16p,16e6,16p,32b,32p,32b6,32p,32f#6,32p,32d#6,32p,32b6,32f#6,16p,16d#6,16p,32d#6,32e6,32f6,32p,32f6,32f#6,32g6,32p,32g6,32g#6,32a6,32p,32b6.,p;
The unmistakable opening motif from Pac‑Man, rendered here in RTTTL and cheerfully unapologetic in its 8‑bit origins. I use it as a door chime in Home Assistant, where the piezo buzzer delivers its burst of nostalgia with admirable enthusiasm.
Pengo
Pengo:d=4,o=5,b=180:p,16e6,16p,16d6,16p,16e6,16p,16b,16p,16g,16p,16b,16p,8e,8p,16e6,16p,16d6,16p,16e6,16p,16b,16p,16g,16p,16b,16p,8e,8p,16e6,16p,16f#6,16p,16g6,16p,32f#6,32p,16g6,8p,16e6,16p,16f#6,16p,32e6,32p,16f#6,8p,16d6,16p,16e6,16p,16c6,16p,16g,16p,16c6,16p,16e6,16p,p;
This is the jaunty theme from Pengo, distilled into RTTTL and unmistakably rooted in early arcade sound. It’s a neat fragment of 1980s game music — simple, brisk, and oddly uplifting.
Snoopy
snoopy:d=4,o=5,b=220:8d,8d#,8e,c6,8e,c6,8e,2c6,8p,8c6,8d6,8d#6,8e6,8c6,8d6,e6,8b,d6,c6,p;
It’s the lively opening strain of The Entertainer, best known to me from Radarsoft’s Snoopy game on the C64 rather than any ragtime piano.
Try it yourself
Paste or write your own RTTTL string below and give it a play. A brief disclaimer: experimenting with this may prove unexpectedly addictive and could test the patience of nearby housemates.
The format
An RTTTL string packs a whole melody into one line of plain text: a name, a few default settings, then the notes themselves.
name:d=4,o=5,b=125:notes
│ │ │
│ │ └─ tempo (BPM)
│ └────── default octave
└────────── default note length (4 = quarter)
note = [length]letter[#][octave][.]
1/4/8/16/32 → length
c d e f g a b → notes
p → rest (instead of a note)
# → sharp (flat not supported)
7 → octave
. → dotted ×1.5
length/octave omitted → uses the d / o defaults
Examples: 8g#6 = eighth G# octave 6
4c = quarter C (default octave)
8c6. = dotted eighth C6
16p = short rest
For a detailed explanation of the format as implemented in ESPHome, see the RTTTL component documentation.