Cabbage Logo
Back to Cabbage Site

Knobman sliders

Perfect

Thank You!

Hey Rory,

Is there any way with the new Knobman slider feature to have the range different then 0 to 1. Attach is an example, one with the range at 0 to1 for the slider, but the other is a range of 0.32 to 3.2.

Please advise,
Matt

TestGui.zip (394.6 KB)

Sure, You just need to scale the values so as your slider moves from .75 to 5.75, you move through frames 0-30. Simple math is your friend:

iSlider4Min = .175
iSlider4Max = 5.75
filmStrip "sliderIdent4", int(((kvSlider4-iSlider4Min)/(iSlider4Max-iSlider4Min))*30)*145, 145, 145

The UDO that I wrote could also be updated to take these things into account. I just wrote it as a quick example. But it could certainly be modified and made more robust.

p.s. you mention a range of .32 to 3.2, but in your example it goes from .175 to 5.75?

Hello Rory,
What is the status of using knobman sliders and knobs ?
The example in the miscellanous section uses only one png file and on the first post, you talk about splitting the knoman file into several image.
Could you please update the tutorial ?
Many thanks

You don’t need to use multiple PNGs, although you still can if you want. I think it’s easier to use just the one, and use the crop identifier to determine what is actually seen at any one time. The example in the Misc folder had some absolute paths that were causing some display problems. I’ve fixed that now.

I start to understand what is the aim of each parameter in the crop function. Is the crop function documented somewhere?
Also, is it possible to use this technique with endless encoders?

My apologies, it doesn’t seem to have made it into the docs! I’ll sort that now. Yes, it can be used with an endless encoder. Crop takes 4 parameters, x, y, with and height. The idea here to to place a slider over an image. Then set the slider’s alpha value to 0 so that it is not seen. Then use crop() along with an identchannel with the image to display whatever part of the image you wish. The UDO in the example can be easily hacked. Let me know if you are finding it tricky to work with.

Just modified the UDO so that the value for the slider’s min/max gets normalized to 0 - 1

opcode filmStrip, 0,Siiikkk
	Sident, iframes, iWidth, iHeight, kval, kmin, kmax xin
	knorm = (kval - kmin) / (kmax - kmin) ; normalize min and max values to 0 - 1 range
	if changed(kval) == 1 then
		SMessage sprintfk "crop(0, %d, %d, %d)", int(knorm*iframes)*iHeight, iWidth, iHeight
		chnset SMessage, Sident
	endif
endop

this also changes the UDO call to something like

    iknobW = 50 ;knob width
    iknobH = 50 ; knob height
    iframes = 100 ; number of image frames
    
    
    filmStrip "rsliderIdent1", iframes, iknobW, iknobH, kchop, 0.03, 0.5

where 0.03 is the min and 0.5 is the max

1 Like

why your example(KnobImageSlider) knob can’t rotate ?

One doesn’t rotate Knobman images. We just move through the frames which is what this example does. Btw, there is a new rotary slider look and feel with the latest version of Cabbage that you might prefer to use over the older one.

U have example complete code ? if you have you can send to me. I want make custom knob sliders thanks .

The full example is in the Examples folder under Miscellaneous…

I see it already. but I get a problem as why knob can’t rotate.

Or if knob will rotate must be file .svg ? in example Miscellaneous file import is .png

Hi , I’m very new to cabbage audio or any programming but I am trying to learn how to make plugin.
Somehow, knobman-slider code in the example does not let me scroll thru the knobman stitched image when I run the example code. It shows the image but it does not look scroll to next frame . The value in the popup keeps changing when I drag the knob image. I have just installed latest cabbage software in win10 environment. Dose anyone have any clue ?
Please advise .
When I installed cabbage software, one .dll file could not be installed . Is this the reason?

Hi , I solved my issue written in one above comment!! .
I solved it by changing my audio device setting sample rate to 44,1kHz from 48kHz.
I don’t know how this audio device setting is related to this issue.

Hi @Dixy, can you let me know the version number you are using? I thought this issue with sampling rates and audio settings was fixed :thinking:

I just checked here myself and I see the issue persists. :fearful: I’ll take another look and see if I can find a fix.

Hi @Dixy. There is a new version available here that addresses this issue. I quickly tested on Windows and OSX and it seems to work fine now. Let me know if you’ve any further problems.

Hello Rory

Thanks for the bug fix!
It looks fine now.