Cabbage Logo
Back to Cabbage Site

XY-not-Pad

I’ve never been entirely happy with the xypad in Cabbage (as @hdale94 knows only too well!). It harks back to a different time. I think it looks great, but it’s always been tricky to maintain. So I thought it was time I tried rebuilding it using nothing but basic Cabbage widgets and the new Cabbage opcodes. Here’s the result.

Some things to note.

  • It works through a UDO that manages the components, and returns normalised x and y values.
  • You only only need to declare an image with the channel “xypad” in the Cabbage section. This sets the size and position for all components. All other components are created dynamically.
  • The performance is almost comparable to the native xypad, if you don’t go over the top on the UI (which I obviously did with the trailing path - even still, it’s not that bad)
  • I tried doing the vertical and horizontal axis lines with a png image, it looked great but the performance was absolutely horrible. Now it is using two image widgets instead.
  • I’m using two nslider for the labels, with an image placed on top to make them readonly. I used slider rather than labels so that you can access the parameters in a host DAW.

I also did some experiments with making the ball change size as it moves, adding wobbly movements, using sin/cos to add interesting curves to the ball’s path. It offer a huge amount of customisation over the standard XY pad, but in many cases it’s probably overkill! But a nice experiment all the same :wink:

CustomXYPad.csd (8.4 KB)

1 Like

Wow this is excellent! Great job!

I might be wrong, but it looks like there can only be a single instance with a patch, as the channels used to communicate with the gui are all hard-coded at creation time. If a string or a unique integer could be passed to XYPad, then it could make multiple instances, tagging each gui element created. Or maybe you could keep a running count for each XY-not-Pad created. Would a user really need to know this tag in their code?

Exactly. I would pass a unique ID to each component.

This one now takes an integer ID when creating the XYPad. You still have to manage it correctly, but it’s a little more robust now at least. Anyhow, this was never presented as a finish product, more a proof of concept :wink:

CustomXYPad.csd (8.8 KB)