Debian Codegraph @

examples/matrices_compare.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 -o dac
4 </CsOptions>
5 <CsInstruments>
6
7 sr = 44100
8 ksmps = 32
9 nchnls = 2
10 0dbfs = 1
11
12 instr 1
13
14 initial ftgen 1, 0, 128, 10, 1 ; initial position = sine wave
15 idispl ftgen 2, 0, 128, -7, .01, 128, .01 ; displace
16 imass ftgen 3, 0, 128, -7, 5, 128, 5 ; masses
17 icent ftgen 4, 0, 128, -7, 1, 128, 1 ; centering
18 idamp ftgen 5, 0, 128, -7, -.1, 128, -.1 ; damping
19 itraj ftgen 6, 0, 128, -7, 0, 128, 127 ; trajectory
20
21 a0 init 0
22 irate = .01
23
24 ;scanu2 init, irate, ifndisplace, ifnmass, imatrix, ifncentr, ifndamp, kmass, kmtrxstiff, kcentr, kdamp, ileft, iright, kpos, kdisplace, ain, idisp, id
25 scanu2 1, irate, 2, 3, p4, 4, 5, 20, 9, 0.1, .9, .5, .1, 0, 0, a0, 0, 2
26 ;ar scans kamp, kfreq, ifntraj, id
27 a1 scans 1, 200, 6, 2
28
29 if p4 == 50 then
30 prints "\n using binary matrix system\n", p4
31 else
32 prints "\n and now the text matrix system\n", p4
33 endif
34
35 outs a1, a1
36 endin
37
38 </CsInstruments>
39 <CsScore>
40 ; both matrices are to be found in the examples folder of the manual
41 f50 0 16384 -23 "string-128.matrxB" ; binary matrix
42 f100 0 128 -44 "string-128.matrxT" ; text matrix
43
44 i1 0 10 50
45 i1 12 10 100
46 e
47 </CsScore>
48 </CsoundSynthesizer>