Sending MIDI SysEx scaled to 7 bits

Hello new user here.
I am also quite new to programming. At the moment I am building a remote control for my mixing console via GPIs and MIDI SysyEx messages. At the moment mainly unidirectional, switching banks and layers via Hardware 5Pin MIDI connection and (at the moment) with an Arduino UNO. (Transitioning to a -Micro or teensy 3.2 for the final device).
Now the one thing I can not get my head around:
The SysEx messages to control the desk are 18 byte SysEx messages.
I am wanting to use rotary encoders to control different audio monitoring levels.
Byte 16 and 17 give the data for the different levels, with byte 17 counting up to 0x7F (so 7 bits only) then shifting byte 16 to 0x01. (Complete scale is from (0x00), (0x00) to (0x07), (0x7F))
I can read, count and save the encoder clicks, and assign them to count up byte 17. Problem is, I can only count all the 8 bits (0xFF) of byte 17 before byte 16 switches to the next state.
2nd problem: I would like have an option to scale the values (so I can letˋs send messages to go up in 2 or 3 dB steps, instead of the 0.1 dB which is the full resolution.
I have been thinking about this for so long, that at the moment I am totally lost on how to achieve this. Maybe someone has an idea or a hint? Thank you for ideas.

To split an integer "value" into two 7 bit fields is simply a case of shifting and masking:

  byte high_part = (byte) (value >> 7);
  byte low_part = (byte) (value & 0x7F) ;

The map() function may be useful for the scaling issue.

Thank you very much MarkT.
I will look into it, but might come up with some more questions.. :sweat_smile:

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.