• 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: Patrick Gostovic <email@hidden>
  • Date: Tue, 25 Nov 2003 09:35:00 -0500

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.

References: 
 >AUMIDIControllerHandleMIDI (From: Patrick Gostovic <email@hidden>)

  • Prev by Date: External device in Java
  • Next by Date: kAudioUnitProperty_BusCount
  • Previous by thread: AUMIDIControllerHandleMIDI
  • Next by thread: What happened to Daisy?
  • Index(es):
    • Date
    • Thread