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

161 As you may have guessed there are many ways for things to go wrong so that a phase does not complete as expected. For example with ALA set to 100 and ALD set to 50 and a decay rate (AD) of zero the amplitude will not decay at all during the decay phase. However the sound will be moved to the release phase when the duration is reached. The ENVELOPE statement is very complicated and there is a wide range of possible effects. You will have to use it a lot before you can accurately predict what effect you will produce. Some sample envelopes to try out:

ENVELOPE 1,1,0,0,0,0,0,0,2,0,-10,-5,120,0 ENVELOPE 2,3,0,0,0,0,0,0,121,-10,-5,-2,120,120 ENVELOPE 3,7,2,1,1,1,1,1,121,-10,-5,-2,120,120 ENVELOPE 4,1,0,0,0,0,0,0,61,0,-10,-120,120,0 ENVELOPE 1,8,1,-1,1,1,1,1,121,-10,-5,-2,120,1 Note synchronisation and other effects The first parameter of the SOUND statement has been considered, up to now, to control only the channel number. It can in fact control a number of other features. For this purpose the channel number should be considered as a four digit hexadecimal number C=&HSFN Parameter Range Function N 0 to 3 Channel number itself F 0 or 1 Flush control S 0 to 3 Synchronisation control H 0 or 1 Continuation control N selects the channel number.

F If F is 0 the sound will be placed in a channel queue if a note is playing on that channel. If F = 1 then the channel queue will be flushed (emptied) so that the sound can be generated immediately. S It is possible to synchronise two or more channels so that they do not start until all have received a note marked for synchronous production. The value of S determines how many other channels are to form the chord. Thus for a three note chord all three channels should be fed a note with S set to 2. H This parameter allows the previous effect on the channel to continue if it is set to 1. In this case the amplitude, pitch and duration parameters of the new sound command have no effect.

Because the ‘dummy’ note thus created is added to the queue in the normal way it can be used to ensure that the release