-
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? |
Beta Was this translation helpful? Give feedback.
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 |
Beta Was this translation helpful? Give feedback.
Check out the Callbacks example, it does just that.
The
handleNoteOn
function will be called when the Arduino receives a NoteOn, and thepitch
parameter 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