spencersalazar / chuck

28 stars 8 forks source link

- ignore non-note commands #26

Closed paiv closed 10 years ago

paiv commented 10 years ago

The command byte of a MIDI message is not a mask, it's a range. For note-on the range is 0x90 - 0x9F. By applying 0x90 mask you would pick non-note messages (0xB0, 0xD0).

spencersalazar commented 10 years ago

Hmm -- I think this change will make it so only noteOns on MIDI channel 1 are processed, whereas the intent is to process noteOns on all channels. I think the intent could be clearer than whats in current master though, e.g.

if((msg.data1 & 0xF0) == 0x90 ...
paiv commented 10 years ago

Yep, I made it that way deliberately, 'cause I'm not sure other channels would be handled properly, if they are present. Feel free to discard my pull request, and update it the way you like. Thank you.

spencersalazar commented 10 years ago

Ok, cool -- so, the change I discussed has been added as of 0ff7658310ce66a7025778392d8659a7ac9a95ba.

Thanks, spencer