It is possible to chain plugins, (like RMS normalize, limiter), together in a macro, see …
https://forum.audacityteam.org/t/need-help-building-acx-macro-on-2-3-3-version/54739/2
The “Normalize” effect amplifies “up to” a specified peak level (dB).
The "Amplify"effect amplifies “by” a specified amount (dB).
In Nyquist, you can amplify by a specified amount using the “MULT” command (amplification is exactly equivalent to multiplying each sample value).
Example, to amplify the selected audio 20% bigger (linear scale):
(mult *track* 1.20)
Example, to amplify by +3 dB (dB scale):
(mult *track* (db-to-linear 3.0))
If you are running the commands in the Nyquist Prompt, then check that the “Use legacy (version 3) syntax” checkbox is not selected.
https://manual.audacityteam.org/man/nyquist_prompt.html
What do you get if you make a selection in an audio track, and then run this code using the Debug button in the Nyquist Prompt effect?
;version 4
(print *track*)
An upper limit to what? I don’t know what you are referring to.
In what way?
I can’t see you’re computer, so I only know as much about what you are doing as you tell me. To be able to help, I need to know exactly what you are doing and exactly what is happening.
It’s not currently possible to launch a Nyquist effect using AUD-DO (The Limiter is a Nyquist effect).
You can however launch Nyquist effects from Macros.
Saved Macros are stored as text files in:
Users**\AppData\Roaming\audacity\Macros**
Find the relevant text file and attach it to your reply.
And please attach your “RMS_Adjuster” file.
The main problem is that you have multiple “;type” headers. There should only be one. As Nyquist will need access to the audio track (so that it can get the RMS level), the “;type” must be either “process” or “analyze”. As the effect will process the audio, the correct type will be “process”.
Some other issues:
Normally, header lines should begin with a semicolon rather than a dollar sign. The dollar character and the “underscore” function are used in effects that are shipped with Audacity so as to support translation, but that is irrelevant for user plug-ins because translations have to be compiled into Audacity, which is not the case for user plug-ins.
There is no page in the Audacity manual for this effect, so the “;manpage” header should not be used.
The calculation of the “ratio” can be simplified.
Rather than subtracting one dB value from another dB value, you could divide the linear values.
;nyquist plugin
;version 4
;type process
;name "RMS Adjuster"
;action "Adjusting RMS..."
;author "Noah Auden"
;release 2.3.0
;copyright "Public Domain"
(aud-import-commands)
(setf target (db-to-linear -20))
(let ((rms (get '*selection* 'rms)))
(aud-amplify :ratio (/ target rms)))
It would arguably be better to write this plug-in as a pure Nyquist effect, rather than using the macro command “aud-amplify”.
As a pure Nyquist effect:
;nyquist plugin
;version 4
;type process
;name "RMS Adjuster"
;manpage "RMS_Adjuster"
;action "Adjusting RMS..."
;author "Noah Auden"
;release 2.3.0
;copyright "Public Domain"
(setf target (db-to-linear -20))
(let ((rms (get '*selection* 'rms)))
(mult *track* (/ target rms)))
It works for me with this Macro: https://forum.audacityteam.org/download/file.php?id=25566
and this plug-in:
RMS ADJUSTER.ny (295 Bytes)
Your code works?
If you post your full code, I can take a look to see if I can figure out the problem.
There’s multiple problems.
If you replace the last line with an empty string (two double quotes: “”) then the plug-in will run, but it still won’t do what you want it to do.
The major problem is that the Nyquist command:
(get '*selection* 'rms)
Returns the RMS value of the track that is selected when Nyquist starts. Each time in the loop, it returns the same value because Nyquist only sees the initial state of the project - it does not see that through macro scripting commands you are changing the selection.
In effect, the Nyquist script runs first, then each of the macro scripting commands run in the sequence determined by the Nyquist script.
To make this work you would need to write the plug-in as a pure Nyquist script (not using Macro scripting commands).
In a Nyquist plug-in “process” type effect, Audacity will iterate over each selected track in turn. Thus you only need to write the plug-in to process track, write it as ;type process, and ensure that you select all tracks before processing.
If your tracks are different lengths, then the shorter tracks will end up padded with silence. If necessary, this silence can be removed with the “Truncate Silence” effect.