Recurrence relation for real-time audio fading - Lupsa-Tataru, Lucian (Technium: Romanian Journal of Applied Sciences and Technology, 2023)
Starting from shaping the audio fade profile by an invertible rational function, with playback position as the input, we derive a recurrence relation that enables the audio volume updating as long as the time domain discretization is carried out with a constant step size. The resulted recurrence relation yields the audio volume current value as rational function of its previous value only, thus being suitable for efficiently implementing real-time adjustable fades whenever the adopted programming language (or software framework) allows the invocation of timing events. A JavaScript implementation, prepared for straightaway experimentation, and put forward in the paper, highlights the convenience of associating the derived recurrence relation with the "setInterval()" method in order to perform real-time audio fades, which can resemble either the logarithmic shape fade or the fade of exponential shape.