-
Notifications
You must be signed in to change notification settings - Fork 10
Description
I've been struggling to get a tune to sound right, and eventually realised that NonBlockingRTTTL doesn't parse RTTTL in the way I expected.
The problem occurs with dotted notes that are not in the default octave, which I thought should be written as a4. but this library expects a.4
The confusion seems to arise because the 'language' is poorly specified. I don't know if there's a canonical definition anywhere, but I found a Backus-Naur specification which includes:
<note> := [<duration>] <note> [<scale>] [<special-duration>] <delimiter>
That puts the dot (the 'special-duration') at the end. But the same document includes g.6 in its example, cleverly contradicting itself.
Wikipedia says 'Dotted rhythm patterns can be formed by appending a period (".") character to the end of a duration/beat/octave element.'
I suggest that NonBlockingRTTTL should allow for either dot position -- simply by repeating the short bit of code that consumes the dot and extends the note's duration after the section that deals with the octave. That would avoid breaking anyone's existing tunes, and make it easier for people to get new tunes to work.
Cheers,
Chris