Debian Codegraph @

examples/scans-2.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 ; Select audio/midi flags here according to platform
4 -odac --limiter=0.95 ;;;realtime audio out & and limit loud sounds
5 ; For Non-realtime ouput leave only the line below:
6 ; -o scans-2.wav -W ;;; for file output any platform
7 </CsOptions>
8 <CsInstruments>
9
10 ; example by Menno Knevel 2024
11
12 sr=44100
13 ksmps=32
14 nchnls=2
15 0dbfs=1
16
17 instr 1
18 initial ftgenonce 1, 0, 128, 10, 1 ; initial position = sine wave
19 idispl ftgenonce 2, 0, 128, -7, .01, 128, .04 ; displace
20 imass ftgenonce 3, 0, 128, -7, 5, 128, 15 ; masses
21 icent ftgenonce 4, 0, 128, -7, 2.01, 128, .09 ; centering
22 idamp ftgenonce 5, 0, 128, -7, -.1, 128, -.01 ; damping
23 itraj1 ftgenonce 6, 0, 128, -7, 0, 128, 128 ; trajectory 1
24 itraj2 ftgenonce 66, 0, 128, -23, "/manual/examples/straightline_max128_128.traj" ; trajectory 2
25 itraj3 ftgenonce 666, 0, 128, -23, "/manual/examples/128-spiral-8,16,128,2,1over2.traj" ; trajectory 3
26
27 a0 = 0 ; no audio
28 kline line .7, p3, 0 ; simple envelope
29
30 itrajectory = p6
31 if (p6 == 6) then
32 prints "\nlinear trajectory, reading through all of the masses\n"
33 elseif (p6 == 66) then
34 prints "\nthe same linear trajectory but written as an ASCII file\n"
35 else
36 prints "\na spiral trajectory - see images below\n"
37 endif
38
39 ;scanu2 init, irate, ifndisplace, ifnmass, imatrix, ifncentr, ifndamp, kmass, kmtrxstiff, kcentr, kdamp, ileft, iright, kpos, kdisplace, ain, idisp, id
40 scanu2 1, .02, 2, 3, 100, 4, 5, 10, 0.6, 0.1, .9, .5, .1, 0, 0, a0, 0, 20
41 asigL scans kline, p4, itrajectory, 20
42 asigR scans kline, p4*1.01, itrajectory, 20 ; stereo
43 asigL dcblock asigL
44 asigR dcblock asigR
45 outs asigL, asigR
46 endin
47
48 </CsInstruments>
49 <CsScore>
50 f100 0 0 -44 "/manual/examples/string_128.matrxT" ; text matrix
51
52 i1 0.0 4 130.8127825 1.0 6
53 i1 5.0 4 109.99999987361387 1.0 66
54 i1 10.0 5 146.8323837899985 1.0 666
55 e
56 </CsScore>
57 </CsoundSynthesizer>