RTTTL, or Ringing Tone Text Transfer Language, is a simple text-based format for writing melodies. It became famous in the late 1990s as the standard for creating custom ringtones on mobile phones.
An RTTTL string is made of three parts, separated by colons (:):
Title:Defaults:Notes
1. Title
The name of your ringtone. For example, MySong.
2. Defaults (Optional)
This section sets the default values for the notes that follow. It can contain:
d=: Default duration (e.g., d=4 for a quarter note).
o=: Default octave (e.g., o=5).
b=: The tempo in beats per minute (e.g., b=120).
Example: d=4,o=5,b=120
3. Notes
A comma-separated list of notes that make up the melody. Each note has a specific format:
[duration][pitch][octave]
- Duration (optional):
1 (whole), 2 (half), 4 (quarter), 8, 16, 32. If you omit this, the default duration is used. A dot (.) after a note makes it 1.5x longer.
- Pitch:
c, d, e, f, g, a, b. A sharp is added with # (e.g., c#). A pause is written as p.
- Octave (optional):
4, 5, 6, 7. If omitted, the default octave is used.
Example of a note: 8c#5 is an eighth C-sharp note in the 5th octave. 4p is a quarter-note pause.