Hi Chris,
glad to hear that you already managed to get to this point!
The low-level function which sends NRPN controllers is sendNRPN(nrpnNumber, nrpnValue)
Both parameters are 14 bits.
decl chn = 0;
decl nrpnNumberMsb = (nrpnNumber >> 7) & 0x7f;
decl nrpnNumberLsb = (nrpnNumber >> 0) & 0x7f;
decl nrpnValueMsb = (nrpnValue >> 7) & 0x7f;
decl nrpnValueLsb = (nrpnValue >> 0) & 0x7f;
if( nrpnNumberMsb != lastNrpnAddressMsb ) {
lastNrpnAddressMsb = nrpnNumberMsb;
midiout(0, {0xb0 + chn, 0x63, nrpnNumberMsb});
}
if( nrpnNumberLsb != lastNrpnAddressLsb ) {
lastNrpnAddressLsb = nrpnNumberLsb;
midiout(0, {0xb0 + chn, 0x62, nrpnNumberLsb});
}
midiout(0, {0xb0 + chn, 0x06, nrpnValueMsb});
midiout(0, {0xb0 + chn, 0x26, nrpnValueLsb});
oscout(0, '/1/nrpn', {nrpnNumber, nrpnValue});
[/code]
As you can see, there is a check if the last MSB or LSB of the address byte has already been sent.
Both variables need to be initialized in - this is done in resetNRPN(), called from init() - and init() will be executed "on load" as you can see in the Execution field.
[code]
// initialize with invalid values
lastNrpnAddressLsb = 0xff;
lastNrpnAddressMsb = 0xff;
This should do the trick in a new panel.
If you doing modifications in my own panel, I would propose to call sendCVNRPN(), because it adds the selected channel to the NRPN number.
Best Regards, Thorsten.