Skip to content

Commit 2e67919

Browse files
committed
document scan(s)map
1 parent 952d511 commit 2e67919

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

examples/scanmap.csd

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<CsoundSynthesizer>
2+
3+
<CsOptions>
4+
5+
</CsOptions>
6+
7+
<CsInstruments>
8+
9+
sr = 48000
10+
ksmps = 32
11+
nchnls = 1
12+
13+
instr scan
14+
a0 init 0
15+
16+
irate = .01
17+
18+
kpos line 0, p3, 128
19+
;kpos randh abs(128), 3
20+
21+
; scanu init, irate, ifndisplace, ifnmass, ifnmatrix, ifncentr, ifndamp, kmass,
22+
; kmtrxstiff, kcentr, kdamp, ileft, iright, kpos, kdisplace, ain, idisp, id
23+
scanu2 1, irate, 6, 2, 3, 4, 5, 2, 9, .01, .01, .1, .9, 0, 0, a0, 0, 2
24+
25+
;ar scans kamp, kfreq, ifntraj, id
26+
k1,k2 scanmap 2, 1000, 1000, 64
27+
display k1, .25 ; note - display is updated every second
28+
a1 scans ampdb(p4), cpspch(p5), 7, 2
29+
out a1
30+
endin
31+
32+
</CsInstruments>
33+
<CsScore>
34+
; Initial displacement condition
35+
;f1 0 128 -7 0 64 1 64 0 ; ramp
36+
f1 0 128 10 1 ; sine hammer
37+
;f1 0 128 -7 0 28 0 2 1 2 0 96 0 ; a pluck that is 10 points wide on the surface
38+
39+
; Masses
40+
f2 0 128 -7 1 128 1
41+
42+
; Spring matrices
43+
f3 0 16384 -23 "string-128.matrxB"
44+
45+
; Centering force
46+
f4 0 128 -7 1 128 1 ; uniform initial centering
47+
;f4 0 128 -7 .001 128 1 ; ramped centering
48+
49+
; Damping
50+
f5 0 128 -7 1 128 1 ; uniform damping
51+
;f5 0 128 -7 .1 128 1 ; ramped damping
52+
53+
; Initial velocity - (displacement, vel, and acceleration
54+
; Acceleration is from stiffness matrix pos effect - increases acceleration
55+
;
56+
57+
f6 0 128 -7 .01 128 .01 ; uniform initial velocity
58+
59+
; Trajectories
60+
f7 0 128 -5 .001 128 128
61+
62+
i"scan" 2 12 86 7.00
63+
i"scan" 14 2 86 5.00
64+
i"scan" 16 2 86 6.00
65+
i"scan" 18 2 86 8.00
66+
i"scan" 20 2 98 10.00
67+
68+
e
69+
70+
</CsScore>
71+
</CsoundSynthesizer>

0 commit comments

Comments
 (0)