RingTone Namespace Reference
Classes | |
| struct | NoteDef |
| class | Parser |
| Base parser class. More... | |
| class | Player |
| Base class to support playback of tunes. More... | |
| struct | RtttlHeader |
| class | RtttlParser |
| Class to parse RTTTL files RTTTL (RingTone Text Transfer Language) format. More... | |
| struct | RtttlParserState |
| class | RtttlWriter |
Enumerations | |
| enum | Note { Note::MUTE, Note::C, Note::C_Sharp, Note::D_Flat = C_Sharp, Note::D, Note::D_Sharp, Note::E_Flat = D_Sharp, Note::E, Note::F, Note::F_Sharp, Note::G, Note::G_Sharp, Note::A_Flat = G_Sharp, Note::A, Note::A_Sharp, Note::B_Flat = A_Sharp, Note::B } |
| Note numbers, defined here for convenience. More... | |
Functions | |
| template<unsigned octave, unsigned note> | |
| static constexpr unsigned | calculateFrequency () |
| unsigned | charToNoteValue (char c) |
| Get the corresponding note number for a letter. More... | |
| unsigned | getNoteFrequency (unsigned octave, unsigned note) |
| Convert a scale/note combination into frequency. More... | |
| unsigned | getClosestNote (unsigned frequency, unsigned &octave) |
| Convert a frequency into a scale/note combination into frequency. More... | |
| const char * | getNoteName (unsigned noteValue) |
| Get text for a given note number. More... | |
Variables | |
| static unsigned | noteFrequencyA4 = 440 |
| Reference note frequency. More... | |
| static constexpr float | frequencyRoot = pow(2, 1.0 / 12) |
Enumeration Type Documentation
◆ Note
|
strong |
Function Documentation
◆ calculateFrequency()
template<unsigned octave, unsigned note>
|
staticconstexpr |
◆ charToNoteValue()
| unsigned RingTone::charToNoteValue | ( | char | c | ) |
Get the corresponding note number for a letter.
- Parameters
-
c
- Return values
-
unsigned Notes start at 1, 0 indicates error or pause/mute
- Note
- To sharpen a note, add 1
◆ getClosestNote()
Convert a frequency into a scale/note combination into frequency.
- Parameters
-
frequency octave Octave for the note
- Return values
-
unsigned The note number, 0 if out of range
◆ getNoteFrequency()
Convert a scale/note combination into frequency.
- Parameters
-
octave note
- Return values
-
unsigned Frequency, 0 if out of range
◆ getNoteName()
| const char* RingTone::getNoteName | ( | unsigned | noteValue | ) |
Get text for a given note number.
Variable Documentation
◆ frequencyRoot
|
staticconstexpr |
◆ noteFrequencyA4
|
static |
Reference note frequency.
1.8.17