Re: MIDIPacketListAdd and MIDITimeStamp
Re: MIDIPacketListAdd and MIDITimeStamp
- Subject: Re: MIDIPacketListAdd and MIDITimeStamp
- From: Doug Wyatt <email@hidden>
- Date: Tue, 20 Aug 2002 10:12:37 -0700
On Sunday, Aug 18, 2002, at 04:30 US/Pacific, Andrew Duncan wrote:
for (i = 0; i < 10; ++i) {
noteOn[1] += 1;
when += 1000; // What's appropriate here?
newPacket = (MIDIPacket *) MIDIPacketListAdd(newPacketList,
sizeof(buffer),
newPacket, when, 3, noteOn);
}
// code to send packets omitted
---
To my great surprise, this actually causes noises to emit from the
speaker
(yay!), but the notes all sound at the same time (boo!). In other
words, I
get a 10-note chord. :o)
I'd like to queue the notes so they play further apart. Every
half-second
or more would be fine. If I can get that working, I should be golden.
Assuming that MIDISend doesn't just ignore my timestamps, what are
appropriate values? Or perhaps I need to set the timestamp to zero and
schedule things myself, perhaps with an NSTimer or something?
Your timestamps have to be in host time units -- you can use the
routines in CoreAudio/HostTime.h to create good ones.
The timestamps you're sending right now are very small and in the far
distant past and that's why MIDIServer is playing the events
immediately ("better late than never").
Doug
--
Doug Wyatt
work: email@hidden (CoreAudio)
personal: email@hidden
http://www.sonosphere.com
"When you discard arrogance, complexity, and a few other things that
get in
the way, sooner or later you will discover that simple, childlike, and
mysterious secret known to those of the Uncarved Block: Life is Fun."
-- The Tao of Pooh
_______________________________________________
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.