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

320 to continue. If a note were gently dying away then it might be abruptly terminated when its time was up. Setting H=1 allows the note to continue instead of playing a new note. If H=1 then the note defined by the rest of the SOUND statement is ignored. The second number (S) is used to synchronise the playing of a number of notes. If S=0 then the notes are played as soon as the last note on the selected channel has completed. (There is a slight simplification here; ‘completed’ means ‘has reached the start of the release phase’.) The user is referred to the keyword ENVELOPE for relevant detail.

A non-zero value of S indicates to the computer that this note is not to be played until you have a corresponding note on another channel ready to be played. A value of S=1 implies that there is one other note in the group. S=2 implies two other notes (ie a total of three). If a note was sent to channel 1 with S set to 1 then it would not be played until a note was ready on another channel which also had S set to 1. For example: 110 SOUND &101,-15,50,200 110 SOUND 2,-15,200,100 120 SOUND &102,-15,100,200 When this program is run the note at line 100 will not play until channel 2 is free. Line 110 sounds a note immediately on channel 2 – and for five seconds (duration 100).

When the note has completed then both the notes from lines 100 and 120 will sound together. The third number (F) can have the value 0 or 1. If it is set to 1 then the SOUND statement in which it occurs flushes (throws away) any other notes waiting in the queue for a particular channel. It also stops whatever note is being generated on that channel at present. The SOUND statement in which F=1 then plays its note. Setting F behaves like an ‘over-ride’. For example:

20 SOUND 2,-15,200,100 25 FOR X=1 TO 500:NEXT X 30 SOUND &12,-15,100,200 In the above situation line 20 will start a sound on channel 2 but this will be stopped almost immediately by line 30 which will generate a lower and longer note on channel 2. Line 25 just gives a short delay. Setting F=1 provides an easy way of stopping an everlasting note! Thus SOUND&13,0,0,1 stops the current note on channel 3 and instead plays one at zero loudness and of minimum length. This will stop channel 3 immediately. The last number (C) is the channel number described earlier.