Cabbage Logo
Back to Cabbage Site

Cabbage2 beta : Reset value of slider (resolved)

Hello Rori,

I think the function for saving values into preset in cabbage 2 beta is interfering with widget identchannel…

I attach a patch which works properly with cabbage 1 but not with cabbage 2.
One button and a slider.
When the button is clicked, the slider is reset to 0.

In cabbage 1, it works properly but in cabbage 2 beta, the value goes briefly to zero and moves back to the value which was previously set.

Here is the 2 lines patch.Cs_testResetSlider.csd (813 Bytes)
Hope this helps.

Thanks. I’ll take a look when I get a chance.

I just took a look now at this. The thing is that widgets that transmit values over channels can have their values set over the same channels. So you never need to use value(0), instead you can just do something like this:

instr 1
	kTrigreset changed chnget:k("buttonchan")
	if kTrigreset==1 then 
		chnset k(0),"vslider"
	endif
endin   

Another thing to note is that you cannot update a slider’s range once it has been declared. This is down to the fact that VST hosts need to know the range of the parameters when plugins first load. Changing them after they have been opened will result in unexpected behaviour in the host.

p.s. I can see that settings a widgets value with a string might seem like an intuitive solution. I wonder if I should add support for it…it might be simple, on the other hand, it may not!