Parse ringtones written using RTTL and Nokia Composer
A ringtone has a well-defined tempo in BPM (beats-per-minute) and is composed by multiple tones, which can be either pitches or pauses.
parseComposer : { tempo : Basics.Int } -> String -> Result (List Parser.DeadEnd) Ringtone
Parse a ringtone expressed in the Nokia Composer format. It is a less generic format compared to RTTL since you can only express 3 octaves. Since the format does not specify a tempo, you will need to choose one.
Here's an example: 4c2 4d2 4e2 16- 8.#a3
encode : Ringtone -> Json.Encode.Value
Encode ringtone as a list of { frequency, duration } objects