Cabbage Logo
Back to Cabbage Site

Bobbling Ball

This is just about the XY pad where when pulled along the right-hand edge or lower edge it bobs around a bit:

I was wondering about some other possible options with this widget. Like the one in CsoundQt, would it be easy to implement a ‘crosshairs’ mode?

It might be useful to be able to optionally offer a simpler design also, omitting the number boxes at the bottom.

‘Spring’ that acts like a joystick?

Other than that, could the user provide a background for the pad area with PNG? Or replace the ball with a PNG of their own?

Finally, I think driving the ball from the orchestra using cabbageSetValue doesn’t work in queue mode - unless theres a trick to doing this like with hrange.

I have a feeling this is one of your most beloved widgets to work on…

yeah it’s a real fav of mine :rofl: Have you thought of writing your own ala my XY-not-Pad

I tried various updates to this widget over the years including letting users set custom backgrounds. But it resulted in very poor drawing performance. I can have another go, I know more now than I did then, maybe that will count for something :slight_smile:

That’s nice, I must have missed it at the time. Do you think there are minimal efficiency losses in doing it this way?

You should just put your foot down if I (or anyone else) makes unpalatable widget demands. Maybe just the bobbling effect and the response to cabbageSetValue would be good though.

If only you hadn’t written Sonic Lava Lamp all those years ago :rofl:

I agree, that would be a good start. The example I posted would perform a lot better if you use just one instead of the 8 I employ to add the trail.

So with regards to the cabbageSet issue, I’m afraid this widget suffers from the same fate as the range sliders. The solution is similar:

form caption("test") size(300, 250) colour(58, 110, 182) pluginId("tcsg") guiMode("queue") 
xypad bounds(37, 12, 200, 200) channel("xChan10000", "yChan10000") rangeX(0, 1, 0) rangeY(0, 1, 0)
-n -d
ksmps = 32

instr 1
cabbageSet metro(20), "xChan10000", "valueX", abs(oscili:k(1, .1))
cabbageSet metro(20), "xChan10000", "valueY", abs(oscili:k(1, .3))

;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] 

I’m still working on the ball debobbilation…

The bobbling should be a little less noticeable now. I’m still not 100% happy with it, but I could say the same about the widget in general. Can you let me know if it works a little better for you now?

The most recent build I can find is this one:
but I think this is older than the change you describe.

By the way, this version is producing _Log.txt files in the PWD everytime a csd is run.

Hmm, not sure what happened there. but I triggered a new build just now, which seems to have started Ok.

Thanks, Rory. Got it.

The bobbling along the edges seems improved but it seems to now have infected manual movement and ‘fling’ mode:

Are you telling me you don’t like this? I think it looks awesome :rofl:

Ok, back to the drawing board. Pff. The problem is down to a feedback loop between Csound the UI. You drag the ball, it sends a channel message to Csound, Cabbage picks up change to channel…, notifies the UI, which updates and sends a channel message…etc., etc. There is a rounding issue taking place which is causing the problem. The resolution of the screen is far worse than that of the audio signal. I’ll find a solution. Do you need an XY pad for your diffusion plugin?

It really looks that the ball is travelling over a gravelling surface, Well done! Thanks for the explanation though.

I don’t need this for anything particular at the moment, I just thought we were on a roll with the encoder so I thought I keep firing away.

Just pushed another ‘fix’ now. It seems to work Ok for me, but I wonder if the issue is compounded by the fact you are on a hi-res retina display? Here’s how it looks for more gravel walking…

1 Like