Nyquist Basics: Changing the Volume in SAL

Changing the Volume of an Audacity Track in SAL
To change the volume of an Audacity track with Nyquist, the easiest way is to use the Nyquist "scale" function:

scale(number, sound)

The "scale" function multiplies the amplitude [volume] of the "sound" by the given "number". A number of 0.5 will make the sound become only half as loud as before, while a number of 2 will make the sound become double as loud as before.

Example:

1. First either load a sound file into Audacity or create an audio track, e.g. with "Tone" from the Audacity "Generate" menu.

2. Now click. A window with a text field will appear where you can type in:

return scale(0.5, s)

After clicking "OK" in the "Nyquist Prompt" window the "scale" function will take the Audacity sound and return a "scaled-down" sound with half the volume to Audacity. The result of the last computation of the Nyquist code always gets automatically returned to Audacity.

If you try "scale" with big numbers you will notice that you can return sounds with volumes taller than the Audacity track which will sound very distorted if you play them afterwards in Audacity. So an important lesson to learn is that Nyquist gives you the freedom to do whatever you want but it's now on you to take care that the result will still sound good afterwards.