157 ENVELOPE N, T, PI1, P12, PI3, PN1, PN2, PN3, AA, AD ,AS, AR, ALA, ALD A brief description of each parameter follows.
Parameter Range Function N 1 to 4 Envelope number T bits 0-6 0 to 127 Length of each step in hundredths of a second 0=auto-repeat pitch envelope bit 7 0 or 1 1=don’t auto-repeat pitch envelope PI1 -128 to 127 Change of pitch per step in section 1 PI2 -128 to 127 Change of pitch per step in section 2 PI3 -128 to 127 Change of pitch per step in section 3 PN1 0 to 255 Number of steps in section 1 PN2 0 to 255 Number of steps in section 2 PN3 0 to 255 Number of step in section 3 AA -127 to 127 Change of amplitude per step during attack phase AD -127 to 127 Change of amplitude per step during decay phase AS -127 to 0 Change of amplitude per step during sustain phase AR -127 to 0 Change of ampliude per step during release phase ALA 0 to 126 Target level at end of attack phase ALD 0 to 126 Target level at end of decay phase Note that the pitch can take on a value between 0 and 255.
If the pitch is greater than 255 (eg 257) then 256 will be repeatedly subtracted from it until it is in range. The amplitude has a range of 0 to 127 in the ENVELOPE statement whereas it had a range of 0 to -15 in the SOUND statement. The amplitude cannot be set outside the range 0 to 127. Note also that the total duration of the attack, decay and sustain periods (but not the release period) is determined by the SOUND statement and not the ENVELOPE statement. The envelope is divided up into a number of steps – usually a hundredth of a second each and both the pitch and amplitude can be changed at the end of each step.