0

I using MIKMIDI to send a combined NRPN command. I am trying to send a NRPN of this style

B9H 63H 40H || B9H 62H 64H || B9H 06H 7FH (hex)

which is

B9 99 64 || B9 98 100 || B9 06 127 (dec)

Which i try to create this way

// create the MSB and LSB command
MIKMutableMIDIControlChangeCommand *msb = [[MIKMutableMIDIControlChangeCommand alloc] init];
msb.channel          = 9;
msb.controllerNumber = 99;
msb.controllerValue  = 64;
MIKMutableMIDIControlChangeCommand *lsb = [[MIKMutableMIDIControlChangeCommand alloc] init];
lsb.channel          = 9;
lsb.controllerNumber = 98;
lsb.controllerValue  = 100;
// compose the full command
cmd = [MIKMutableMIDIControlChangeCommand commandByCoalescingMSBCommand:msb andLSBCommand:lsb];
cmd.channel          = 9;
cmd.controllerNumber = 6;
cmd.controllerValue  = 127;

But it returns a nil pointer.

What am i doing wrong?

Martin Mlostek
  • 2,755
  • 1
  • 28
  • 57

1 Answers1

0

The commandByCoalescingMSBCommand documentation says:

This method is used internally by MIKMIDI, to coalesce incoming 14-bit control change commands. it is not generally useful to external users of MIKMIDI. If you're simply trying to create a new MIKMIDIControlChangeCommand instance, you should use plain alloc/init instead.

CL.
  • 173,858
  • 17
  • 217
  • 259