Thank you both for the comments, help and clarifications.
I've certainly never needed to do any midi-maths, other than calculate a sysex-checksum (not for Kemper) or bit-shift operations so your stuff seems overly complicated, but again, maybe i dont fully understand your mission
slateboy "your stuff seems overly complicated" - maybe, but all I have done is quote what Kemper says in its page 13 of the MIDI Parameter Documentation 8.6. If you re-read that page 13, you will see what I mean.
Yes, I think you have mis-understood what I am trying to do. All I want to do is to use one of my commercially available, already-existing MIDI controllers, programme it with the proper commands and values, and then get it to change settings in my Kemper Player, also an already-existing, commercially available hardware product - I'm not designing or coding anything. I made the mistake of reading the Kemper documents, and struggling to understand them.
In the end, I have read many times what Torsten (@ToH2002) wrote here, and also the comments from 0K1900 above, and then decided to ditch a fair bit of what Kemper does in its example.
So, if my task is:-
- Change the Amplifier Gain setting in the current rig to 81%
Then my process is
- Use NRPN cc numbers to do this (therefore, use decimal numbers)
- From the Kemper document page 17 - Amplifier module is Address Page 10 {this is then the MSB}
- From the Kemper document page 17 - Gain is parameter number 4 {this is the LSB}
- The adjustable range is 0 - 16483
- 16483 x 0.81 = 13,351 decimal (give or take 1)
- Convert 13351 to binary = 11010000100111 {I used this online converter}
- MSB = left-most 7 bits = 1101000 = 104 decimal
- LSB = right-most 7 bits = 00100111 = 39 decimal
So, using Torsten's info, my MIDI command becomes:-
cc 99 value 10
cc98 value 4 (or 04)
cc 06 value 104
cc38 value 39
Et voila - it works!! Amp Gain becomes 8.1
A bit of a torturous path, and maybe not strictly correct from a programming/computing point of view, but I got there.
Now, for my own edification, I've just got to work out how to do it all using SysEx.