Skip to content

Contradiction in the RTTTL specification #10

@StarsoftAnalysis

Description

@StarsoftAnalysis

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions