Linear ramps for audio unit parameter changes
I am using the AEAudioUnitFilter to access the built-in delay audiounit. I am using the AudioSetParameter to change each of the available parameters. When changing the delay time parameter, there is a noticeable distortion. How would I go about creating a short linear ramp for these changes to avoid this distortion? Is AudioScheduleParameters the way to go? In PD or Max, I would use the line~ object with 20 ms crossfade to smooth this type of modification out, but can't figure out the core audio equivalent or workaround.
Thanks!
Comments
Did you ever figure out the best way to do this?
I am also very interested in finding a solution for this, and posted this question before I discovered the question above:
http://forum.theamazingaudioengine.com/discussion/1043/glitching-caused-by-rapid-volume-changes
A critical feature of the line~ objects mentioned above is that they are interpolating at the audio sampling rate.
In case this is useful for anyone else, I’ve found a function called vDSP_vrampmul (part the Accelerate Framework) that could be useful for this.
Here is an TAAE example where it is utilised:
https://github.com/TheAmazingAudioEngine/TheAmazingAudioEngine/blob/master/Modules/AELimiter.m
Additional links:
https://developer.apple.com/library/tvos/documentation/Accelerate/Reference/AccelerateFWRef/index.html
http://forum.theamazingaudioengine.com/discussion/568/creating-an-envelope
See also the comments section here for Michael’s explanation of how he uses it: http://atastypixel.com/blog/how-to-mix-audio-samples-properly-on-ios/
@mgill404 Thanks very much for that, will check it out!