0

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.

AstroCB
  • 12,337
  • 20
  • 57
  • 73
colin lamarre
  • 1,714
  • 1
  • 18
  • 25
  • There are note on and note off events. Duration of notes is not sent with note on. – Brad Jul 23 '12 at 13:11
  • ok but what would the OSC string/values look like for on/off, then what do you do in OSCulator? Just on/off would be sufficient for my app, no real need for duration, so this would be great! – colin lamarre Jul 23 '12 at 19:23

1 Answers1

0

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.

colin lamarre
  • 1,714
  • 1
  • 18
  • 25