FlutterMidiCommand
FlutterMidiCommand copied to clipboard
added a test for nrpn message
I think there are a few things to consider here. First thing is that NRPN can be sent either as Running Status CC's or individual CC's. In the case of running status the total length of a full NRPN message (including value LSB) is 9 bytes, whereas it is 12 bytes if sent as individual CC's. This is mostly related to your unit test that only tests for the long form. Saving 25% of the transmitted data is not insignificant when you are sending data over a 31250 baud connection. Same goes for always sending the optional LSB value byte if it is not necessary.
This is my first time dealing with MIDI in software so there's a lot of things I'm not familiar with yet. However, if there are MIDI implementations that can't deal with the shorter form, maybe there's no choice?
For my specific use case I guess I can create a FullNrpnMessage
class in my project that deals with my synth properly.
Also, I think you got the LSB controller wrong, you're using 0x38 where it should be decimal 38/
You are right about the value LSB being off. Thanks.
I just did some testing with some other equipment (I dont have a Rev2) and monitored some midi logs, and it leads me to believe that I've "overinterpreted" the NRPN spec. I think that instead of a single NRPN message that decides to include the valueLSB based on the value instead it should be decided with the message type. Some parameters/controls seems to always send/receive 14 bit values (MSB+LSB) and some only 7 bit. I will make an update that includes two types of NRPN messages.