![]() |
Mozzi
alpha 0.01.1t
sound synthesis library for Arduino
|
Functions | |
float | mtof (float midival) |
Converts midi note number to frequency. | |
Q16n16 | Q16n16_mtof (Q16n16 midival_fractional) |
Converts midi note number to frequency with speed and accuracy. | |
unsigned int | mtof (unsigned char midi_note) |
A good choice if you're using whole note values, want speed and simplicity, and accuracy isn't important. | |
unsigned int | mtof (int midi_note) |
A good choice if you're using whole note values, want speed and simplicity, and accuracy isn't important. |
float mtof | ( | float | midival | ) |
Converts midi note number to frequency.
Caution: this can take up to 400 microseconds to run. It can seriously mess up the audio output if you use it in updateControl() or updateAudio(). This is a good choice in setup(), or where you need precise midi-pitch conversion and aren't doing much other audio calculation.
midival | a midi note number. Like the mtof object in Pd, midi values can have fractions. |
Definition at line 14 of file mozzi_midi.cpp.
unsigned int mtof | ( | unsigned char | midi_note | ) |
A good choice if you're using whole note values, want speed and simplicity, and accuracy isn't important.
midi_note | a midi note number. |
Definition at line 145 of file mozzi_midi.cpp.
unsigned int mtof | ( | int | midi_note | ) |
A good choice if you're using whole note values, want speed and simplicity, and accuracy isn't important.
midi_note | a midi note number. |
Definition at line 155 of file mozzi_midi.cpp.
Q16n16 Q16n16_mtof | ( | Q16n16 | midival_fractional | ) |
Converts midi note number to frequency with speed and accuracy.
Q16n16_mtofLookup() is a fast alternative to (float) mtof(), and more accurate than (unsigned char) mtof(), using Q16n16 fixed-point format instead of floats or byte values. Q16n16_mtof() uses cheap linear interpolation between whole midi-note frequency equivalents stored in a lookup table, so is less accurate than the float version, mtof(), for non-whole midi values.
midival | a midi note number in Q16n16 format, for fractional values. |
Definition at line 121 of file mozzi_midi.cpp.