Acorn Computers BBC Micro Model B w/8271 — Acorn BBC Micro Model B w/8271 User Guide Manual PDF

317 SOUND Purpose This statement is used to make the computer generate sounds using the internal loudspeaker. The sound generator is capable of making four sounds at once. Each of the four sound channels can generate one note. The keyword SOUND must be followed by four numbers which specify: – Which sound channel is to be used. – The loudness of the note (or the envelope number). – The pitch of the note. – How long the note is to last. For example SOUND 1,-15,52,20 will play a note on sound channel 1, with a loudness of -15 (maximum volume). A pitch value of 52 gives middle C and a duration of 20 will make the note last for 1 second. SOUND C,A,P,D The channel number (C) can be 0, 1, 2 or 3.

Channel 0 is a special channel that can produce various noises, whereas channels 1, 2 and 3 are used to produce single notes. Other values of C produce special effects which are explained further on. The amplitude or loudness (A) can have any whole number value between -15 and 4. Values -15 to 0 produce notes of fixed loudness throughout the whole note. A value of -15 is the loudest, -7 is half volume and 0 produces silence. Values of 1 to 4 enable the amplitude to be controlled while the note is playing. When you play a note on the piano the sound gradually fades away.

Effects like this are selected by using one of the four user defined envelopes which are selected by setting A to be 1, 2, 3 or 4. Envelopes are explained in chapter 30 and under the keyword ENVELOPE . The pitch (P) is used to set the pitch or frequency of the note. The pitch can have any value between 0 and 255. The note A above middle C is selected with a value of 88. The table in chapter 30 shows the value of P needed to produce a particular note. You will see that to go up an octave P is increased by 48 and to go up a perfect 5th P must be increased by 28. Increasing the value of P by one will increase the note produced by a quarter of a semi-tone.