Hi Rory,
FYI I added a label that is updated everytime the values of a hrange change.
Here is how I do it (I only left the code to update the label, I removed the gentables and the dsp stuff):
<Cabbage>
;----------
; container
;----------
form caption("Bug") pluginId("AS14") size(840, 500), guiMode("queue"), colour(200,200,200)
label bounds(35, 288, 178, 22) channel("leftEqValue") text("[eq mode deactivated]") ,fontSize(24), fontColour(0, 0, 0, 255)
hrange bounds(34, 268, 176, 27), channel("FreqMinAttack", "FreqMaxAttack"), _info("Frequency range of the attack transient shaping (uses a bell curve)"), range(1, 25000, 1:400, 0.3, 1) valueTextBox(0) trackerBackgroundColour(0,0,0,0) trackerBackgroundColour(0,0,0,0) colour(20,20,20,0) outlineColour(100,100,100) trackerThickness(2) outlineColour(100,100,100) trackerThickness(2)
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 -m0d --displays
</CsOptions>
<CsInstruments>
ksmps = 64
nchnls = 2
0dbfs = 1
instr 1
; --- values
kFreqMinAttack, kMinEqAttackTrigger cabbageGetValue "FreqMinAttack"
kFreqMaxAttack, kMaxEqAttackTrigger cabbageGetValue "FreqMaxAttack"
StxtEqAttack sprintfk "[%d Hz - %d Hz]", kFreqMinAttack, kFreqMaxAttack
; test 1
cabbageSet max(kFreqMinAttack, kFreqMaxAttack), "leftEqValue", "text", StxtEqAttack
endin
</CsInstruments>
<CsScore>
i 1 0 [60 * 60 * 24 * 7]
f1 0 256 7 0 256 0
</CsScore>
</CsoundSynthesizer>
This code works well, but not in the context of my plugin. When I comment the gentable declaration in my plugin code, it works well, but when I add the gentable back, it crashes after a few seconds when I play with the hrange. I suspect it’s a performance issue… Even when I update the hrange with metro(20) or metro(10), it crashes, but a bit later.
Do you know what could happen? My plugin probable requires too much CPU, and that might cause the issue, but let’s add a gentable to the example above and see what it does:
;----------
; container
;----------
form caption(“Bug”) pluginId(“AS14”) size(840, 500), guiMode(“queue”), colour(200,200,200)
label bounds(35, 288, 178, 22) channel(“leftEqValue”) text("[eq mode deactivated]") ,fontSize(24), fontColour(0, 0, 0, 255)
hrange bounds(34, 268, 176, 27), channel(“FreqMinAttack”, “FreqMaxAttack”), _info(“Frequency range of the attack transient shaping (uses a bell curve)”), range(1, 25000, 1:400, 0.3, 1) valueTextBox(0) trackerBackgroundColour(0,0,0,0) trackerBackgroundColour(0,0,0,0) colour(20,20,20,0) outlineColour(100,100,100) trackerThickness(2) outlineColour(100,100,100) trackerThickness(2)
gentable bounds(266, 160, 300, 71), tableNumber(1), fill(0), channel(“table1”), tableGridColour(152, 0, 0, 0) tableBackgroundColour(15, 15, 15, 0) tableColour:0(255, 255, 255, 255)
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 -m0d --displays
</CsOptions>
<CsInstruments>
ksmps = 64
nchnls = 2
0dbfs = 1
opcode ScrollTable, 0, aikiS
setksmps 1
aSig, iTable, kRate, iScrollPoint, SChannel xin
kSig = aSig
kCnt = 0
kIndex linseg 0, 3.7, ftlen(iTable), 0, ftlen(iTable)
if metro(kRate) == 1 then
tabw kSig, kIndex, 1
if kIndex == ftlen(iTable) then
while kCnt<ftlen(iTable) do
kSample tab kCnt+1, 1
tabw kSample, kCnt, 1
kCnt+=1
od
endif
endif
endop
instr drawGentable
cabbageSet "table1", "tableNumber", 1
endin
instr 1
; --- values
kFreqMinAttack, kMinEqAttackTrigger cabbageGetValue "FreqMinAttack"
kFreqMaxAttack, kMaxEqAttackTrigger cabbageGetValue "FreqMaxAttack"
StxtEqAttack sprintfk "[%d Hz - %d Hz]", kFreqMinAttack, kFreqMaxAttack
; test 1
cabbageSet max(kFreqMinAttack, kFreqMaxAttack), "leftEqValue", "text", StxtEqAttack
if metro(1) == 1 then
event "i", "drawGentable" , 0, 0.0008
endif
endin
</CsInstruments>
<CsScore>
i 1 0 [60 * 60 * 24 * 7]
f1 0 256 7 0 256 0
</CsScore>
</CsoundSynthesizer>
Of course it doesn’t display anything but the goal is to test this empty skeleton. I played with it 20 secs and can reproduce this bug (in my plugin is takes like 3 seconds though…)
See the video below, crash occuring at 8 sec, the mouse pointer should be the wheel spinning but the screen recorder didnt capture that:
Do you know what could be the cause and how I could investigate? There are no logs so it’s hard to spot the issue.
Thank you