Question

I'm adding OSC capability to my music drum pad type app for iOS. I'm able to send strings when a pad is hit then use OSCulator to map to MIDI, testing using Logic Pro and plays the notes fine, but am wondering how to give Logic Pro note duration also, how would that be done?

The goal is to make the note continuous until the pad is depressed, so you won't know the duration until the pad is depressed actually. Planning on implementing CoreMIDI in the future but starting with OSC and OSCulator.

Was it helpful?

Solution

Sorted by trial and error, adding Int 1 then adding Int 0 to stop does the trick, but if you have pads where you don't want this behavior adding an Int forces you to also have an Int 0, so in those cases just don't add an Int.

OSCMessage *msg = [OSCMessage createWithAddress:[NSString stringWithFormat:@"/Pad%i", i + 1]];

if (stick)
    [msg addInt:1];             

[outPort sendThisPacket:[OSCPacket createWithContent:msg]];

Then to shut it off:

if (stick)
{
    OSCMessage *msg = [OSCMessage createWithAddress:[NSString stringWithFormat:@"/Pad%i", i + 1]];

    [msg addInt:0]; 

    [outPort sendThisPacket:[OSCPacket createWithContent:msg]];

}

This uses VVOSC/vvopensource. At first it wasn't working but then deleted all OSCulator settings and reconfigured then it worked.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top