Cabbage Logo
Back to Cabbage Site

Trying to make scanu and scans work out...HELP!

bounds(0, 0, 0, 0)
form caption(“EvolvingPad”) size(600, 300), guiMode(“queue”), pluginId(“def1”)
keyboard bounds(0, 196, 600, 102)

groupbox bounds(22, 10, 343, 175), channel(“matrixmodifier”) text(“Matrix Modifiers”)
rslider bounds(50, 40, 61, 52) channel(“mtxRate”) range(0.001, 0.9, 0.1, 0.5, 0.001) text(“Rate”)
rslider bounds(126, 40, 58, 52) channel(“mtxMass”) range(1, 3, 1, 0.5, 0.001) text(“Mass”)
rslider bounds(202, 40, 55, 52) channel(“mtxStif”) range(0.01, .2, .01, 0.5, 0.001) text(“Stiff”)
rslider bounds(280, 40, 55, 52) channel(“mtxCentr”) range(0.01, 1, .1, 0.5, 0.001) text(“Center”)
rslider bounds(82, 112, 55, 52) channel(“mtxDampen”) range(-1, 0, -0.1, 2, 0.001) text(“Dampen”)
rslider bounds(160, 112, 55, 52) channel(“mtxPos”) range(0, 1, 0.5, 1, 0.001) text(“Position”)
rslider bounds(242, 112, 55, 52) channel(“mtxDisplace”) range(-1, 1, 0, 1, 0.001) text(“Displace”)

hslider bounds(372, 120, 219, 52) channel(“mix”) range(0, 1, 1, 1, 0.001) text(“Mix”)

groupbox bounds(370, 10, 222, 102), channel(“image”) text(“Amp Envelope”)
rslider bounds(372, 38, 55, 49) channel(“attack”) range(0, 1, 0, 1, 0.001) text(“Attack”)
rslider bounds(426, 38, 55, 49) channel(“decay”) range(0, 1, 0, 1, 0.001) text(“Decay”)
rslider bounds(480, 38, 55, 49) channel(“sustain”) range(0, 1, 0, 1, 0.001) text(“Sustain”)
rslider bounds(534, 38, 55, 49) channel(“release”) range(0, 1, 0, 1, 0.001) text(“Release”)

-n --displays -+rtmidi=NULL -M0 --midi-key-cps=4 --midi-velocity-amp=5 sr = 44100 ksmps = 128 nchnls = 2 0dbfs = 1

garvbL init 0
garvbR init 0

; Initial condition
gi1 ftgen 1, 0, 128, -7, 0, 64, 1, 64, 0

; Masses
gi2 ftgen 2, 0, 128, -7, 1, 128, .1

; Stiffness matricies
SMatrix = “./MTX copy/cylinder-128,8”
gi3 ftgen 3, 0, 16384, -23, SMatrix

; Centering force
gi4 ftgen 4, 0, 128, -7, .001, 128, .1

; Damping
gi5 ftgen 5, 0, 128, -7, .1, 128, .1, 128, .1
;gi5 ftgen 5, 0, 128, -7, .1, 64, 1, 64, .1

; Initial velocity
gi6 ftgen 6, 0, 128, -7, .01, 128, .001

; Trajectories
gi7 ftgen 7, 0, 128, -5, .001, 64, 127, 64, .001

instr 1

iamp ampmidi .5
icps cpsmidi

//scan instrument parameters
irate chnget “mtxRate”
kmass chnget “mtxMass”
kstif chnget “mtxStif”
kcentr chnget “mtxCentr”
kdamp chnget “mtxDampen”
kpos chnget “mtxPos”
kdisplace chnget “mtxDisplace”

kmix chnget “mix”

a0 = 0

;icndfnc,scnrat,ivelf,imasf,ispgmatrxf,icntrf,idampf,kmas,kspgstf,kcntr,kdamp,ilplkpos,irplkpos,kpos,kstrngth,ain,disp,id
scanu gi1, irate, gi6, gi2, gi3, gi4, gi5, kmass, kstif, kcentr, kdamp, .1, .5, kpos, kdisplace, a0, 1, 2

asig scans iamp, icps, gi7, 2

kgate madsr .01, .1, .8, .1

asig dcblock2 asig
asig lowpass2 asig, 100+icps, 1
asig clip asig, 0, .5

;amp envelope
iampAtk chnget “Attack”
iampDec chnget “Decay”
iampSus chnget “Sustain”
iampRel chnget “Release”

kgate mxadsr iampAtk, iampDec, iampSus, iampRel

aL = asigkgate
aR = asig
kgate

outs aL, aR
aLFO oscil .1, random:k(10, 100)
asig3 oscil iamp, icps

display aL, .01, 3
dispfft aL, .1, 1024
display asig3, .01, 3

vincr garvbL, aL
vincr garvbR, aR

endin

alwayson 99
instr 99

denorm(garvbL,garvbR)
arvbL, arvbR reverbsc garvbL, garvbR, 0.5, 12000, sr, 1 

kRMSL rms arvbL
kRMSR rms arvbR

cabbageSetValue "vu1", portk(kRMSL*10, .25)
cabbageSetValue "vu2", portk(kRMSR*10, .25)

outs arvbL, arvbR
clear garvbL, garvbR

endin

f0 z

Hi, I am Dr.B’s student taking Csound class for this fall semester at Berklee. I am trying to finish my synthesizer project but it’s making no sound. I need to finish this and use it in my music by tomorrow…
Please anyone take a quick look and give me advice on what to fix to make the sound work?

Haven’t tried the code but offhand:
aL = asigkgate
aR = asigkgate
looks like one issue. It should produce an error reported by the console.

You can multiply (modulate) the audio by the envelope:
aL = asig * kgate
aR = asig * kgate

it doesn’t show up on this post, but I did added * (multiplying) between asig and kgate…

rtevent: T 9.932 TT 9.932 M: 0.00000 0.00000
rtevent: T 10.977 TT 10.977 M: 0.00000 0.00000
midiKeyCps: pfield: 4 value: 932
midiVelocityAmp: pfield: 5 value: 0.947
rtevent: T 12.463 TT 12.463 M: 0.00000 0.00000

When I play the MIDI note on the keyboard,
there is no M value showing up… What could be the possible issue here?

It would seem that you are muting the output something. I don’t have time this moment to check the code, but maybe try adding a simple oscil into that instrument to see if it outputs Ok. If it does then you know there is something in your instrument code that is off.