Re: AudioUnitReset
Re: AudioUnitReset
- Subject: Re: AudioUnitReset
- From: Philippe Wicker <email@hidden>
- Date: Tue, 4 Mar 2003 23:38:00 +0100
On Tuesday, March 4, 2003, at 09:41 PM, Bill Stewart wrote:
Hi Bill,
Sorry but my english is not perfect and I'm afraid of not understanding
all your posting. I have some questions, they are hereafter among the
text.
>
I thought I'd float some thoughts on this API and how we expect or
>
propose that this should behave (just to make sure that we're all in
>
agreement:)
>
>
Currently (and this is about to change) - when you are using the
>
MusicPlayer to play a sequence and you do a MusicPlayerSetTime on it
>
to reposition its playback position it will then go and chase to get
>
the state established for the AU at that new time (then it continues
>
to play)
The point is about the MusicPlayer, and you talk of an AU. Do you mean
the AU (a MusicDevice or a MusicEffect) which is receiving the MIDI
events? That's what I understand but want to be sure.
As a consequence of a call to MusicPlayerSetTime, you say that the
MusicPlayer will go and chase the state etc... Could you explain what
you mean here? Do you mean a restore of the state that was implied by
the control changes, program changes, sysex, etc... that were sent to
the MusicDevice **before** the loop start point (and which may have
been changed within the loop boundary)?
>
A change that I'd like to make here, is to have the AudioUnit reset
>
before the chase is begun.
>
>
(We currently have a bug where the Synth is not turning off notes when
>
it should be - but that is a different issue)...
Don't know what the MusicPlayer does, but MusicDevice should receives
notes off (or at least a all notes off event) when the jump to a
different time in the sequence occurs.
>
By calling AudioUnitReset in this situation I would expect the
>
following events to occur:
This will be the expected behavior in every situation, an AU has no
mean to determine the context of the call to AudioUnitReset. I don't
see clearly all the situations where AudioUnitReset can be called by
the host, there may be some cases where this would not be the correct
behavior?
>
(1) Any delay lines within the audio unit would be cleared
>
(2) Parameter values would STAY at their current values (ie. they
>
AREN'T set to a default value if they have been changed)
>
(3) Any controller states in a MusicDevice would be set to their
>
default state - for instance, sustain pedal would be turned off, pitch
>
bend would be set back to 0.
>
>
2 and 3 are slightly different in their behaviour - a distinction that
>
I wanted to make clear.
>
>
The state that will then be reinstated after the chasing should be
>
correct (ie. SysEx messages that establish Channel 11 as a second drum
>
channel for instance are chased and would be correctly set - as would
>
any program changes or controller state)
I agree with the point 1. But if "chasing the state" actually means
restoring the state before the loop start point, why do you need the
"temporary" state as described in 2 and 3 ?
If some AU parameters have been set before the loop start point by MIDI
event of type kMusicEventType_Parameter then they should be restored
too. Other AU parameters, those which are independent of any MIDI
event, should keep their current value.
>
>
So - the main affect that AudioUnitReset will do is to clear out any
>
state in the audio data it generates that would have come from the old
>
time - thus MusicPlayerSetTime is quite destructive in that case (and
>
this is analogous to what would occur if you're playing this sequence
>
out to a MIDI device too of course)
>
>
There should be no need for any allocations or other major state
>
changes in the AudioUnit when this API call is made.
>
>
If MusicPlayerSetTime is being used to do looping and you were
>
expecting a seemless transition (ie. delay tails would continue) from
>
the old to the new time, then this will no longer occur.
>
>
Looping should be done on a per-track basis....
Do you mean that loop left and right locators should be specific to
each track and not global to the sequence? Why not, but I have the
feeling that it would be not easy to use in real life.
>
>
Comments?
>
>
Bill
Philippe Wicker
email@hidden
_______________________________________________
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.