The third number gives the pitch of the note, and can have any value from 0 to

255. Low values produce deep notes; high values, high notes. The pitch value

has a different effect if channel number 0, the noise channel, is used. In this

case the range for the third parameter is only 0 to 7, producing various pitches

of noise.

The last parameter shows the duration of the sound in twentieths of a second,

and can have any value from 0 to 255. In the example, this value is 20, so the

note sounds for one second (20 twentieths of a second). A value of 255 produces

a continuous sound that stops only if you press ESCAPE.

To play a simple tune you need only sound several notes in succession:

10SOUND 1-15,97,10

20SOUND 1,-15,105,10

30SOUND 1,-15,89,10

40SOUND 1,-15,41,10

50SOUND 1,-15,69,20

Notes can be sounded simultaneously on another channel if you add:

15S0UND 2,-15,97,10

25SOUND 2,-15,105,10

35S0UND 2,-15,89,10

45S0UND 2,-15,41,10

55SOUND 2,-15,69,20

Sounds with a loudness parameter of l to 16 are controlled by the envelope with

the corresponding number. The envelope can affect both the pitch and

amplitude of a note. For example:

SOUND 1 ,-1 5 ,255 ,255 RETURN

plays a continuous loud note. Change the second parameter to 1 and the note

comes under the control of envelope 1. The ENVELOPE command requires 14

parameters:

ENVELOPE 1,1,-26,-36,-45,255,255,255,127,0,0,-127,126,0 RETURN

The number immediately after ENVELOPE is the envelope number, which can

vary from 1 to 16. The remaining parameters control and vary the pitch and

amplitude of the note. Try the same note as before, but under the control of

envelope 1:

SOUND 1,1,255 255 RETURN

The SOUND and ENVELOPE commands are extremely versatile and together

enable the computer to function as a music-maker superior to much more costly

synthesisers -- both commands are discussed in detail in the Reference Manual.

C 65