![]() |
RTTTLParser Library
1.0
RTTTL String parser and playing controls
|
The object definition requires no additional parameters.
The setup() function must invoke the begin() method. All other library initialization takes place at this time.
To keep the parser library generic, sound output must be implemented in the application as the type of hardware used will dictate how the sound is produced.
The parser will translate the information from the RTTTL string into parameters that the application can use:
The RTTLParser_Manual example demonstrates this use of the library.
In this mode the application has complete control over how the RTTTL file is processed.
A simplified flow for the application is:
The RTTLParser_Cback example demonstrates this use of the library.
In this mode the application provides the library with a callback that will manage the sound generation hardware. The library will manage duration timing for pauses (ie, the application is not aware of these) and will provide the callback with note on and note off events for the application to process.
The simplified flow for the application is:
Parsing without playback is identical to an application managed playback without 'playing' the notes. The entire string can be scanned very fast when the note durations and pauses are ignored. Once the string has been parsed, it will need to be reset using setTune().
Parsing an RTTTL string is useful to gather information about the string, such as what octaves are being used, the range of notes, etc. These can then be used to modify subsequent playback (eg, shifting the octave range) to suit a particular sound output device.