3
3
; Select audio/midi flags here according to platform
5
-odac -iadc ;;;RT audio I/O
5
;-iadc ;;;uncomment -iadc if RT audio input is needed too
6
6
; For Non-realtime ouput leave only the line below:
7
7
; -o cos.wav -W ;;; for file output any platform
11
; Initialize the global variables.
17
icos1 = cos(0) ;cosine of 0 is 1
18
icos2 = cos($M_PI_2) ;cosine of pi/2 (1.5707...) is 0
19
icos3 = cos($M_PI) ;cosine of pi (3.1415...) is -1
20
icos4 = cos($M_PI_2 * 3) ;cosine of 3/2pi (4.7123...) is 0
21
icos5 = cos($M_PI * 2) ;cosine of 2pi (6.2831...) is 1
22
icos6 = cos($M_PI * 4) ;cosine of 4pi is also 1 as it is periodically to 2pi
23
print icos1, icos2, icos3, icos4, icos5, icos6
26
instr 2 ;cos used in panning, after an example from Hans Mikelson
27
aout vco2 0.8, 220 ; sawtooth
28
kpan linseg p4, p3, p5 ;0 = left, 1 = right
29
kpan = kpan*$M_PI_2 ;range 0-1 becomes 0-pi/2
32
outs aout*kpanl, aout*kpanr
29
; Play Instrument #1 for one second.
38
i 2 0 5 0 1 ;move left to right
39
i 2 6 5 1 0 ;move right to left
b'\\ No newline at end of file'