Re: Stuck notes in Rax and Synthtest
Re: Stuck notes in Rax and Synthtest
- Subject: Re: Stuck notes in Rax and Synthtest
- From: Chris Reed <email@hidden>
- Date: Thu, 8 May 2003 16:55:43 -0500
On Thursday, May 8, 2003, at 14:04 US/Central, Bill Stewart wrote:
Let me shed some light on this.
Thanks
We had a problem with 10.2 where scheduling notes to the DLS synth
from a thread that wasn't its render thread would cause some bad
things to happen...
So, we added a queueing mechanism for 10.2.3 - that worked most of the
time, but there was a case where you'd get stuck notes. We fixed this
in 10.2.5...
That probably explains why some machines would exhibit the stuck notes
and others not.
Basically, the idea is:
MusicDevice get its render call.
A host (like the MusicPlayer/MusicSequence API) - attaches render
notifiers for ANY of its audio units that it has to schedule events
for.
In the pre-render call it schedules events for that slice. This is by
far the best way to schedule events as each event can be scheduled
down to the sample...
I used almost exactly the same mechanism in an AU sequencer project I
was working on back around Christman... and it works like a charm.
The simple description of how it works (basically re-phrasing what Bill
said above) is that the object that wraps an AU has a queue of incoming
note events, each with a timestamp in frames. In the pre-render
callback, it pulls all events that will occur in the upcoming buffer
out of the queue and passes them to the AU. Any events that occur after
this slice are left in the queue.
After the pre-render call, the DLS synth then dequeues any events that
have occured since its last dequeue (its previous setup to render)
It then renders those events...
Any events that come in after this dequeueing are then queued up until
the next render call, whether the synth is in the process of rendering
or is quiescent.
Its been our intention to have a better base class for doing music
devices, but unfortunately that has fallen by the way side a bit...
This kind of queueing really should be done by any synth, so would
eventually be in this base class when we have time to do it...
That will be very nice to have...
If you have reports of stuck notes, make sure your user is on 10.2.5 -
there should be no problem there and no need for you to do any
additional work to avoid this problem...
Bill
-chris
_______________________________________________
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.