# Knobman sliders

**URL:** <https://forum.cabbageaudio.com/t/knobman-sliders/390>\
**Category:** Cabbage recipes\
**Created:** [1 January 2017 16:18 UTC](https://forum.cabbageaudio.com/t/knobman-sliders/390 "2017-01-01T16:18:15Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [1 January 2017 16:18 UTC](https://forum.cabbageaudio.com/t/knobman-sliders/390/1 "2017-01-01T16:18:16Z")

</div>

I had a go at using some knobman images for rotary sliders. First I downloaded some filmstrips for [here](http://www.g200kg.com/en/webknobman/gallery.php). Then I split them up into single png images using imagemagick and python using the following scripts:

```
import subprocess
import sys
print "usage: python convertToImage.py 'filename'"
print "example: python convertToImage.py 'knob'"

imageName = sys.argv[1];

for i in range(32):
	command = "convert 'knob.png' -crop 96x96+0+"+str((i)*96)+" "+imageName+str(i)+".png"
	print command
	process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE)
	process.wait()

```

After that I was able to quickly use them in Cabbage by dynamically setting the image each image widget displays. I used some arrays so I didn’t have to repeat code four times. I think it works pretty well. Thanks for @Thrifleganger and @tuncark for prompting this little experiment. I’ve attached the images and source code to this post.

Btw, it wouldn’t be difficult to add a way of scrolling through a filmstrip so that one doesn’t need to split the images up. I can add that if people are interested.

![](https://forum.cabbageaudio.com/uploads/default/original/1X/2ab1e65a7b830dd8aca7380609cb0fb676d2cab5.gif)

[KnobImageSlider.zip](https://forum.cabbageaudio.com/uploads/default/original/1X/cefb66050fd0bad404931cd18103eafe84d094ae.zip) (275.6 KB)

---

<div class="post-metadata">

**Author:** ![tuncark](https://forum.cabbageaudio.com/letter_avatar_proxy/v4/letter/t/a88e57/32.png) [@tuncark](https://forum.cabbageaudio.com/u/tuncark)\
**Post date:** [1 January 2017 21:11 UTC](https://forum.cabbageaudio.com/t/knobman-sliders/390/2 "2017-01-01T21:11:04Z")

</div>

Wow! Thanks for this one! That’s simplest way i guess.But if you do strip instead of invidual images,it would be great!

---

<div class="post-metadata">

**Author:** ![Jay](https://forum.cabbageaudio.com/letter_avatar_proxy/v4/letter/j/ed8c4c/32.png) [@Jay](https://forum.cabbageaudio.com/u/Jay)\
**Post date:** [28 February 2017 08:44 UTC](https://forum.cabbageaudio.com/t/knobman-sliders/390/3 "2017-02-28T08:44:03Z")

</div>

Hi Rory, did you follow up on using a strip?

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [28 February 2017 09:48 UTC](https://forum.cabbageaudio.com/t/knobman-sliders/390/4 "2017-02-28T09:48:11Z")

</div>

Not yet, but it’s on my list of things to do. I was thinking of adding an x and y offset identifier that we could use to scroll through an individual image. That should work Ok I think?

---

<div class="post-metadata">

**Author:** ![smackaudio](https://forum.cabbageaudio.com/letter_avatar_proxy/v4/letter/s/57b2e6/32.png) [@smackaudio](https://forum.cabbageaudio.com/u/smackaudio)\
**Post date:** [25 April 2017 14:06 UTC](https://forum.cabbageaudio.com/t/knobman-sliders/390/5 "2017-04-25T14:06:20Z")

</div>

I would love to have this in cabbage. Using Flowstone for years, i’ve became quite a pro at Knobman and gui design. Please add this feature!

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [25 April 2017 14:11 UTC](https://forum.cabbageaudio.com/t/knobman-sliders/390/6 "2017-04-25T14:11:01Z")

</div>

There seems to be quite a lot o support for this. It’s on the list. 😉

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [25 April 2017 15:33 UTC](https://forum.cabbageaudio.com/t/knobman-sliders/390/7 "2017-04-25T15:33:08Z")

</div>

I’ve now have this implemented by adding a crop() identifier to the image widget. I went with the image widget rather than the slider to make things a little more generic. In the example shown below, I place a slider with alpha 0 on top of each image widget. The crop identifier forces the image widget to display only a small part of the source image. It’s then quite simple to dynamically set which part of the image to show using identifier channels().

![](https://forum.cabbageaudio.com/uploads/default/original/1X/9f42c36977d747d509771db978a268cb3a43d0c1.gif)

Note that I would probably wrap this logic into a UDO if I was developing GUIs using this method. Note this is only implemented for .pngs for now.

---

<div class="post-metadata">

**Author:** ![smackaudio](https://forum.cabbageaudio.com/letter_avatar_proxy/v4/letter/s/57b2e6/32.png) [@smackaudio](https://forum.cabbageaudio.com/u/smackaudio)\
**Post date:** [25 April 2017 16:12 UTC](https://forum.cabbageaudio.com/t/knobman-sliders/390/8 "2017-04-25T16:12:09Z")

</div>

That looks great!

When do you think this feature will be released?

Can you provide a zip of the project as well?

Matt

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [25 April 2017 16:29 UTC](https://forum.cabbageaudio.com/t/knobman-sliders/390/9 "2017-04-25T16:29:57Z")

</div>

I will prepare new beta versions of Cabbage2 during the week. This csd will be in the examples. This feature will not make its way into the older version of Cabbage 1.n.

---

<div class="post-metadata">

**Author:** ![smackaudio](https://forum.cabbageaudio.com/letter_avatar_proxy/v4/letter/s/57b2e6/32.png) [@smackaudio](https://forum.cabbageaudio.com/u/smackaudio)\
**Post date:** [25 April 2017 16:41 UTC](https://forum.cabbageaudio.com/t/knobman-sliders/390/10 "2017-04-25T16:41:21Z")

</div>

Awesome!

Thank you

BTW, cant wait for Cabbage2

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [25 April 2017 16:44 UTC](https://forum.cabbageaudio.com/t/knobman-sliders/390/11 "2017-04-25T16:44:27Z")

</div>

What OS are you on? You can try it already. There are beta packages available.

---

<div class="post-metadata">

**Author:** ![smackaudio](https://forum.cabbageaudio.com/letter_avatar_proxy/v4/letter/s/57b2e6/32.png) [@smackaudio](https://forum.cabbageaudio.com/u/smackaudio)\
**Post date:** [25 April 2017 16:57 UTC](https://forum.cabbageaudio.com/t/knobman-sliders/390/12 "2017-04-25T16:57:27Z")

</div>

i have both windows and osx.

Matt

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [25 April 2017 17:10 UTC](https://forum.cabbageaudio.com/t/knobman-sliders/390/13 "2017-04-25T17:10:22Z")

</div>

Sweet. I’ll prepare new betas for both platforms later in the week. Just need to tidy up a few things first.

---

<div class="post-metadata">

**Author:** ![smackaudio](https://forum.cabbageaudio.com/letter_avatar_proxy/v4/letter/s/57b2e6/32.png) [@smackaudio](https://forum.cabbageaudio.com/u/smackaudio)\
**Post date:** [25 April 2017 17:11 UTC](https://forum.cabbageaudio.com/t/knobman-sliders/390/14 "2017-04-25T17:11:35Z")

</div>

Perfect

Thank You!

---

<div class="post-metadata">

**Author:** ![smackaudio](https://forum.cabbageaudio.com/letter_avatar_proxy/v4/letter/s/57b2e6/32.png) [@smackaudio](https://forum.cabbageaudio.com/u/smackaudio)\
**Post date:** [27 April 2017 20:24 UTC](https://forum.cabbageaudio.com/t/knobman-sliders/390/15 "2017-04-27T20:24:51Z")

</div>

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](https://forum.cabbageaudio.com/uploads/default/original/1X/d963c6ab52f0c1a02d537c5133b2a1ff04f9a5dc.zip) (394.6 KB)

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [27 April 2017 22:28 UTC](https://forum.cabbageaudio.com/t/knobman-sliders/390/16 "2017-04-27T22:28:42Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Karamel1](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/karamel1/32/1680_2.png) [@Karamel1](https://forum.cabbageaudio.com/u/Karamel1)\
**Post date:** [6 January 2018 17:36 UTC](https://forum.cabbageaudio.com/t/knobman-sliders/390/17 "2018-01-06T17:36:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [7 January 2018 09:18 UTC](https://forum.cabbageaudio.com/t/knobman-sliders/390/18 "2018-01-07T09:18:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Karamel1](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/karamel1/32/1680_2.png) [@Karamel1](https://forum.cabbageaudio.com/u/Karamel1)\
**Post date:** [7 January 2018 09:26 UTC](https://forum.cabbageaudio.com/t/knobman-sliders/390/19 "2018-01-07T09:26:21Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [7 January 2018 09:34 UTC](https://forum.cabbageaudio.com/t/knobman-sliders/390/20 "2018-01-07T09:34:05Z")

</div>

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.

[Next page](https://forum.cabbageaudio.com/t/knobman-sliders/390.md?page=2)
