We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 379dbd3 commit a653c4bCopy full SHA for a653c4b
src/AudioTools/MusicalNotes.h
@@ -191,14 +191,14 @@ class MusicalNotes {
191
}
192
193
/// Determine frequency of MIDI note
194
- float midiNoteToFrequency(uint8_t x) {
195
- int a = 440; //frequency of A (coomon value is 440Hz)
196
- return (a / 32) * pow(2, ((x - 9) / 12));
+ float midiNoteToFrequency(int x) {
+ float a = 440; //frequency of A (coomon value is 440Hz)
+ return (a / 32) * pow(2, ((x - 9) / 12.0));
197
198
199
/// Provide MIDI note for frequency
200
- uint8_t frequencyToMidiNote(float freq) {
201
- return log(freq/440.0)/log(2) * 12 + 69;
+ int frequencyToMidiNote(float freq) {
+ return log(freq/440.0)/log(2) * 12.0 + 69.0;
202
203
204
protected:
0 commit comments