• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: MIDISend & MIDIPacketList
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
  • Prev by Date: Re: MIDISend & MIDIPacketList
  • Next by Date: Re: MIDISend & MIDIPacketList
  • Previous by thread: Re: MIDISend & MIDIPacketList
  • Next by thread: Unloading a sound driver
  • Index(es):
    • Date
    • Thread