Open tjingboem opened 1 week ago
Re 10. Add Note to scanu and scanu2: Note: Both scanu and scanu2 are capable of reading the binary (.matrxB) and text (.matrxT) matrix format. However, using scanu2 is to be prefferred because of its accuracy and better sound quality.
NiceDr. Richard BoulangerProfessorElectronic Production and DesignBerklee College of MusicOn Sep 13, 2024, at 10:44 AM, Menno Knevel @.***> wrote: Re 10. Add Note to scanu and scanu2: Note: Both scanu and scanu2 are capable of reading the binary (.matrxB) and text (.matrxT) matrix format. However, using scanu2 is to be prefferred because of its accuracy and better sound quality.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>
example for scansmap:
<CsoundSynthesizer>
<CsInstruments>
sr=44100
ksmps=32
nchnls=2
0dbfs = 1
; by Menno Knevel - 2024
; listen carefully: changes are subtle as only one node of the 128 is replaced each time!
instr 1 ;replace 2 nodes- first 5 then 89
a0 init 0
irate = .002 ; rather fast scanning rate
; scanu2 init, irate, ifndisplace, ifnmass, ifnmatrix, ifncentr, ifndamp, kmass,
scanu2 1, irate, 6, 2, 3, 4, 5, 2,\
9, .01, .01, .1, .9, 0, 0, a0, 0, 1
; kmtrxstiff, kcentr, kdamp, ileft, iright, kpos, kdisplace, ain, idisp, id
kpos,kvel scanmap 1, 1, 1, p4 ; just read what is going on with node
scansmap p5, p6, 1, 1, 1, p4 ; set new parameters for this node
prints "\nnode %d: set position to %0.1f, set velocity to %0.1f \n", p4, p5, p6
printks " present amplitude = %f, position = %f\n", .2, kvel, kpos
a1 scans ampdb(87), cpspch(7.00), 7, 1
a1 butlp a1, 1500 ; low pass filter
asig dcblock a1
outs asig*.00002, asig*.00002
endin
</CsInstruments>
<CsScore>
f1 0 128 -7 0 28 0 2 1 2 0 96 0 ; a pluck that is 10 points wide on the surface
f2 0 128 -7 1 128 1 ; Masses
f3 0 16384 -23 "string-128.matrxB" ; Spring matrix
f4 0 128 -7 1 128 1 ; uniform initial centering
f5 0 128 -7 1 128 1 ; uniform damping
f6 0 128 -7 .01 128 .01 ; uniform initial velocity
f7 0 128 -7 1 128 128 ; trajectory
i1 0.0 5 5 0 0
i1 5.0 5 89 0 0
i1 11.0 5 5 0 1
i1 16.0 5 89 0 1
i1 22.0 5 5 1 0
i1 27.0 5 89 1 0
i1 33.0 5 5 1 1
i1 38.0 5 89 1 1
e
</CsScore>
</CsoundSynthesizer>
<CsoundSynthesizer>
<CsInstruments>
sr=48000
ksmps=128
nchnls=2
0dbfs=1
instr 1 ;Scanned Synthesis
initial ftgenonce 1, 0, 128, 10, 1, .3, .5, 1 ; initial position = sine wave
idispl ftgenonce 2, 0, 128, -7, .01, 128, .04 ; displace
imass ftgenonce 3, 0, 128, -7, .5, 128, 5 ; masses
icent ftgenonce 4, 0, 128, -7, .01, 128, .01 ; centering
idamp ftgenonce 5, 0, 128, -7, -.1, 128, -.1 ; damping
itraj ftgenonce 6, 0, 128, -7, 0, 128, 128 ; trajectory
a0 = 0
kline line .01, p3, 0 ; envelope
;scanu2 init, irate, ifndisplace, ifnmass, imatrix, ifncentr, ifndamp, kmass, kmtrxstiff, kcentr, kdamp, ileft, iright, kpos, kdisplace, ain, idisp, id
scanu2 1, .002, 2, 3, 100, 4, 5, 10, 6, 0.1, .9, .5, .1, 0, 0, a0, 0, -2
;ares foscili xamp, kcps, xcar, xmod,kndx [, ifn, iphs]
a1 foscil p5*kline, p4, 1.141, .01, 1, 2
a1 dcblock a1
outs a1, a1
endin
</CsInstruments>
<CsScore>
f100 0 0 -44 "/media/datae/CsoundManual7/Menno_changes/matrices/string_128.matrxT" ; text matrix
i1 0.0 12 100 0.7
e
</CsScore>
</CsoundSynthesizer>
possible example for scanu
<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
; Audio out Audio in No messages
-odac ;;;RT audio I/O
; For Non-realtime ouput leave only the line below:
; -o scanu.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1
instr 1
a0 = 0 ; no external input
; scanu init, irate, ifnvel, ifnmass, ifnstif, ifncentr, ifndamp, kmass, kstif, kcentr, kdamp, ileft, iright, kpos, kstrngth, ain, idisp, id
scanu 1, p6, 6, 2, 3, 4, 5, 2, .1, .1, -.02, .1, .5, 0, 0, a0, 0, 2
;ar scans kamp, kfreq, ifntraj, id
a1 scans ampdb(p4), cpspch(p5), 7, 2
a1 *= 0.00006 ; lower amplitude due to 0dbfs = 1
a1 dcblock2 a1 ; remove DC offset
outs a1, a1
endin
</CsInstruments>
<CsScore>
f1 0 128 7 0 64 1 64 0 ; Initial condition
f2 0 128 -7 1 64 .45 64 1 ; Masses
f3 0 16384 -23 "string-128.matrix" ; Spring matrices
f4 0 128 -7 0 64 1 64 0 ; Centering force
f5 0 128 -7 0 64 1 64 0 ; Damping
f6 0 128 -7 0 128 0 ; Initial velocity
f7 0 128 -7 0 64 127 64 0 ; Trajectories
i1 0 8 86 6.00 0.001 ; fast updates of the mass state
i1 8 10 86 6.00 0.005 ; slower updating...
i1 18 120 86 6.00 0.1 ; ..and updating much slower still
e
</CsScore>
</CsoundSynthesizer>
a negative value for the initial condition (meaning the hammer shape) caused the surface to be plucked from the center and to ignore upPluck and downPluck
Also, were you aware that: the two pluck locations (the parms prior to kPos and kStrenghth) are for an upPluckPosition and a downPluckPosition (and that they only work if the init (surface initial condition - (or 'hammer') is a negative number
And, you might agree with me that the idea of a 'hammer' doesn't really make sense if your have a matrix that creates a three dimensional surface? I am not sure, but I think that there might be a better metaphor - (like a mold) because it is actually an initial surface contour prior to excitation
Note also - that ifnstif - is not a stiffness function at all - it is the connection matrix - there is a kstif parameter, which adjusts the stiffness of the springs from a controller or over time - to me these are 'push' variables - where you are pushing on the evolving surface - here and there or inflating or deflating the masses, or...
<CsoundSynthesizer>
<CsInstruments>
sr=48000
ksmps=128
nchnls=2
0dbfs=1
instr 1 ;Scanned Synthesis
initial ftgenonce 1, 0, 128, 10, 1 ; initial position = sine wave
idispl ftgenonce 2, 0, 128, -7, .01, 128, .01 ; displace
imass ftgenonce 3, 0, 128, -7, 5, 128, 5 ; masses
icent ftgenonce 4, 0, 128, -7, .01, 128, .1 ; centering
idamp ftgenonce 5, 0, 128, -7, -.1, 128, -.21 ; damping
itraj ftgenonce 6, 0, 128, -7, 0, 128, 128 ; trajectory
i_ ftgen 20, 0, 16384, 7, 0, 4096, 1, 4096, 0.3333, 8192, 0 ; window
a0 = 0
kline line .05, p3, 0 ; envelope
kgdur port 1000, 0.1, 20
kgdur = kgdur / p4
;scanu2 init, irate, ifndisplace, ifnmass, imatrix, ifncentr, ifndamp, kmass, kmtrxstiff, kcentr, kdamp, ileft, iright, kpos, kdisplace, ain, idisp, id
scanu2 1, .0005, 2, 3, 100, 4, 5, 20, 30, 0.1, .9, .5, .1, 0, 0, a0, 0, -2
a1 grain2 p4, p4, kgdur, 25, 2, 20
a2 grain2 p4, p4, kgdur, 25, 2, 20
a1 dcblock a1 * kline
a2 dcblock a2 * kline
outs a1, a2
endin
</CsInstruments>
<CsScore>
f100 0 0 -44 "/media/datae/CsoundManual7/Menno_changes/matrices/string_128.matrxT" ; text matrix
i1 0.0 20 466 0.7
e
</CsScore>
</CsoundSynthesizer>
Sounding result: Scanned_grain.wav.zip
Now that both matrix systems for binary and text are transparent and clear, re-examine all Scanned Synthesis examples. And give them clear basic examples.
per opcode:
in general:
spiral-8,16,128,2,1over2.traj
(=spiral01_max128_129.traj
). Both Trajectories are to added to the examples folder. The straight line tableitraj ftgen 6, 0, 128, -7, 0, 128, 127
can also presented asitraj ftgen 6, 0, -23, "spiral01_max128_129.traj"