Home -> Magazines -> Issues -> Articles in this issue -> View
Keeping Us Posted... | |
Article from Electronic Soundmaker & Computer Music, April 1984 |
BBC envelopes
Gary Herman with more facts on the BBC's versatile ENVELOPE command
The last six parameters of the ENVELOPE command determine the amplitude envelope of a given sound. The amplitude envelope is related to the pitch envelope only by the parameter T, as we shall see. The amplitude envelope assumes a familiar ADSR form, in which a sound is analysed as rising to a peak volume (attack — A), falling to a plateau (decay — D), holding at that level (sustain — S) and dying away (release — R) (Fig 1). Few natural sounds are actually that simple to analyse, but the ADSR convention works well enough for synthesis that isn't too fussy. The ENVELOPE command gives very flexible control of the ADSR functions. Parameter 13 (attack target level — AT) sets the level at the end of the attack phase. This is the peak volume of the sound. Parameter 14 sets the level at the end of the decay phase — the plateau or sustain volume, DT. Parameters 9, 10, 11 and 12 set the change of amplitude per step in each of the ADSR phases — AS, DS, SS and RS. Unlike the pitch envelope section, the amplitude envelope section of the command gives no explicit indication of the number of steps. The amplitude envelope is, however, divided into discrete steps like the pitch envelope. It works like this:
The attack target level divided by the attack step parameter gives the number of steps in the attack phase. Despite the fact that there are 127 possible values for the attack target level, there are actually only 16 volume levels available from the hardware. Each volume level is actually a band of eight equal volume settings. The main consequence of this is that transitions during a rise or fall are not as smooth as they could be.
The attack phase lasts for (AS/AT)*T hundredths of a second (where T is less than 128). Similarly, the decay time is the number of steps in the decay phase multiplied by step length, which can be calculated by subtracting the plateau level from the attack target level, dividing by the decay step parameter and multiplying the result by T: (AT-DT)*T/DS. Since the total duration of the note is given by the SOUND command's fourth parameter (DUR), the length of the sustain phase is given by subtracting the lengths of the attack and decay phases combined from DUR. A sound is released only if there is no other sound waiting to be played on the same channel. The release phase extends the sound beyond the time given by DUR and its length can be calculated by dividing the plateau level by the release step parameter and multiplying the result by the step length — (DT/RS)*T. Clearly, if DUR — which gives the overall duration of the sound — is less than the combined lengths of the attack, decay and sustain phases, the sound will be cut short before the phases are completed.
Thus:
100 ENVELOPES 1, 100, 0, 0, 0, 0, 0, 0, 1, 1, 0, -127, 126, 0
200 SOUND 1, 1, 53, -1
gives an attack time of 126 seconds and an equal decay time. The sustain level is zero and since duration in line 200 is -1 the note continues indefinitely. Press ESCAPE to stop it. Change the 100 in line 100 to 20 and you get a note 49 seconds long. With this parameter, T, set at 1, the audible part of the note lasts 2.5 seconds.
100 ENVELOPE 1, 20, 0, 0, 0, 0, 0, 0, 12, -12, 0, - 127, 108, 0
200 SOUND 1, 1, 53, 100
gives a total duration of five seconds (from line 200) and attack and decay times of 1.8 seconds each. So, the sustain time at zero volume is now 1.4 seconds.
Change the sound duration parameter in line 200 to 50 and the note is cut short during the decay phase about 1.1 seconds before its amplitude reaches zero. To hear the note release from this level, change the release step parameter from —127 to —1. The note now dies away to zero.
Now make the attack sharper by changing the attack step parameter in line 100 from 12 to 36. This gives an attack duration of (108/36)*(20/100), or 0.6 seconds. Decay stays at 1.8 seconds. The note then continues for 2.5 — (0.6+1.8), or 0.1 seconds but it has already reached zero amplitude so there is no release. Change the duration parameter in line 200 from 50 to 40 (two seconds) and the note will be cut off before the decay phase ends and you will hear it die away.
If the step length parameter, T, in line 100 is changed from 20 to 5, attack time will be 0.15 seconds and decay time 0.45 seconds and there will be no audible sustain or release. But if the last parameter in line 100 (the decay target level) is given a positive value (say, 48), you will be able to hear the sustain and the release. The decay phase is, of course, shorter — lasting only 0.25 seconds. Since the attack phase still lasts 0.15 seconds, the note will sustain for 1.6 seconds. The release takes about two more seconds.
Now make T equal to one and decay step equal to -1. Attack time is 0.03 seconds and decay time 1.08 seconds. There will be a 0.89 second sustain and a quick release (0.48 seconds). So far, we have not mixed pitch and amplitude envelopes — but let's try it:
100 ENVELOPE 1, 1, -1, 36, 0, 108, 3, 0, 36, -1,0, -1, 126, 48
200 SOUND 1, 1,53, 40
imposes a pitch envelope on the last-produced sound. The pitch envelope lasts for (108 + 3)*1/100, or 1.11 seconds — which is equal to the length of the attack-decay phase of the amplitude envelope. Pitch falls by 108 quarter semitones in the first phase, rises by 36*3, or 108 quarter semitones in the second phase and stays where it is in the third phase. After that, the pitch envelope repeats until the note is over. Change the step parameter in line 100 from one to 128 and the pitch envelope does not repeat. Now swap pitch parameters around:
100 ENVELOPE 1, 128, 36, -1, 0, 3, 108, 0, 36, -1, 0, -1, 126, 48
or
100 ENVELOPE 1, 128, -1, 0, 36, 108, 0, 3, 36, -1, 0, -1, 126, 48
and you should hear how the pitch changes occur differently at different points in the note. More musical effects can be obtained by levelling out the pitch changes:
100 ENVELOPE 1, 128, -1, 1, -1, 28, 56, 28, 36, -1, 0, -1, 126, 48
gives a pitch envelope that lasts 1.12 seconds with an attack-decay phase of 1.11 seconds. Changing the ...28, 56, 28... to... 10, 20, 10... and ...1, 2, 1... gives quite pleasing effects, substantially altered if the step length parameter is changed to one and the pitch envelope repeats. Finally, it is possible to place pitch changes anywhere in the note — as in:
100 ENVELOPE 1, 128, 0, 1, -1, 80, 20, 20, 36, -1, 0, -1, 108, 48
which gives a 'bend' to the note after 0.8 seconds lasting 0.4 seconds. The bend therefore straddles the decay and sustain phases of the note, rather like the effect of using a tremolo arm on a guitar.
Amiga Notes |
PC Notes |
Mac Notes |
The Musical Micro |
Computer Music Hardware Buyers' Guide |
Technically Speaking |
The New Macs |
Software Support - Hints, Tips & News From The World Of Music Software |
The Celtic Macintosh - AN ALBUM PRODUCED ENTIRELY ON A PERSONAL COMPUTER (Part 1) |
Apple Notes |
The Musical Micro - Additions To Traditions |
Apple Notes |
Browse by Topic:
BBC Micro
(ES Feb 84)
BBC Reverb
(ES Feb 84)
BeeBMIDI (Part 1)
(EMM Jun 84)
BeeBMIDI (Part 2)
(EMM Jul 84)
BeeBMIDI (Part 3)
(EMM Aug 84)
BeeBMIDI (Part 4)
(EMM Nov 84)
BeeBMIDI (Part 5)
(EMM Dec 84)
BeeBMIDI (Part 6)
(EMM Jan 85)
BeeBMIDI (Part 7)
(EMM Mar 85)
BeeBMIDI Monitor (Part 1)
(EMM Oct 85)
BeeBMIDI Monitor (Part 2)
(EMM Nov 85)
Bopping With The BBC
(ES Aug 84)
Soft Music
(ES Mar 84)
Technically Speaking
(MM Apr 87)
When Is A Computer? (Part 7)
(12T May 84)
Browse category: Computer > Acorn
ATPL Symphony Keyboard - Add-on for BBC Micro
(EMM Mar 85)
Hybrid Technology Music 2000 System
(SOS Oct 88)
Hybrid Technology Music 4000
(MT Jul 87)
Soft Centres - MUSIC MATE/ATPL
(ES Jun 85)
Browse category: Keyboard - Peripheral > ATPL
Browse category: Keyboard - Peripheral > Hybrid Technology
Feature by Gary Herman
mu:zines is the result of thousands of hours of effort, and will require many thousands more going forward to reach our goals of getting all this content online.
If you value this resource, you can support this project - it really helps!
New issues that have been donated or scanned for us this month.
All donations and support are gratefully appreciated - thank you.
Do you have any of these magazine issues?
If so, and you can donate, lend or scan them to help complete our archive, please get in touch via the Contribute page - thanks!