arduino-audio-tools
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Attributes | List of all members
audio_tools::MusicalNotes Class Reference

Determination of the frequency of a music note. More...

#include <MusicalNotes.h>

Public Types

enum  MusicalNotesEnum {
  C , CS , D , DS ,
  E , F , FS , G ,
  GS , A , AS , B
}
 Notes.
 

Public Member Functions

int frequency (MusicalNotesEnum note, uint8_t octave)
 Determines the frequency of the indicate note and octave (0-8)
 
int frequency (uint16_t idx)
 Determines the frequency of the indicate note index from 0 to 107.
 
int frequencyCount ()
 
int frequencyToMidiNote (float freq)
 Provide MIDI note for frequency.
 
bool isAudible (uint16_t frequency)
 Returns true if the frequency is audible (in the range of 20 Hz to 20 kHz)
 
int mainFrequency (uint64_t idx)
 Determines the frequency of the indicate main note index from 0 to 62.
 
int mainFrequency (uint8_t mainNoteIdx, uint8_t octave)
 Determines the frequency of the indicate main note index (0-6) and octave (0-8)
 
float midiNoteToFrequency (int x)
 Determine frequency of MIDI note.
 
const char * note (int frequency)
 Determines the closes note for a frequency.
 
const char * note (int frequency, int &diff)
 Determines the closes note for a frequency. We also return the frequency difference.
 
float stkNoteToFrequency (int noteNumber)
 

Protected Attributes

uint16_t notes [9][12]
 
const char * notes_str [9 *12]
 

Detailed Description

Determination of the frequency of a music note.

Author
Phil Schatzmann

Member Data Documentation

◆ notes

uint16_t audio_tools::MusicalNotes::notes[9][12]
protected
Initial value:
= {
{N_C0, N_CS0, N_D0, N_DS0, N_E0, N_F0, N_FS0, N_G0, N_GS0, N_A0, N_AS0, N_B0},
{N_C1, N_CS1, N_D1, N_DS1, N_E1, N_F1, N_FS1, N_G1, N_GS1, N_A1, N_AS1, N_B1},
{N_C2, N_CS2, N_D2, N_DS2, N_E2, N_F2, N_FS2, N_G2, N_GS2, N_A2, N_AS2, N_B2},
{N_C3, N_CS3, N_D3, N_DS3, N_E3, N_F3, N_FS3, N_G3, N_GS3, N_A3, N_AS3, N_B3},
{N_C4, N_CS4, N_D4, N_DS4, N_E4, N_F4, N_FS4, N_G4, N_GS4, N_A4, N_AS4, N_B4},
{N_C5, N_CS5, N_D5, N_DS5, N_E5, N_F5, N_FS5, N_G5, N_GS5, N_A5, N_AS5, N_B5},
{N_C6, N_CS6, N_D6, N_DS6, N_E6, N_F6, N_FS6, N_G6, N_GS6, N_A6, N_AS6, N_B6},
{N_C7, N_CS7, N_D7, N_DS7, N_E7, N_F7, N_FS7, N_G7, N_GS7, N_A7, N_AS7, N_B7},
{N_C8, N_CS8, N_D8, N_DS8, N_E8, N_F8, N_FS8, N_G8, N_GS8, N_A8, N_AS8, N_B8}
}

◆ notes_str

const char* audio_tools::MusicalNotes::notes_str[9 *12]
protected
Initial value:
= {
"C0","CS0","D0","DS0","E0","F0","FS0","G0","GS0","A0","AS0","B0",
"C1","CS1","D1","DS1","E1","F1","FS1","G1","GS1","A1","AS1","B1",
"C2","CS2","D2","DS2","E2","F2","FS2","G2","GS2","A2","AS2","B2",
"C3","CS3","D3","DS3","E3","F3","FS3","G3","GS3","A3","AS3","B3",
"C4","CS4","D4","DS4","E4","F4","FS4","G4","GS4","A4","AS4","B4",
"C5","CS5","D5","DS5","E5","F5","FS5","G5","GS5","A5","AS5","B5",
"C6","CS6","D6","DS6","E6","F6","FS6","G6","GS6","A6","AS6","B6",
"C7","CS7","D7","DS7","E7","F7","FS7","G7","GS7","A7","AS7","B7",
"C8","CS8","D8","DS8","E8","F8","FS8","G8","GS8","A8","AS8","B8"
}

The documentation for this class was generated from the following file: