I'm happy to report that this Csound patch is working beautifully -- no dropouts or anything whatsoever!
It must have been that in my prior version, I was using wgpluck
instead of pluck
as an opcode...I think that one just might be janky. Also, I am matching buffersize between Bela and Csound (and always have been).
<CsoundSynthesizer>
<CsOptions>
-m0d -Mhw:0,0 -+rtmidi=null
</CsOptions>
<CsInstruments>
ksmps = 4
nchnls = 2
0dbfs = 1
alwayson "reverberator"
gabus init 0
;; Neidhardt 3 well-temperament
gitemp ftgen 1, 0, 64, -2, 12, 2, 261.659, 60, \
1.000000, \
1.057073, \
1.119929, \
1.187864, \
1.255659, \
1.333333, \
1.411023, \
1.496616, \
1.583819, \
1.676104, \
1.779786, \
1.883489, \
2.000000
instr 1
icps cpstmid 1
iamp ampmidi 1
ifn = 0
imeth = 2
iparam1 = 6
iparam2 = 0
; envelope
iatt = 0.01
;idel = 6
idec = 6 + (13 / (log2(icps) - 5))
irel = 0.3
; keyboard track the filter
itrack = log2(icps - 6) * 0.25
icutoff = (1000 * itrack) + 200
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; actual sounding stuff, a 'pluck' tone generator ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
asig pluck 1, icps, icps, ifn, imeth, iparam1, iparam2
kenv expsegr 0.001, iatt, iamp, idec, 0.001, irel, 0.001
kenv = kenv - 0.001
aflt tone asig, kenv * icutoff
gabus += aflt * kenv
endin
instr reverberator
; reverb params
irevsize = 0.61
irevfc = 4000
iwet = 0.5
iwidth = 0.7777
; --- use `hilbert` to create stereo width ---
asigin = gabus
areal, aimag hilbert asigin
adiff = areal - aimag
adiff_inv = -1 * adiff
aL = asigin + (adiff * iwidth)
aR = asigin + (adiff_inv * iwidth)
; --- Sean Costello's reverb ---
arevL, arevR reverbsc aL, aR, irevsize, irevfc
; send it all out
outs aL * (1 - iwet) + arevL * iwet, \
aR * (1 - iwet) + arevR * iwet
; clear the bus
gabus = 0
endin
</CsInstruments>
<CsScore>
e
</CsScore>
</CsoundSynthesizer>