Difference between revisions of "Nyquist Basics: The Audacity Nyquist Prompt"

From Audacity Wiki
Jump to: navigation, search
m (minor corrections)
(added some formatting)
Line 15: Line 15:
 
If you have a mono or stereo sound file available you can load it into Audacity via:
 
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'''
+
{{Menu|File > Import > Audio}} or the shortcut {{Shortcut|CTRL + SHIFT + I}}
  
 
If you have no sound files available you can build your own mono or stereo tracks via the Audacity "Generate" menu.
 
If you have no sound files available you can build your own mono or stereo tracks via the Audacity "Generate" menu.
Line 21: Line 21:
 
===Create a Mono Track===
 
===Create a Mono Track===
  
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:
+
Click {{Menu|Generate > Tone}}. Leave everything as-is, just click "OK", a mono track will appear in the Audacity window:
  
 
[[Image:Nyquist-prompt-mono-track.png]]
 
[[Image:Nyquist-prompt-mono-track.png]]
Line 27: Line 27:
 
===Create a Stereo Track===
 
===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.
+
'''1.''' Select the whole mono track either by pressing {{Shortcut|CTRL + A}} on the keyboard, or by clicking with the mouse on the Track Panel (take care not to move the buttons or sliders). The audio waveform will then have a shaded colour.
  
'''2.''' Go to the Audacity "Edit" menu and choose "Duplicate". A second, identical mono track will appear below the first one:
+
'''2.''' Click {{Menu|Edit > Duplicate}}. A second, identical mono track will appear below the first one:
  
 
[[Image:Nyquist-prompt-two-mono-tracks.png]]
 
[[Image:Nyquist-prompt-two-mono-tracks.png]]
  
'''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:
+
'''3.''' In the upper mono track, open the track menu by clicking on the small black triangle at the top of the Track Panel choose '''Make stereo track'''. Both mono tracks then will be combined into the left and right channel of a single stereo track:
  
 
[[Image:Nyquist-prompt-stereo-track.png]]
 
[[Image:Nyquist-prompt-stereo-track.png]]
Line 39: Line 39:
 
==The Nyquist Prompt==
 
==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:
+
Click {{Menu|Effect > Nyquist Prompt}}. If the Effect Menu is greyed out because no part of the audio is selected,  press {{Shortcut|CTRL + A}} on the keyboard. A window like the following will appear:
  
 
[[Image:Nyquist-prompt-001.png]]
 
[[Image:Nyquist-prompt-001.png]]
Line 59: Line 59:
 
===The Nyquist Debugger===
 
===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 the word hello without the quotes:
+
After clicking "OK" in the "hello" window, go back to the Audacity '''Effect''' menu and choose '''Nyquist prompt''' again, but this time type the word hello without the quotes:
  
 
[[Image:Nyquist-prompt-004.png]]
 
[[Image:Nyquist-prompt-004.png]]
Line 73: Line 73:
 
[[Image:Nyquist-prompt-006.png]]
 
[[Image:Nyquist-prompt-006.png]]
  
'''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.
+
 
 +
{{Hint|'''NOTE:''' 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.}}

Revision as of 09:25, 11 February 2008

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.
 
Related article(s):


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.

Load a Sound File

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

File > Import > Audio or the shortcut CTRL + SHIFT + I

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

Create a Mono Track

Click Generate > Tone. Leave everything as-is, just click "OK", a mono track will appear in the Audacity window:

Nyquist-prompt-mono-track.png

Create a Stereo Track

1. Select the whole mono track either by pressing CTRL + A on the keyboard, or by clicking with the mouse on the Track Panel (take care not to move the buttons or sliders). The audio waveform will then have a shaded colour.

2. Click Edit > Duplicate. A second, identical mono track will appear below the first one:

File:Nyquist-prompt-two-mono-tracks.png

3. In the upper mono track, open the track menu by clicking on the small black triangle at the top of the Track Panel choose Make stereo track. Both mono tracks then will be combined into the left and right channel of a single stereo track:

Nyquist-prompt-stereo-track.png

The Nyquist Prompt

Click Effect > Nyquist Prompt. If the Effect Menu is greyed out because no part of the audio is selected, press CTRL + A on the keyboard. A window like the following will appear:

Nyquist-prompt-001.png

The Nyquist Interpreter

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

Nyquist-prompt-002.png

If you click "OK", you should get a window displaying the word hello:

Nyquist-prompt-003.png

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

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

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 the word hello without the quotes:

Nyquist-prompt-004.png

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

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

Nyquist-prompt-005.png

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

Nyquist-prompt-006.png


NOTE: 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.