something like
bool isRPN(); /* or maybe isPartOfRPN(); */
bool inNRPN(); /* or maybe isPartOfNRPN(); */
and something like for MidiMessage static methods
rpnEvent (const int channel, const int controllerType, const int value) throw ()
nrpnEvent (const int channel, const int controllerType, const int value) throw ()
BUT this has to return a MidiBuffer, cause RPN and NRPN are acutally 4 messages.
here is how i make RPN
MidiBuffer midiBuf;
BitArray ctrlrNumber; /* this is the controller number 1-16383 */
BitArray ctrlrValue; /* controller value same range */
int ctrlrNumberLsb = ctrlrNumber.getBitRangeAsInt (0,6);
int ctrlrNumberMsb = ctrlrNumber.getBitRangeAsInt (7,13);
int ctrlrValueLsb = ctrlrValue.getBitRangeAsInt (0,6);
int ctrlrValueMsb = ctrlrValue.getBitRangeAsInt (7,13);
int firstByte = 0xb0;
MidiMessage msg (firstByte, 99, ctrlrNumberLsb);
midiBuf.addEvent (msg,0);
msg = MidiMessage(firstByte, 98, ctrlrNumberMsb);
midiBuf.addEvent (msg,1);
msg = MidiMessage(firstByte, 6, ctrlrValueLsb);
midiBuf.addEvent (msg,2);
msg = MidiMessage(firstByte, 38, ctrlrValueMsb);
midiBuf.addEvent (msg,3);
here is how i make NRPN
MidiBuffer midiBuf;
BitArray ctrlrNumber; /* this is the controller number 1-16383 */
BitArray ctrlrValue; /* controller value same range */
int ctrlrNumberLsb = ctrlrNumber.getBitRangeAsInt (0,6);
int ctrlrNumberMsb = ctrlrNumber.getBitRangeAsInt (7,13);
int ctrlrValueLsb = ctrlrValue.getBitRangeAsInt (0,6);
int ctrlrValueMsb = ctrlrValue.getBitRangeAsInt (7,13);
int firstByte = 0xb0;
MidiMessage msg (firstByte, 101, ctrlrNumberLsb);
midiBuf.addEvent (msg,0);
msg = MidiMessage(firstByte, 100, ctrlrNumberMsb);
midiBuf.addEvent (msg,1);
msg = MidiMessage(firstByte, 6, ctrlrValueLsb);
midiBuf.addEvent (msg,2);
msg = MidiMessage(firstByte, 38, ctrlrValueMsb);
midiBuf.addEvent (msg,3);
