Audacity Support Forum / Audacity and Nyquist / Nyquist Reference Manual / Nyquist Examples and Tutorials


Steven Jones / Pedro Morales / David R. Sky / Nyquist and Emacs / Audacity Wiki


The Audacity Nyquist Prompt


With the Audacity Nyquist Prompt you can test small snippets of Nyquist code or doing quick audio hacks. On this page the basic usage of the Nyquist prompt is explained.

  1. Preparations

  2. The Nyquist Prompt

Note: All [comments] and [explanations] are written in square brackets, so they cannot be confused with (Lisp code).


1  Preparations


The Audacity Nyquist prompt is placed in the Audacity 'Effect' menu which only can be activated if an Audacity audio track exists and at least a part of it marked or selected [Audacity 1.3.4].

  Back to top


1.1  Load a Sound File


If you have a mono or stereo sound file available you can load it into Audacity via:

   Audacity File menu > Import > Audio   or   Shift + Control + I

If you have no sound files available you can build your own mono or stereo tracks via the Audacity 'Generate' menu.

  Back to top


1.2  Create a Mono Track


1. Go to the Audacity 'Generate' menu and choose 'Tone'. Leave everything as-is, just click 'OK', a mono track will appear in the Audacity window.

 [mono track]

  Back to top


1.3  Create a Stereo Track


1. Mark the whole mono track from above either by pressing 'Ctrl+A' on the keyboard, or by clicking with the mouse into the track header, with taking care not to move the buttons or sliders, the whole track then will appear in a different color.

2. Go to the 'Edit' menu and choose 'Duplicate'. A second, identical mono track will appear below the first one.

 [two mono tracks]

3. In the upper mono track, open the track menu by clicking on the small black triangle at the top of the track header and coose 'Make stereo track'. Both mono tracks then will get combined to a single stereo track.

 [stereo track]

  Back to top


2  The Nyquist Prompt


To enable the Audacity 'Effect' menu at least a part of an Audacity audio track must be marked or selected. Then go to the Audacity 'Effect' menu and choose 'Nyquist prompt'. A window like the following will appear:

 [nyquist prompt]

  Back to top


2.1  The Nyquist Interpreter


In the 'Nyquist Prompt' window, type into the text field a string "hello" with quotes:

 [nyquist prompt with quoted text]

If you click 'OK', you should get a window displaying 'hello':

 [hello window]

Click 'OK' in the 'hello' window to make it disappear again.

Congratulations, you just have learned how to send text messages to the user.

  Back to top


2.2  The Nyquist Debugger


After clicking 'OK' in the 'hello' window, go back to the Audacity 'Effect' menu and choose 'Nyquist prompt' again, but this time type hello without the quotes:

 [nyquist prompt with unquoted text]

Important: Now click 'Debug' instead of 'OK'.

You should first get a window displaying a 'Nyquist did not return audio' or similar message:

 [no audio message]

After clicking 'OK' in the window above, a second window appears, displaying the detailed Nyquist error messages:

 [unbound variable error]

Important: The 'Nyquist output' window only appears if you click 'Debug' in the 'Nyquist Prompt' window. If you click 'OK', then, even with a Nyquist error, only the first window will appear.

  Back to top


Steven Jones / Pedro Morales / David R. Sky / Nyquist and Emacs / Audacity Wiki


Audacity Support Forum / Audacity and Nyquist / Nyquist Reference Manual / Nyquist Examples and Tutorials