f 1 0 8192 10 1 ;Draws a sine wave
f 2 0 1024 7 0 128 1 128 .6 512 .6 256 0 ;Draws a series of line segments
f 3 0 1025 5 .001 256 1 256 .5 256 .5 256 1 ;Draws a series of exponential curves
f 4 0 1024 7 0 128 1 128 .6 512 .6 256 0 ;Another series of line segments
;Here we have two GEN subroutines which we have not looked at before, Gen 7 and Gen 5. These
;two subroutines draw lines and curves between specified points. Gen 7 draws linear segments,
;and Gen 5 draws exponential segments. These can be drawn upon by signal-generating opcodes
;in their function-call parameters. Here I have used them to describe amplitude envelopes.
;Again, the synatx of the f-statement is this:
;
;f (unique number) (loadtime) (tablesize) (GEN subroutine) (parameter1) (parameter2) (parameter3)....
;
;The parameters for the GEN 5 and 7 opcodes are identical. Starting with the first parameter,
;every other parameter is an ordinate value, which are given in the order of -1 to +1. These
;values correspond proportionally to the maximum amplitude present in their application. The
;values in between the ordinates are segment-length values which reference the table-size. The
;table-size (and therefore the segment lengths) correspond proportionally with the time in
;seconds over which this waveform completes one complete cycle. So, in:
;
;f 2 0 1024 7 0 128 1 128 .6 512 .6 256 0
;
;there are a total of 1024 possible spaces in which to define the line segments. If our time in
;seconds were 10, distance in seconds and f-statement distances would correspond on a 1024/10
;ratio. One second would be described by 102.4 data-points. Amplitude/ordinate spaces are treated
;in the same proportional manner, save that instead of between user-defined value and tablesize,
;the ratio is -1/-value up to +1/positive value. An amplitude request of 10000 would be represented
;by a 1. A value of .7 would be heard as an amplitude of 7000.
;instrument 1 uses the linen opcode to apply a linear envelope the amplitude of the oscillator
;p1 p2 p3 p4 p5 p6 p7 p8
;instr# start dur amp cps ifn attack decay
i 1 0 5 10000 440 1 .5 1
i 1 5 5 10000 440 1 0 4
i 1 10 5 10000 440 1 4 0
;instrument 2 uses an oscillator to control the pitch of another oscillator to provide vibrato
;instr start dur amp cps ifn att dec vbr vbd ifn1
i 2 15 5 10000 200 1 .5 .5 3 3 1
i 2 20 5 10000 200 1 .5 .5 6 6 1
i 2 25 5 10000 200 1 .5 .5 12 12 1
i 2 30 10 10000 400 1 .5 .5 .3 10 1
;instrument 3 uses envlpx to apply an exponental envelope to the amplitude of the oscillator,
;and also uses expseg to modify the pitch over time, exponentially
;instr start dur amp cps ifn att dec ifn1 iats iatd
i 3 40 20 10000 440 1 10 5 3 .7 .01
;instrument 4 has a retriggering, lfo-based vibrato and the number of present harmonics is being altered
;from one value to the next exponentially using the expon opcode. Also, there is lfo vibrato.
;instr start dur amp cps ifn att dec ihrm1 ihrm2 ivbr ivbd itrg ifne
i 4 60 30 10000 440 1 3 3 2 15 2 2 1 4
i 4 90 30 10000 440 1 3 3 15 2 4 4 15 4
i 4 120 30 10000 440 1 3 3 1 60 .1 30 30 4