Re: MIDISend & MIDIPacketList
Re: MIDISend & MIDIPacketList
- Subject: Re: MIDISend & MIDIPacketList
- From: "Vigour Vigour" <email@hidden>
- Date: Tue, 21 Jan 2003 19:51:55 +0000
Thanks for the info :-)
Exactly what I needed :-)
Best regards Peter
From: Chris Reed <email@hidden>
To: "Vigour Vigour" <email@hidden>
CC: email@hidden
Subject: Re: MIDISend & MIDIPacketList
Date: Tue, 21 Jan 2003 13:50:58 -0600
Here's a snippet of mine:
// Send a midi note on event out the virtual source or our output port.
// A velocity of 0 is used to send a note off event.
- (void)sendMidiNote:(int)midiNote channel:(int)channel
velocity:(int)velocity
{
// send the midi note on out our virtual source
MIDIPacketList packetList;
MIDIPacket *packetPtr = MIDIPacketListInit(&packetList);
unsigned char midiData[3];
midiData[0] = 0x90 | channel;
midiData[1] = midiNote;
midiData[2] = velocity;
packetPtr = MIDIPacketListAdd(&packetList, sizeof packetList, packetPtr,
AudioGetCurrentHostTime(), 3, (const Byte *)&midiData);
if (packetPtr)
{
if (isDestinationConnected) // send over output port
MIDISend(outputPort, selectedDestination, &packetList);
else // send over virtual source
MIDIReceived(virtualSourceEndpoint, &packetList);
}
}
Cheers
-chris
On Tuesday, January 21, 2003, at 12:25 PM, Vigour Vigour wrote:
I have made the following code:
----------
// Create client and port
MIDIClientRef client = NULL;
MIDIClientCreate(CFSTR("Converter"), NULL, NULL, &client);
//MIDIPortRef inPort = NULL;
MIDIOutputPortCreate(client, CFSTR("Output port"), &gOutPort);
// find the first destination
gDest = MIDIGetDestination(0);
MIDISend(gOutPort, gDest, pktlist);
----------
My problem is the pktlist. The only thing I want to do is to send a MIDI
Note On message. Can someone plase help me with this code? The thing I
want to learn is to build a MIDIPacketList from scratch.
Best regards Peter
_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*
http://join.msn.com/?page=features/virus
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.
_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*
http://join.msn.com/?page=features/virus
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.