Automatic speed-loudness control

Effects, Recipes, Interfacing with other software, etc.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Post Reply
user2012
Posts: 22
Joined: Sat Dec 01, 2012 7:57 pm
Operating System: Please select

Automatic speed-loudness control

Post by user2012 » Sun Sep 29, 2013 10:22 pm

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

steve
Site Admin
Posts: 80752
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Automatic speed-loudness control

Post by steve » Sun Sep 29, 2013 11:19 pm

Have you tried creating the effect using a "Time track"? http://manual.audacityteam.org/o/man/time_tracks.html
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

user2012
Posts: 22
Joined: Sat Dec 01, 2012 7:57 pm
Operating System: Please select

Re: Automatic speed-loudness control

Post by user2012 » Mon Sep 30, 2013 3:03 am

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.

Trebor
Posts: 9852
Joined: Sat Dec 27, 2008 5:22 pm
Operating System: Windows 8 or 8.1

Re: Automatic speed-loudness control

Post by Trebor » Mon Sep 30, 2013 5:13 am

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 1060 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.

steve
Site Admin
Posts: 80752
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Automatic speed-loudness control

Post by steve » Mon Sep 30, 2013 1:44 pm

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?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply