| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
; Select audio/midi flags here according to platform |
| 4 |
-odac ;;;RT audio out |
| 5 |
;-iadc ;;;uncomment -iadc for RT audio input is needed too |
| 6 |
; For Non-realtime ouput leave only the line below: |
| 7 |
; -o scanmap.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 |
instr scannode |
| 17 |
|
| 18 |
a0 init 0 |
| 19 |
irate = .001 |
| 20 |
; scanu2 init, irate, ifndisplace, ifnmass, ifnmatrix, ifncentr, ifndamp, kmass, |
| 21 |
; kmtrxstiff, kcentr, kdamp, ileft, iright, kpos, kdisplace, ain, idisp, id |
| 22 |
scanu2 1, irate, 6, 2, 3, p5, 5, 2, 9, .01, .01, .1, .9, 0, 0, a0, 0, 2 |
| 23 |
kpos,kvel scanmap 2, 100,1, p4 ; amplify the kpos value 100 times |
| 24 |
display kpos, .25 ; display is updated every .25 of a second |
| 25 |
asig poscil .5+kvel, 150+kpos ; use moving velocity and position of the node |
| 26 |
outs asig, asig |
| 27 |
endin |
| 28 |
|
| 29 |
</CsInstruments> |
| 30 |
<CsScore> |
| 31 |
f1 0 128 10 1 ; Initial displacement condition: sine |
| 32 |
f2 0 128 -7 1 128 1 ; Masses |
| 33 |
f3 0 16384 -23 "string-128.matrxB" ; Spring matrices |
| 34 |
|
| 35 |
;------------------------------------- |
| 36 |
; 2 different Centering forces |
| 37 |
f44 0 128 -7 1 128 1 ; uniform initial centering |
| 38 |
f4 0 128 -7 .001 128 1 ; ramped centering |
| 39 |
;------------------------------------- |
| 40 |
f5 0 128 -7 1 128 1 ; uniform damping |
| 41 |
f6 0 128 -7 .01 128 .01 ; uniform initial velocity |
| 42 |
f7 0 128 -5 .001 128 128 ; Trajectory |
| 43 |
|
| 44 |
s; node |
| 45 |
i"scannode" 0 10 0 4 ; uniform initial centering ramped centering |
| 46 |
i"scannode" 11 10 64 4 ; reading 3 nodes |
| 47 |
i"scannode" 22 10 127 4 ; 0 - 64 - 127 |
| 48 |
s; node |
| 49 |
i"scannode" 0 10 0 44 ; uniform initial centering |
| 50 |
i"scannode" 11 10 64 44 ; reading 3 nodes |
| 51 |
i"scannode" 22 10 127 44 ; 0 - 64 - 127 |
| 52 |
|
| 53 |
e |
| 54 |
</CsScore> |
| 55 |
</CsoundSynthesizer> |