lichen-community-systems / flocking-midi

A collection of MIDI components for Infusion and Flocking
1 stars 2 forks source link

Pitch bend and song pointer MIDI messages are read incorrectly #16

Closed colinbdclark closed 4 years ago

colinbdclark commented 7 years ago

Flocking currently erroneously reads incoming 14-bit MIDI messages such as pitch bend and song pointer:

https://github.com/colinbdclark/Flocking/blob/ddcfd375097382351433940f7a510a0c8d3e144a/src/web/midi.js#L216 https://github.com/colinbdclark/Flocking/blob/ddcfd375097382351433940f7a510a0c8d3e144a/src/web/midi.js#L286

The message's MSB (i.e. data[2]) should be shifted, not the LSB. Since this error is duplicated twice in the code base, it's clear that it should be factored into a utility function for reading 14-bit MIDI messages.