RingTone.h File Reference
#include <cstdint>
#include <cmath>
Include dependency graph for RingTone.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  RingTone::NoteDef
 
class  RingTone::Parser
 Base parser class. More...
 

Namespaces

 RingTone
 

Enumerations

enum  RingTone::Note {
  RingTone::Note::MUTE, RingTone::Note::C, RingTone::Note::C_Sharp, RingTone::Note::D_Flat = C_Sharp,
  RingTone::Note::D, RingTone::Note::D_Sharp, RingTone::Note::E_Flat = D_Sharp, RingTone::Note::E,
  RingTone::Note::F, RingTone::Note::F_Sharp, RingTone::Note::G, RingTone::Note::G_Sharp,
  RingTone::Note::A_Flat = G_Sharp, RingTone::Note::A, RingTone::Note::A_Sharp, RingTone::Note::B_Flat = A_Sharp,
  RingTone::Note::B
}
 Note numbers, defined here for convenience. More...
 

Functions

template<unsigned octave, unsigned note>
static constexpr unsigned RingTone::calculateFrequency ()
 
unsigned RingTone::charToNoteValue (char c)
 Get the corresponding note number for a letter. More...
 
unsigned RingTone::getNoteFrequency (unsigned octave, unsigned note)
 Convert a scale/note combination into frequency. More...
 
unsigned RingTone::getClosestNote (unsigned frequency, unsigned &octave)
 Convert a frequency into a scale/note combination into frequency. More...
 
const char * RingTone::getNoteName (unsigned noteValue)
 Get text for a given note number. More...
 

Variables

static unsigned RingTone::noteFrequencyA4 = 440
 Reference note frequency. More...
 
static constexpr float RingTone::frequencyRoot = pow(2, 1.0 / 12)