Sending out through virtual MIDI sources on iOS
Sending out through virtual MIDI sources on iOS
- Subject: Sending out through virtual MIDI sources on iOS
- From: Michael Tyson <email@hidden>
- Date: Thu, 10 Nov 2011 11:05:59 +0100
Hey list,
I'm *this* close to having a fully functioning clock send/receive from my iOS app, but I'm having problems figuring out how to put the clock on my app's virtual source endpoint, so other apps can listen to it.
I've created the virtual source with:
OSStatus s = MIDISourceCreate(client, (CFStringRef)sourceNameString, &virtualSourceEndpoint);
...Then, when I'm ready to send messages:
// Assign proper timestamps to packetList
MIDIPacket *packet = &packetList->packet[0];
for ( int i = 0; i<packetList->numPackets; i++ ) {
packet = MIDIPacketNext(packet);
if ( packet->timeStamp == 0 ) {
packet->timeStamp = (MIDITimeStamp)mach_absolute_time();
}
}
// Send it
OSStatus s = MIDIReceived(virtualSourceEndpoint, packetList);
NSLogError(s, @"Sending MIDI");
This all seems to happen without a hitch (no errors reported), but the other app I'm testing it with, MoDrum, doesn't see anything on the other end, and neither does the Midi Monitor app.
Is there a step I've missed in the initialisation, perhaps?
Many thanks,
Michael
--
Michael Tyson | atastypixel.com
A Tasty Pixel: Artisan apps
aim: mikerusselltyson
twitter: MichaelTyson
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden