Page 1 of 1

Automatic speed-loudness control

Posted: Sun Sep 29, 2013 10:22 pm
by user2012
Hi. I'm looking for an automatic effect that will make an audio clip a bit slower and faster depending on how loud a particular section of audio is.

Like, I'm looking for an effect that will slightly slow down the audio clip when the audio file plays a loud tone and speeds up as it gets quieter.
(Eg. If the audio is: at -15db it will be fullspeed, at -10db is will be a little slower, at -6db it will be even slower, going back to -10 it will start speeding up again)

Something that will have an adjustable Attack Time, Release Time, Threshold, and Ratio, just like a compressor.

Image

I hope I make sense to you guys, its kinda hard to explain.

Through this, I'm trying to simulate: how an audio playback circuit (mostly used in digital toys) will slow down and speed up on a low battery depending on how much power/loudness is output to its speaker. With what I'm trying to do I'll likely use 0.1 second attack, 1.0 second release, and threshold of approx -14 db

Re: Automatic speed-loudness control

Posted: Sun Sep 29, 2013 11:19 pm
by steve
Have you tried creating the effect using a "Time track"? http://manual.audacityteam.org/o/man/time_tracks.html

Re: Automatic speed-loudness control

Posted: Mon Sep 30, 2013 3:03 am
by user2012
steve wrote:Have you tried creating the effect using a "Time track"? http://manual.audacityteam.org/o/man/time_tracks.html
In fact, I HAVE tried that already. But, I find that it's for one thing not bang time-accurate.

And secondly, I work around that by pre-slowing down the track by 500%, doing the timetrack, then putting the speed back to normal after saving. From there, I take like 10 minutes just to attempt to do this on 10 seconds worth of audio (approx. 50 points made), but I still don't feel I've achieved the effect I wanted due to not doing an accurate job (its hard).

That's why I feel I need something to do this job for me automatically.

Re: Automatic speed-loudness control

Posted: Mon Sep 30, 2013 5:13 am
by Trebor
At first glance frequency-modulating the sound by its envelope will do it ...
Waveform and its envelope.png
Waveform and its envelope.png (51.77 KiB) Viewed 1062 times
but the whole thing increasingly goes out of sync :cry: ...

Code: Select all

(defun fm (s-in)
   (let* ((s-in (lowpass8 s-in (* 0.2 *sound-srate*)))
         (s-in (lowpass8 s-in (* 0.2 *sound-srate*)))
         (map (integrate (db-to-linear (scale 5 (aref s-in 0))))))
      (snd-resamplev (aref s-in 1) *sound-srate* map)))

(fm s)
The above code frequency-modulates the right track by the left one
paste it in "Nyquist_Prompt" ... http://manual.audacityteam.org/man/Nyquist_Prompt
Change "scale 5" to a lower number for less pitch wobble.

Re: Automatic speed-loudness control

Posted: Mon Sep 30, 2013 1:44 pm
by steve
Trebor wrote:but the whole thing increasingly goes out of sync :cry: ...
and it would be difficult to automatically calculate the necessary timing corrections.

I think the way to do it would be to loop through short sections so that the timing drift (per section) is not significant.
Also, I think that the perceived quality could be improved by creating a smoother envelope that rides the peaks (see follow and snd-avg).
user2012 wrote:In fact, I HAVE tried that already. But, I find that it's for one thing not bang time-accurate.

And secondly, I work around that by pre-slowing down the track by 500%, doing the timetrack, then putting the speed back to normal after saving. From there, I take like 10 minutes just to attempt to do this on 10 seconds worth of audio (approx. 50 points made), but I still don't feel I've achieved the effect I wanted due to not doing an accurate job (its hard).

That's why I feel I need something to do this job for me automatically.
Do you have a lot of these to do?
How accurate does it need to be?
I had a quick go and it seemed to be pretty effective. I worked from left to right making the adjustments. I also set the tempo range so that the "Upper speed limit" was 100%.
Can you think of any other applications where this effect could be useful?