Send midi CC's on XY pad

Hi. I’m fairly new to OSC, trying to understand basic stuff.
How do I send different CC’s on X and Y axis of XY pad. I couldn’t even figure out how to send any midi from XY pad. As far as I understand, first I need to set “split” to true. So here’s what I’ve got:
image

And I’m getting this error:
ERROR: MIDI: invalid address (/control/x)
ERROR: MIDI: invalid address (/control/y)

Without splitting I get this
ERROR: MIDI: Traceback (most recent call last):

image

MIDI support in Open Stage Control is just a converter that awaits messages of a very specific form, the xy pad by default doesn’t comply to this and need some adjustements to send MIDI. The split option is going to be removed in the future in favor of the following approaches:

  1. Using a custom module, requires writing javascript
  2. Using a script widget
  3. Using input widgets to split the pad’s value

The first two solutions are not the simpliest but allow deep customization, here is an example for a use case close to yours : Two or more osc address on a toggle button

The third solution is the most straightforward to get if you’re new : set up two input widgets so that they send the MIDI control changes you need and reset the pad’s osc settings. Now set each input’s value property to

#{@{pads_id}[0]}
or
#{@{pads_id}[1]}

Where pads_id is the xy’s ìd. The first statement will return the pad’s x-axis, the second its y-axis. This syntax - documented here - will make the inputs listen for the pad’s update and send osc messages that are compliant with the MIDI converter spec.

Additionally, it is possible to make it work the other way around if you need the pad to update when receiving the control changes you send by setting the xy’s value property to
[@{input_1}, @{input_2}]

This would also let you set the x and y-axes independently using the input widgets if needed. Note that you could use faders instead of inputs here…

2 Likes

Thank you so much for such a quick and detailed response! It’s all clear and works.

Hi @Jaytheway

Please consider to share the piece of code to help the community. We all need examples to learn more. Screenshot of your widget is welcomed !
Cheers

Hi @Greenman
I’m not sure if you can consider it a code. My XY pad’s ID is “xy”.

And here’s what I have on input widget for X value to send midi CC1:
image

The following seems to also work and has less nesting (v0.49.12)

@{pads_id.value.0}
and
@{pads_id.value.1}

1 Like

Just adding to this since for newcomers.
There's now a 4th and probably the easiest approach.
Use the onValue and type in the following code:

send('midi:device_name', '/control', 1, 1, value[0])
send('midi:device_name', '/control', 1, 11, value[1])

This will send cc1 and cc11 with values from X and Y on channel 1.

Regards :slight_smile:
Magnus

5 Likes