handleNoteOn() not behaving as expected #354
Replies: 1 comment
-
Problem solved! I guess age creeps up on all of us eventually. And memory doesn't always serve. I did fix it with serial writes once I realized that "channel" is literally the channel number, not the "144" or "msg on channel 0" Thanks for being there in case I didn't catch on in time. Aaron |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I wonder if I'm doing something wrong. I want to send out the received noteOn message. I'm testing with a very simple controller that only sends noteOn messages, nothing else from a keyboard. What I get are often (144,nn,1) messages added between or instead of the input notes. And sometimes the wrong pitch replaces the input note. This is using the same Callbacks example with turnThruOff added and three serial writes added tp the handleNoteOn() function:
Here's the code fragment:
` void handleNoteOn(byte channel, byte pitch, byte velocity) {
Serial.write(channel);
Serial.write(pitch);
Serial.write(velocity); `
and a small sample of output when playing the C scale played staccato: There's an obvious pattern it appears that notes and velocities are confounded as well as many extra very low C#'s !! And I played these notes slowly.
I appreciate any help that's offered, Aaron
MIDI Output:
` TIME msg note vel pitch event
5182468 144 1 60 C#-1 Note On
5183057 144 127 1 G 9 Note On
5183061 144 60 0 C 4 Note Off
5186553 144 1 62 C#-1 Note On
5187075 144 127 1 G 9 Note On
5187076 144 62 0 D 4 Note Off
5190599 144 1 64 C#-1 Note On
5191151 144 127 1 G 9 Note On
5191151 144 64 0 E 4 Note Off
5191945 144 1 65 C#-1 Note On
5192406 144 127 1 G 9 Note On
5192406 144 65 0 F 4 Note Off
5193048 144 1 67 C#-1 Note On
5193460 144 127 1 G 9 Note On
5193460 144 67 0 G 4 Note Off
5194102 144 1 69 C#-1 Note On
5194494 144 127 1 G 9 Note On
5194494 144 69 0 A 4 Note Off
5195398 144 1 71 C#-1 Note On
5195849 144 127 1 G 9 Note On
5195849 144 71 0 B 4 Note Off
5197334 144 1 72 C#-1 Note On
5197928 144 127 1 G 9 Note On
5197929 144 72 0 C 5 Note Off
MIDI Input was very normal:
` msg note vel
4459919 144 60 127 C 4 Note On
4460540 144 60 0 C 4 Note Off
4462214 144 62 127 D 4 Note On
4462689 144 62 0 D 4 Note Off
4463216 144 64 127 E 4 Note On
4463651 144 64 0 E 4 Note Off
4464160 144 65 127 F 4 Note On
4464560 144 65 0 F 4 Note Off
4465016 144 67 127 G 4 Note On
4465450 144 67 0 G 4 Note Off
4465910 144 69 127 A 4 Note On
4466338 144 69 0 A 4 Note Off
4466789 144 71 127 B 4 Note On
4467173 144 71 0 B 4 Note Off
4468957 144 72 127 C 5 Note On
4469620 144 72 0 C 5 Note Off
etc.
Beta Was this translation helpful? Give feedback.
All reactions