Cabbage Logo
Back to Cabbage Site

Switching images with slider

test.zip (218.6 KB)

I uploaded last version.First i added 18 images as you can see.It’s working great in Cabbage but no luck in DAW.

I’ll try this out a little later. In not at my PC right now.

Thanks.Waiting for your response.

Btw, are you sure you’re ending audio to the plugin in the DAW?

Didn’t understand.What do you men?

When DAW playbacks,slider moving but images not.

What OS are you on? it could be that the images are not found. You’ll need to include them in the bundle. Put them into the same folder as the actual plugin binary. Btw, using several images is Ok if you don’t have loads of images. But if you do, it’s easier to just update the file that a single image is showing. Something like this:

<Cabbage>
form caption("Untitled") size(400, 300), colour(58, 110, 182), pluginID("def1")
image bounds(12, 12, 80, 80),file("knob.png"),identchannel("imageIdent1"),visible(1)
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 -m0d 
</CsOptions>
<CsInstruments>
; Initialize the global variables. 
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1


instr 1
;a1 inch 1
;a2 inch 2
a1 random 0, 1

k1 downsamp a1
chnset k1, "gain"

if metro(10) == 1 then
	SMessage sprintfk "file(\"knob%d.png\")", int(k1*30)
	chnset SMessage, "imageIdent1"
endif

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> 

I use a metro to trigger the updating of the images. Otherwise it will update many thousands times a second. Right now it updates 10 times a second which seems reasonable and pretty smooth.

Wow! Your this code is really great!Thanks!

I’m using Windows and Mac but main system is Mac.For now working on mac.

I have issue about your last code.It’s working as meter but first image can’t load.Only seeing white box.Other images great.

Oh yeah, you need to rename the first image to knob0.png, that should do the trick.

Just tried this trick but no luck.Actuall it’s not about first and last png file.It’s doing this when moving.

Cabbage must be trying to show an image that doesn’t exist. But I’m not clear on the problem? Is it white boxes appearing every now and then?

I’m thinking like you.But i checked all images in there.Yes, white boxes appearing like some images don;t exist but all images ok.

Always flashing white box.

I got it work! But it’s interesting.When i add this code to my compressor,i set k1 to afctr and meter started to work with no issue.But if i set k1 in or out still flashing white box.

But it has lack.Suddenly chancing images.Jumping 1 to 10 for example.I want to do it as normal analog vu meter.It must work smoother…

BTW when i export vst,where should i put image files to see by everyone?Cause i have images and path is ok for images.But when i send plugin to someone,can’t see images.How can i add images to vst?It could be great embedded GUIs.

I guess i have to use includes and add all images to same folder with plugin.

I’m trying to export plugin with includes feature but it says Cabbage can’t bundle images.

But still has issue with meter.It’s not working smooth.

Can you send on your current code, and all files, so I can take a look?

Here is Mac vst.Code and all files inside.

https://dl.dropboxusercontent.com/u/91809016/AO/FCOMP.zip

I can’t seem to download that link right now. I’m currently on a bus and it seems the wifi won’t let me access any dropbox or wetransfer links ;( I will try again later if I can, or tomorrow at the latest.

Thanks for your interest!

I’m still working on it.I hope it will be great.

My compressor plugin almost done.Just working on vu meter.