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

218 In the above example T = one hundredth of a second. PI1 = +10 PN1 = 12 PI2 = -5 PN2 = 27 PI3 = +50 PN3 = 3 The pitch envelope is added to the pitch parameter (P) given in the SOUND statement. In the above example it must have been 40 since the pitch starts at 40. If bit 7 of the T parameter is zero then at the end of the pitch envelope, at a time given by the equation time = (PN1 + PN2 + PN3)*T hundredths of a second the pitch envelope will be set to zero and will repeat automatically. Note that the pitch can only take on values in the range 0 to 255 and values outside this range are treated as MOD 256 of the value calculated.

The six parameters AA, AD, AS, AR, ALA and ALD determine the amplitude envelope. Although the current internal sound generator has only 16 amplitude levels the software is upward compatible with a generator having 128 levels. The shape of the amplitude envelope is defined in terms of rates (increments) between levels, and is an extended form of the standard ADSR system of envelope control. The envelope starts at zero and then climbs at a rate set by AA (the attack rate) until it reaches the level set by ALA. It then climbs or falls at the rate set by AD (the decay rate) until it reaches the level set by ALD.

However, if AD is zero the amplitude will stay at the level set by ALA for the duration (D) of the sound. The envelope then enters the sustain phase which lasts for the remaining duration (D) of the sound. The duration is set by the SOUND statement. During the sustain phase the amplitude will remain the same or fall at a rate set by AS.