Debian Codegraph @

examples/scanu2-3.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 ;-iadc ;;;uncomment -iadc if realtime audio input is needed too
6 ; For Non-realtime ouput leave only the line below:
7 ; -o scanu2-3.wav -W ;;; for file output any platform
8 </CsOptions>
9 <CsInstruments>
10
11 sr = 44100
12 ksmps = 32
13 nchnls = 2
14 0dbfs = 1
15
16 ; by Richard Boulanger 2024
17
18 instr scan ; show the pluck options
19
20 a0 init 0
21 irate = .04
22
23 kmass line 2,p3,1
24 kstiff line 10,p3,10
25 kcenter line 5,p3,6
26 kdamp line 1,p3,2
27 kpos line .4,p3,.5
28
29 ;scanu2 init,irate,ifndisplace,ifnmass,ifnmatrix,ifncentr,ifndamp,kmass,kmtrxstiff,
30 ; kcentr, kdamp, ileft, iright, kpos, kdisplace, ain, idisp, id
31 scanu2 p6, irate, 6, 2, 3, 4, 5, kmass, kstiff, kcenter, kdamp, p7, p8, kpos, .02, a0, 1, 2
32 a1 scans ampdbfs(p4), cpspch(p5), 7, 2
33 a1 dcblock2 a1
34 outs a1, a1
35 endin
36
37 </CsInstruments>
38 <CsScore>
39 f1 0 16 10 1 ; Sine Hammer
40 f11 0 16 10 1 .5 .3 .2 .1 .01 ; Sawlike hammer
41 f111 0 16 10 1 0 .73 0 .53 0 .45 0 .17 0 .02 0 .002 ; Pulselike hammer
42 f2 0 16 -7 8 16 8 ; Masses
43 f3 0 0 -44 "/manual/examples/string_with_extras-16.matrxT" ; Spring matrix, to be found in the examples folder of the manual
44 f4 0 16 -7 .07 16 .07 ; Centering force, uniform initial centering
45 f5 0 16 -7 .04 16 .04 ; Damping, uniform damping
46 f6 0 16 -7 .01 16 .01 ; uniform initial velocity-displacement
47 f7 0 16 -5 15 16 1 ; Trajectory
48
49
50 i"scan" 0 3 6 7.00 -1 .5 .5 ; pluck in middle
51 s
52 i"scan" 0 3 2 7.00 -1 .1 .1 ; pluck at left
53 s
54 i"scan" 0 3 0 7.00 -1 .2 -.8 ; 2 plucks up left and down right
55 s
56 i"scan" 0 3 -6 7.00 1 .2 .8 ; sine hammer - ignore pluck position
57 s
58 i"scan" 0 3 -6 7.00 11 .8 .2 ; sawlike hammer - ignore pluck position
59 s
60 i"scan" 0 3 -6 7.00 111 .1 .6 ; pulselike hammer - ignore pluck position
61 e
62 </CsScore>
63 </CsoundSynthesizer>