Nyquist Help Please!

Does anyone know of a pre-made nyquist prompt that will ease a section into a high pass filter as opposed to just going from no filter to full on filter?

  • The “Nyquist Prompt”: is an effect that allows you to run “Nyquist commands” inside Audacity.
  • Nyquist”: is a programming language for audio that is included in Audacity, but is separate from Audacity (a stand-alone version is also available).
  • Nyquist plug-ins”: are “Nyquist scripts” (programs), in plain text format, that have a few additional lines at the beginning of the file to tell Audacity to run the code as a plug-in (and optionally may tell Audacity to create a simple graphical interface).

Here’s a “Nyquist script” that can be run in the “Nyquist Prompt effect” that goes from (almost) no filter to 2500 Hz high-pass filter. The transition occurs over the first 1/10th of the selected audio. The filter is a first-order (6 dB/octave) high-pass filter.

;version 4
(setf hz-env (pwl 0 0 0.1 2500 1 2500 1))
(hp *track* hz-env)

The first line tells Audacity to treat the code as a “version 4” Nyquist plug-in.

The second line creates a symbol (a “variable”) called “hz-env” (it could be called almost anything), and sets it’s value to the result of the “PWL” command.
The PWL command creates a varying control signal with a list of “control points”. The control points are “time, level” pairs in the form:
“T0, L0”, “T1, L1”, “T2, L2”…
ending with a final “time value” and an implied but not written level of 0.
In Audacity effects, the times are relative to the length of the selection, so we have:
time = 0, level = 0
time = 0.1, level = 2500
time = 1, level = 2500 (end of the selection)
time = 1, implied level = 0, but we’ve already reached the end of the selection, so effectively ignored.
PWL in the Nyquist manual: http://www.cs.cmu.edu/~rbd/doc/nyquist/part8.html#index408

The final line is the filter, in the form:
HP the high-pass filter function: http://www.cs.cmu.edu/~rbd/doc/nyquist/part8.html#index444
TRACK a special symbol that represents the selected audio.
hz-env the filter frequency, which we have created as a varying control signal.