Re: Glissando: smoothing touch drags
Re: Glissando: smoothing touch drags
- Subject: Re: Glissando: smoothing touch drags
- From: Jean-François Brouillet <email@hidden>
- Date: Fri, 17 Feb 2012 14:54:57 +0000
Thank you all for your input.
I'm glad to report success thanks to the many suggestions.
1. the _desired_ value is set from the main UI thread into a volatile float
2. parameter interpolation is done from within the callback
3. on the first sample of the frame, I compute an increment between the actual and desired value, which ends up being zero when they are equal
4. each sample is assigned the "next element" in the linear ramp as per the increment
5. on the last sample of the frame I set the current to the desired value just in case of round-off errors.
This all means that:
- only the UI thread *writes to* the desired value
- the parameter change is spread throughout the whole duration of the frame
- I have a "one frame" latency at the worst case.
So it doesn't really matter anymore which granularity the UI gives me the parameter with, nor how fast it changes: it will reach the desired value within (typically) 1024 samples, which makes for a pretty fine smoothing.
I just can not hear any discontinuity anymore! :-)
Thanks again.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden