|
I have been trying to find some way to detect what note was pressed but I don't know how to make an if statement for that. My goal is to find what note has been sent to the Arduino, and then depending on what note it was send an analog voltage out with analogWrite();. Any ideas? |
Answered by
franky47
Mar 17, 2022
Replies: 1 comment 15 replies
|
Check out the Callbacks example, it does just that. The arduino_midi_library/examples/Callbacks/Callbacks.ino Lines 12 to 19 in 2d64cc3 |
15 replies
Answer selected by
Kinokoda
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Check out the Callbacks example, it does just that.
The
handleNoteOnfunction will be called when the Arduino receives a NoteOn, and thepitchparameter will be the note number (between 0 and 127, check out this table to map it to human-friendly note numbers).arduino_midi_library/examples/Callbacks/Callbacks.ino
Lines 12 to 19 in 2d64cc3