Is it possible to transform a sound track into a smoothened curve ?

Hello all,

For context :
I am in a project of making the speed of a 3D animated car reactive to low audio frequencies.
I already separated the lower frequencies and got this audio file (attachment #1).

Issue :
I can’t use this audio, as I can’t have such spikes.
I need to work on the audio file to obtain something smooth like this curve in red (attachment #2).

Important note :
It doesn’t matter how bad the result sounds like. Since this audio won’t be heard, it will only be analyzed by my 3D animation software and expressed visualy. (I will then add the actual original audio on top).

Is there a way to achieve this ?
Is it something a script would have to be created for ?

Thank you
smooth audio.png
Attachment #1.png

Try applying this code using the Nyquist Prompt effect

;version 4

;control step "Samples per step" int "" 100 1 1000
;control operation "Follow" choice "Peaks,Average" 0

(if (= operation 0)
    (setf operation OP-PEAK)
    (setf operation OP-AVERAGE))

(force-srate *sound-srate*
    (snd-avg (snd-abs *track*) step step operation))

  • When “Follow Peaks” is selected, the code looks for the maximum peak within each block of samples.
  • When “Follow Average” is selected, the code calculates the average absolute level within each block.
    In both cases, the sign (positive or negative) of the sample values is ignored, thus a negative peak will produce the same output as an equivalent positive peak.
  • The size of each block is set by the first control.

Hello Steve,

Thank you for the reply,
For some reason I don’t have that plugin activated, and when I want to activate it and press OK, nothing happens.
If I go back to “remove/add plugins” it is back in the list of non-activated plugins (see attachment)
after pressing ok and going back.png
everything enabled.png

Did you click the “Enable” button after selecting “Nyquist Prompt”?

Yes of course, I also tried to restart, open as administrator, tried older audacity versions, tried to open the plugin files with VSCode and I could which means I have the rights…

What items are listed in the “Generate” menu?

generate menu.png

OK, so you have no Nyquist effects at all.

Look in Audacity’s “Preferences > Effects
and ensure that “Nyquist” is enabled (ticked).

Nyquist is actualy ticket already :confused:

I’ll show you the problem:
The Generate menu should look like this:
Notice the three menu items “below the line”. They are Nyquist plug-ins.
For some reason, Nyquist is not working in your version of Audacity.

Try this:

  1. Exit Audacity
  2. Launch Audacity
  3. “Help menu > Diagnostics > Show log”
  4. Copy and paste the full contents of the log into your reply.

I’m hoping that this will give some indication of where the problem lies.

23:28:19: Audacity 2.4.1
23:28:19: Trying to load FFmpeg libraries…
23:28:19: Trying to load FFmpeg libraries from system paths. File name is ‘avformat-55.dll’.
23:28:19: Looking up PATH environment variable…
23:28:19: PATH = ‘C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64_win\compiler;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\dotnet;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files\Common Files\Autodesk Shared;C:\Program Files\Microsoft SQL Server\120\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Users\Monstar\AppData\Local\Programs\Python\Python37-32\Scripts;C:\Users\Monstar\AppData\Local\Programs\Python\Python37-32;C:\Users\Monstar\AppData\Local\Microsoft\WindowsApps;;C:\Users\Monstar\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Monstar\AppData\Roaming\npm’
23:28:19: Checking that ‘’ is in PATH…
23:28:19: FFmpeg directory is in PATH.
23:28:19: Checking for monolithic avformat from ‘avformat-55.dll’.
23:28:19: Error: Failed to load shared library ‘avformat-55.dll’ (error 126: Le module spécifié est introuvable.)
23:28:19: Loading avutil from ‘’.
23:28:19: Error: Failed to load shared library ‘.dll’ (error 126: Le module spécifié est introuvable.)
23:28:19: Loading avcodec from ‘’.
23:28:19: Error: Failed to load shared library ‘.dll’ (error 126: Le module spécifié est introuvable.)
23:28:19: Loading avformat from ‘avformat-55.dll’.
23:28:19: Error: Failed to load shared library ‘avformat-55.dll’ (error 126: Le module spécifié est introuvable.)
23:28:19: Error: Failed to load FFmpeg libraries.
23:28:19: Error: Failed to find compatible FFmpeg libraries.

Thank you

Did you download the EXE version of Audacity 2.4.1 or the ZIP version?
How did you install Audacity?
If you installed the EXE version, did you “reset preferences” during the installation?

I installed the .exe of that version yes, but don’t remember having a “reset preferences option”.

I think the best thing to try is a total reset of Audacity and hope that clears the problem.
To do that:

  1. Exit Audacity
  2. Open the hidden folder:
  1. Delete the three files:
  2. audacity.cfg
  3. pluginregistry.cfg
  4. pluginsettings.cfg
  5. Launch Audacity.
    You should be greeted with the “Welcome” screen

Hopefully you should now see the Nyquist effects in the “Generate menu”, and the Nyquist Prompt should be listed in the “Tools” menu.

Thank you very much, I have the prompt working now.

Now about the Nyquist script, I played a bit with the value and while pressing “OK” I get the following window (view attachment), and nothing else happens or change after closing it.

Am I missing something ?

Super :slight_smile:

Try running it with the “Debug” button rather than the “OK” button. That should open an additional window with some debug information.
Copy and paste the debug information (as text, not a screenshot) into your reply.

error: bad argument type - #(#<Sound: #1537328> #<Sound: #1537568>)
Function: #<Subr-SND-ABS: #8365db0>
#(#<Sound: #1537328> #<Sound: #1537568>)


It works for me.
Do you have sound driver installed for motherboard? I had to do this once I get some issues.

The code that I posted requires a mono track.
Try it on a mono track and see if it does what you want. If it does, then it can be adapted for stereo.

It is now working, thank you very much! :slight_smile: