Cabbage Logo
Back to Cabbage Site

LFO on GUI Parameters

Okey, so I figured out the problem. I have two seperate if-statements, where one sets the xy-value if a parameter is changed, and the other sets the parameter if a xy-value is changed. This way they work mutual, but I fear my implementation of this is not the best.

Do you have any suggestion how to improve this?

I suspect this is also why this jumping occurs
Jumping

It’s a little tricky when i know this is buried deep within a larger implementation. Is there any way you can prepare a full minimal example? I can throw an eye over something like that much quicker :+1:

Yep, will throw it together now

xy test.csd (1.1 KB)

Okey, I am having a little problem with it for some reason? Changing the combobox does not change the value for some reason, maybe you’re able to see if there is something I forgot to add

It works fine in the main project, but I know it’s tricky to jump into several hundred lines of codes

It makes little sense to put the following code outside an instr block:

gkX chnget "x"
gkCombo_1 chnget "combo1"
gkGain chnget "knob0"

If you put it in instr 0 (that is outside any instr/endin block) it will only ever get called once. So you will not get any updates. If I put them inside instr 1 it works fine.

Yep, that was my mistake, all the chngets are in a individual instr 1 in the project :sweat_smile:

This happens sometimes when moving the ball aroundJumping 2

By the way, merry christmas! :gift: :christmas_tree:

I’m not seeing that behavior here?

xy test.csd (1.1 KB)

Happy Christmas indeed, I hope you have a good one!

Jumping 3

It happens randomly if you mess around with the knob and place the ball around

Very odd right?

Yes, i can reproduce it. I imagine it’s an issue with screen resolution. Each tie you move the ball around you effectively qunatise based on pixels. If you have a slider for example that is 100 pixels in length, with a range of 0 to 1000, it will jump 10 each time you move a single pixel. I imagine something similar is happening here. You are getting and setting x-channel values in a single k-cycle. At some point the floating point resolution is lost and you get this glitch. I imagine that is what the problem here is. There is not a whole lot one can do about I fear… :thinking:

Okey, what would be the best way to limit this behaviour then? Set the knob range to 0, 1, 0, 0.01 and the xy-pad ranges to the same?

That’s worth a shot at least. Try it out and see if it’s any better… :+1:

Ah, seems like you can’t set increments on xy-pad? But the same thing happens when you set the slider to the same increment as the xy-pad currently is set to :sob:

Okey, so what do you think would be the best option in a commercial product? Make the knob inactive when selecting the parameter with the combobox? (so it’s still visible and moving when changing the xy-pad)

You can’t set the slider to the same increment because, as you’ve discovered. Because you can’t change the increments in the xypad. [quote=“hdale94, post:119, topic:2217”]
Okey, so what do you think would be the best option in a commercial product?
[/quote]

If I was doing this for a commercial plugin I would write a custom xypad and not a generic one size fits all type of widget like the one that comes with Cabbage.

I think you might have more success if you create your own xypad? But if course it makes the whole thing a little more complex.