Well, the entire code is about 3000 lines, but I think you’ll get the giste in this shortened example.
The problem remains the same.
<Cabbage>
form caption(“JEIZZMEISTER”) size(1280, 820), guiMode(“queue”), pluginID(“jm12”), colour(127,127,127)
button bounds(560, 634, 58, 11), channel(“string1fret1”), text(“string1fret1-0”, “string1fret1-1”), latched(0)
image bounds(0, 500, 1042, 14) channel(“normalStringPickFretBoardE”), file(“string highlight green.png”), visible(0)
; Select audio/midi flags here according to platform
; Audio out Audio in No messages
-odac -iadc -d ;;;RT audio I/O
sr=44100
kr=441
ksmps=100
nchnls=2
opcode setStringFBBody, 0, kkk
kS, kSTrig, kTrigS xin
kCount init 0
while kS > 0 || kSTrig > 0 do
kCount += .001
od
kTrig metro 27.5
cabbageSet kTrigS, “normalStringPickFretBoardE”, sprintfk(“visible(”%.02f")", 1)
cabbageSet kTrig, “normalStringPickFretBoardE”, “alpha”, exp(-kCount)
cabbageSet kTrig, “normalStringPickFretBoardE”, “alpha”, exp(-kCount)
endop
instr 1
kS1F1 cabbageGetValue “string1fret1”
idur = 1
kS1 = kS1F1
kTrigS1 changed kS1F1
kSTrig1 trigger kS1, 1, 1
kSTrig1 trighold kSTrig1, idur
kSTrig12 trigger kSTrig1, 1, 1
if kS1 > 0 || kSTrig1 > 0 then
setStringFBBody kS1, kSTrig1, kTrigS1
endif
if kS1 == 0 then
cabbageSet kSTrig12, “normalStringPickFretBoardE”, sprintfk(“visible(”%.02f")", 0)
endif
endin
f0 z
i1 0 z
[aaaa.csd|attachment](upload://kg3TzhN8YjwQQQmzjUP6PcyGPvM.csd) (1.5 KB) ![string highlight green|690x388](upload://9HvS4zogzngH9MnRshDicNJIjPl.png)