158 The pitch envelope The pitch of the note can be changed in three sections. For each section you can specify the change in pitch at each tick of the clock (step) in the section. Suppose we wish to generate a wailing sound like a police siren. The pitch has to rise and fall like this: During section 1 the pitch changes +2 units per step and section 1 contains 10 steps. In section 2 the pitch changes -2 units per step and there are 20 steps. Section 3 contains 10 steps of +2 units. So thus far the ENVELOPE command looks like The next six numbers control the amplitude of the sound and might well be 1,0,0,-1,100,100 (these will be explained in a moment).
ENVELOPE 2,1,2,-2,2,10,20,10 So the total program to show the pitch envelope working would be 10 ENVELOPE 2,1,2,-2,2,10,20,10,1,0,0,-1,100,100 20 SOUND 1,2,100,100 Here is another pitch envelope – it plays three notes in succession. 10 ENVELOPE 3,25,16,12,8,1,1,1,10,-10,0,-10,100,50 It reads: – Envelope number 3. – Each step is 25/100 ie 1/4 second long. – The first section of the pitch envelope uses a pitch change of 16 units. – The second section uses a pitch change of 12 units. – The third section has a pitch change of 8 units. – All three sections have only 1 step in each section. – Now to explain the amplitude envelope.