RingTone Namespace Reference
Classes | |
struct | NoteDef |
class | Parser |
Base parser class. More... | |
class | Player |
Base class to support playback of tunes. More... | |
struct | RtttlHeader |
struct | RtttlParserState |
class | RtttlParser |
Class to parse RTTTL files RTTTL (RingTone Text Transfer Language) format. More... | |
class | RtttlWriter |
Enumerations | |
enum class | Note { MUTE , C , C_Sharp , D_Flat = C_Sharp , D , D_Sharp , E_Flat = D_Sharp , E , F , F_Sharp , G , G_Sharp , A_Flat = G_Sharp , A , A_Sharp , B_Flat = A_Sharp , 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.