Output of a data series as sound
The function \(Sound\) outputs the data series of a list as sound on both speakers. The parameter expected is a list whose data is output on both loudspeakers. The sound can be output once or endlessly.
The sound is output at a sampling frequency of 48000. This means that 48000 elements in the first parameter will output a tone of 1 second. The following statement generates a single 133.33 Hz tone.
\(\displaystyle Sound(Sin([1..360]* 127))\)
The statement contains 360 elements and \(48000/360\) returns 133.33.
To generate a sustained 1000 Hz tone write
\(\displaystyle Sound(Sin([7.5..360:7.5]* 127),loop)\)
A single vibration here consists of 48 elements, which corresponds to 1/1000 second.
The first argument \ (tone \) is the data series to be output as audio signal. The range of the amplitude is -127 to +127.
If the optional parameter \(Loop\) is set, the sound will be looped repeatedly until the Halt button in the Action menu is clicked.
With the optional third parameter \ (Level \) the volume can be reduced. A value from 0 to 1 is valid. The default Level = 1, which corresponds to the maximum volume.
Sound (Ton, Loop)
Sound (Ton, Loop, Level)
Output of a single sine wave
Endless output of a sine wave
Endless output of a sine wave at half volume
Single output of a vibration at half volume