Open franky47 opened 3 years ago
@franky47 i would like to work on this
@akshay4n, awesome, go ahead !
Ping me here if there's anything you need help with.
@franky47 I took a look at #203 and went through https://www.inspiredacoustics.com/en/MIDI_note_numbers_and_center_frequencies and https://www.arduino.cc/reference/en/language/functions/advanced-io/tone/ The problem isn't quite clear to me
I initially thought that the frequency values were off in the pitch list, but the problem is in reading the table.
It starts at B0, which should map to MIDI note number 23. So the index at which we read the pitch should be noteNumber - 23
to map to the correct note (while taking care not to output negative indices):
https://github.com/FortySevenEffects/arduino_midi_library/blob/master/examples/SimpleSynth/SimpleSynth.ino#L54
See #203.
Correct values of pitches: https://www.inspiredacoustics.com/en/MIDI_note_numbers_and_center_frequencies
Values must be rounded to the nearest integer, as the
tone
function does not accept floating point values.