SOUND

Function

SOUND generates a note of a specified frequency and length.

Syntax

SOUND pitch,duration.

Example

SOUND 121,530

This will produce a middle ‘C note for one second.

The following program will play a short tune:

10 FOR 1=1 TO 20
20 SOUND 52, 1233/I
30 SOUND 46, 1394/I
40 SOUND 59,1086/I
50 SOUND 121,530/I
60 SOUND 80,1202/I
70 FOR J=I TO 16
80 NEXT J
90 NEXT I
99 END

Remark

Pitch and duration must be in the range 1 - 65,534.

A higher value for pitch will produce a lower note.

A higher value for duration will Increase the length of the note.

The formula, 64130/pitch, can be used to find the required ’duration’ parameter to play a note of a specified pitch for one second.

See Four Octave Sound Range for parameters to generate specific notes of required frequency.