Bitmap knob arc

DSP related issues, mathematics, processing and techniques
k brown
Posts: 1198
Joined: Tue Aug 16, 2016 7:10 pm
Location: San Francisco, CA USA
Contact:

Bitmap knob arc

Post by k brown »

Is there a way to limit/define the arc of rotation of a bitmap knob, without altering the Drag XY input floats; in other words limiting the visual arc while retaining it's 0-1 float output.
Website for the plugins : http://kbrownsynthplugins.weebly.com/
adamszabo
Posts: 667
Joined: Sun Jul 11, 2010 7:21 am

Re: Bitmap knob arc

Post by adamszabo »

Yes, there is the start angle and sweep angle, you can change in the arc module
k brown
Posts: 1198
Joined: Tue Aug 16, 2016 7:10 pm
Location: San Francisco, CA USA
Contact:

Re: Bitmap knob arc

Post by k brown »

In the old Vector knobs, yes; but I've yet to find a Bitmap knob with an arc module in it, that's why I'm askin'.
Website for the plugins : http://kbrownsynthplugins.weebly.com/
User avatar
trogluddite
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Bitmap knob arc

Post by trogluddite »

You can do it in principle, but I don't think I've ever seen it done.

Most bitmap knobs use a "strip" of animation frames where the first frame represents the graphics for the "zero" output, the last frame represents the "one" output, and the frame index is just linearly interpolated in between. But that's just the most simple method - there's nothing to stop you from using any maths you like to map the 0..1 range to animation frame indexes.

Usually, there aren't any animation frames for the knob pointing downwards, as they wouldn't be used. But if you had frames covering the full circle, you could use modulus 360 degree maths to allow completely arbitrary arc limits for each control.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
k brown
Posts: 1198
Joined: Tue Aug 16, 2016 7:10 pm
Location: San Francisco, CA USA
Contact:

Re: Bitmap knob arc

Post by k brown »

Setting different values for the Drag Y works fine for creating a short arc (and green maths to restore the output range to 0-1); the hangup is getting it stepped. With Y changed to say 0.25 to 0.75, you get a nice, centered ~100 degree arc, but now the step greens don't work. The whole reason for wanting a short arc knob is to make a selector switch with say, four positions. Must be a way to math it up in the right place to get steps, with 0.25 to 0.75 Y range, no?
Last edited by k brown on Sat Jun 20, 2020 10:27 am, edited 2 times in total.
Website for the plugins : http://kbrownsynthplugins.weebly.com/
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Bitmap knob arc

Post by tulamide »

Working with angles is not as scaring as it might seem.

Getting position from angle on unit circle, add radius and you can draw your own arc:

Code: Select all

x = radius * cos(angle)
y = radius * sin(angle)


The opposite is the function atan2, a variation of the arcus tangens:

Code: Select all

angle = atan2(x, y)
"There lies the dog buried" (German saying translated literally)
k brown
Posts: 1198
Joined: Tue Aug 16, 2016 7:10 pm
Location: San Francisco, CA USA
Contact:

Re: Bitmap knob arc

Post by k brown »

Can anyone offer a solution for a knob that's not code-based - you know, a bitmap knob full of greens, not a Ruby one.
Website for the plugins : http://kbrownsynthplugins.weebly.com/
adamszabo
Posts: 667
Joined: Sun Jul 11, 2010 7:21 am

Re: Bitmap knob arc

Post by adamszabo »

There is the Arc module which is not code based, you can easily add an arc to any existing knob.
k brown
Posts: 1198
Joined: Tue Aug 16, 2016 7:10 pm
Location: San Francisco, CA USA
Contact:

Re: Bitmap knob arc

Post by k brown »

You mean the GUI Arc? - that just draws a line doesn't it?; nothing to do with the rotation angle of the knob, much less create steps within the defined arc of rotation.

Maybe I need to restate my original question more fully/clearly:

I have a bitmap (old-style greens-based, not Ruby) knob; has the usual what is it - 270 degrees rotation. I want it to have only about 90 degrees of rotation for use as a selector switch, like a hardware rotary switch. Within that 90 degree arc, I want it have say four steps. This is all easy-peasy with the old SM Vector knobs; everything you need is already in there.

Like I said, I can get the angle of rotation I want by different values for the Drag Y prim min/max inputs; I just can't figure out how to then get steps within that new arc. The Step module in the knob no longer does it's thing, with the Drag Y values changed.
Website for the plugins : http://kbrownsynthplugins.weebly.com/
adamszabo
Posts: 667
Joined: Sun Jul 11, 2010 7:21 am

Re: Bitmap knob arc

Post by adamszabo »

I still dont really understand it. Is this what you mean? The arc only goes about 90 degrees and not the full angle of the knob. You can change this to whatever you like.
Attachments
sweep knob.osm
(5.61 KiB) Downloaded 1491 times
Post Reply