Debian Codegraph @

examples/xyscale.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 ; Select audio/midi flags here according to platform
4 -odac ;;;RT audio out
5 ;-iadc ;;;uncomment -iadc if RT audio input is needed too
6 ; For Non-realtime ouput leave only the line below:
7 ; -o xyscale.wav -W ;;; for file output any platform
8
9 ; By Stefano Cucchi 2020
10
11 </CsOptions>
12 <CsInstruments>
13
14 sr = 44100
15 ksmps = 32
16 nchnls = 2
17 0dbfs = 1
18
19 instr 1
20 ; In the instr 1 using f1 and f2 you reach the 4 corners (values)
21 k00 = p4
22 k10 = p5
23 k01 = p6
24 k11 = p7
25
26 kx oscil 1, p8, p9
27 ky oscil 1, p10, p11
28
29 kout1 xyscale kx, ky, k00, k10, k01, k11
30 kout2 xyscale kx, ky, k00*3/2, k10*4/3, k01*5/4, k11*6/5
31
32 a1 buzz 0.2, kout1, 8, 3
33 a2 buzz 0.2, kout2, 4, 3
34
35 outs a1, a2
36
37 endin
38
39 instr 2
40 ; In the instr 2 setting the first value to 0 or 1 (p8 & p9) you can start from the corner (value) you want
41
42 k00 = p4
43 k10 = p5
44 k01 = p6
45 k11 = p7
46
47 kx randomh 0, 1, 2, 2, p8 ; p8 is the X starting value
48 ky randomh 0, 1, 2, 2, p9 ; p9 is the Y starting value
49
50 kout1 xyscale kx, ky, k00, k10, k01, k11
51 kout2 xyscale kx, ky, k00*3/2, k10*4/3, k01*5/4, k11*6/5
52
53 a1 buzz 0.2, kout1, 8, 3
54 a2 buzz 0.2, kout2, 4, 3
55
56 outs a1, a2
57
58 endin
59
60
61 </CsInstruments>
62 <CsScore>
63
64
65 f1 0 1024 -7 0 400 0 100 1 400 1 124 0
66 f2 0 1024 -7 0 200 0 100 1 400 1 100 0 224 1
67 f3 0 1024 10 1
68
69 i1 0 10 300 400 500 600 0.3 1 0.2 2
70 i2 10 10 300 410 520 630 0 0
71
72 e
73
74
75 </CsScore>
76 </CsoundSynthesizer>