Processing track clip wise with macro

Hello,
I created a macro with the editor in audacity, using built-in functions as well as external plugins like noise gate and De-Clicker. Selecting a clip and calling this macro from the GUI works as expected.
Since I got a lot of clips in my track, I would like to automate this task. So I created a nyquist Plugin:

;type tool
;nyquist plug-in
;version 4
;name "TEST"


(aud-do "CursTrackStart:")
(let ((count (length (aud-get-info "clips"))))
  (dotimes (i count)
    (aud-do "SelNextClip:")
   (aud-do "Macro_TEST_Macro:")
))
"Done."

The name of the macro is TEST_Macro.
But this does not work. I get the message, the nyquist returned a list.

Is there any way to achieve what I intend?

Help is much appreciated

Two things I’d suggest:

  1. Check to see if your version of Audacity has this bug: Unreliable macro processing · Issue #4146 · audacity/audacity · GitHub

  2. Run your Nyquist script using the Debug button to see if there are any error messages.

Thanks for your quick reply!

I’m using Audacity 3.4.2 on Linux.
I cannot reproduce the bug you mentioned, works reliably.

When I run the script from the tools-menu it starts and iterates over the clips. Built-in functions are executed but no external one. On the last clip weird iterations occur as if it was in an endless loop.
Even calling the functions not as macro but explicitly via aud-do does not execute any external plugins, namely noise gate and De-Clicker.

So effectively I do have two problems:

  1. No external plugin is called
  2. Iterations does not end as expected.

Hope you do have an idea

It is not possible to call a Nyquist plug-in from a Nyquist script.

Any other way to achieve what I need?

Export your “Macro_TEST_Macro:” as a .txt file and post it here so that we can see what is in it.

Macro_JoshMeyer'sMaleEQ:
NoiseGate:attack="250" freq="0" funct="Gate" hpf="No" level-red="-15" stlink="Link Stereo Tracks" thresh="-40"
Compressor:AttackTime="0,2" NoiseFloor="-55" Normalize="1" Ratio="2" ReleaseTime="1" Threshold="-50" UsePeak="0"
LoudnessNormalization:DualMono="1" LUFSLevel="-20" NormalizeTo="1" RMSLevel="-21" StereoIndependent="0"
NoiseReduction:Use_Preset="<Factory Defaults>"
De-clicker:control-action-choice="Apply changes" control-crackle-threshold="-45" control-crossfade-interval="5" control-frequency-bound1="150" control-frequency-bound2="9600" control-max-steps="2" control-n-bands="12" control-passes="1" control-relative-threshold="6" co
ntrol-separation="3" control-step-dur-ms="5"
NoiseGate:attack="250" freq="0" funct="Gate" hpf="No" level-red="-3" stlink="Link Stereo Tracks" thresh="-50"
Begrenzer:GAIN-L="8" GAIN-R="8" HOLD="10" MAKEUP="Nein" THRESH="-3" TYPE="SoftLimit"
AcxCheck:Use_Preset="<Current Settings>"

The first macro is just a FilterCurve

Is there a reason why you need to apply the macro to one clip at a time rather than to the entire track?

On the one hand side I think that ACX requires each file to comply and on the other hand De-Clicker won’t run on longer clips.

A simple workaround would be for you to count the number of clips in your audio, then make a macro that calls “Macro_TEST_Macro:” as many times as necessary, with " SelNextClip:" commands between each call.

For a slightly more complex workaround, see this post: Processing long tracks with DeClicker.ny - #22 by steve
Note that this was an experimental plug-in that I wrote about a year ago, and there’s no guarantees that it still works. Feel free to try, but don’t rely on it before you’ve thoroughly tested it.

I’ll have a look. Thanks so far!

This topic was automatically closed after 30 days. New replies are no longer allowed.