• 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: AUMIDIControllerHandleMIDI
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AUMIDIControllerHandleMIDI


  • Subject: Re: AUMIDIControllerHandleMIDI
  • From: William Stewart <email@hidden>
  • Date: Mon, 1 Dec 2003 16:59:22 -0800

The AUMIDIController won't do any scheduling for you - as far as it is concerned any MIDI event happens now. We don't plan on adding any scheduling capabilities to it either.

CoreMIDI will schedule outgoing MIDI events based on Host-Time Stamps
The Music Sequence API provides services for scheduling musical events to either audio units or to MIDI destinations

Bill

On 25/11/2003, at 6:35 AM, Patrick Gostovic wrote:

Thanks Herbie. I'm pretty sure I was heeding the "massiveness" of host
times though. Here is my test code -- it's supposed to wait one
second, then play a note for one second. The result, however, is a
very short note. Any ideas? Anyone?

UInt64 oneSecHostTime = AudioConvertNanosToHostTime(1000000000);
UInt64 noteOnTs = AudioGetCurrentHostTime() + oneSecHostTime;
UInt64 noteOffTs = noteOnTs + oneSecHostTime;

MIDIPacketList packetList;
MIDIPacket *packet = MIDIPacketListInit(&packetList);

Byte noteOnEvent[] = { 0x90, 48, 127};
packet = MIDIPacketListAdd(&packetList, sizeof(packetList), packet,
noteOnTs, sizeof(noteOnEvent), noteOnEvent);

Byte noteOffEvent[] = { 0x90, 48, 0};
packet = MIDIPacketListAdd(&packetList, sizeof(packetList), packet,
noteOffTs, sizeof(noteOffEvent), noteOffEvent);

OSStatus status = AUMIDIControllerHandleMIDI(auMIDIController,
&packetList);
if(status)
NSLog(@"AUMIDIControllerHandleMIDI error: %i", (int)status);


On 24-Nov-03, at 11:59 PM, Herbie Robinson wrote:

AudioGetCurrentHostTime

1. Don't assume that adding a small number to the current host time
will produce a noticeable delay. The clock granularity varies from
machine to machine, but it's been well into the microseconds anyplace
I've seen it.

2. One flavor of virtual endpoints doesn't process the timestamps in
the Midiserver, but leaves it to the packet recipient (which makes
sense for some, but not all recipients).

What is the reference point for the MIDITimeStamp's of the MIDIPackets
passed into AUMIDIControllerHandleMIDI()? Should "now" be 0 or
AudioGetCurrentHostTime()? No matter what I try, the notes just play
right away.

Thanks

Patrick

-- -*****************************************
** http://www.curbside-recording.com/ **
******************************************
_______________________________________________
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.


-- mailto:email@hidden
tel: +1 408 974 4056

________________________________________________________________________ __
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________ __
_______________________________________________
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: MusicTracks and userData Event Types
  • Next by Date: Re: Parameters & Listeners & Host & Cocoa
  • Previous by thread: Re: MusicTracks and userData Event Types
  • Next by thread: Re: Parameters & Listeners & Host & Cocoa
  • Index(es):
    • Date
    • Thread