Hello,
So I’m making a custom vertical slider, and I’m having a little problem with initializing the y-position of the visualizer. When you press the slider, it jumps up, but I’m trying to make it initialize to the same value as it jumps up to.
Does anyone have a tip to solve this?
<Cabbage>
form caption("Untitled") size(400, 300), guiMode("queue") pluginId("def1")
vslider bounds(90, 125, 30, 50) channel("PitchVolume") range(0, 1, 0, 1, 0.01) trackerColour(255, 255, 255, 0) fontColour(123, 40, 40, 0) textColour(160, 160, 160, 0) colour(255, 255, 255, 0), trackerBackgroundColour(27, 32, 38, 255)
image bounds(95, 162, 6, 30), channel("PitchVolume2") mouseInteraction(0), corners(4), colour(127, 255, 127, 255)
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 -m0d
</CsOptions>
<CsInstruments>
; Initialize the global variables.
ksmps = 32
nchnls = 2
0dbfs = 1
instr 1
kPitchVol cabbageGetValue "PitchVolume"
iBoundsPitch1[] cabbageGet "PitchVolume2", "bounds"
cabbageSet changed2(kPitchVol), "PitchVolume2", "bounds", iBoundsPitch1[0], iBoundsPitch1[1]-kPitchVol*30, 6, (iBoundsPitch1[3] - 30) + (kPitchVol*30)
endin
</CsInstruments>
<CsScore>
;causes Csound to run for about 7000 years...
f0 z
;starts instrument 1 and runs it for a week
i1 0 [60*60*24*7]
</CsScore>
</CsoundSynthesizer>