Omnisphere Orb - XY to Polar Coordinates

Hi Everyone,

I'm working on trying to create a controller for the Omnisphere synth "Orb" interface. It's a circular interface that uses polar coordinates (radius and angle) to cover the entire area.

The problem is trying to convert Cartesian (XY) coordinates into Polar coordinates which can be read by Omnisphere. Is this type of conversion possible?

Any help will be greatly appreciated!
Here is a link to Omnisphere Orb for more information:

Here is a small session with a xy pad that does it on cc 51 and 52 : orb.json (2.5 KB)

You'll need to send the cc individually though to bind the synth properly.

Thank you jean-emmanuel, this is great!!

Not sure exactly what you mean by "send the cc individually to bind the synth"
Could you please explain to help me understand.

Thank you for your time and assistance!!

The XY sends both CCs when interacted with, but in order to set the midi learn properly in your soft you'll probably need to send each CC separately. In the XY's script the lines that begin with send() could be copied in the console (shown with ctrl + k), with any value instead of a and r. By the way these lines need to be edited so that the port in midi:port matches your server configuration.

Thank you for your reply and continued assistance. Still have not got this to work as hoped.
I have made the necessary adjustments in midi:port and set the midi learn. I can now see the interface reacting. But it's not following the OSC interface actions. When I move xy ball up&down, and right to left in OSC, the Orb interface only moves from the right side outer edge to the middle, then back to the right side outer edge. Any ideas what may be causing this?

Here are my adjustments to the script:

// cartesian coordinates
var x = value[0], y = value[1]

// polar coordinates
var a = Math.atan2(x, y) / (Math.PI)
var r = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2))

// convert to range 0-127
a = a / 2 + 0.5
r = Math.min(127, r * 127)

// send midi
send('midi:Omnisphere', '/control', 1, 34, a)
send('midi:Omnisphere', '/control', 1, 35, r)

I forgot to multiply the angle by 127:

a = (a / 2 + 0.5) * 127

Other than that I don't know I'm only guessing there because I don't have this software...

It works!! You're an artistic genius in Maths!

I now have access to the entire Orb circle. One interesting artifact is that the Orb movements are opposite of the OSC XY movements. When I move up&down, the Orb moves side to side. And when I move side to side the Orb moves up&down. This is not a big deal and a completely acceptable solution. As my main goal was gaining full access to the Orb movements within the circle.

Thank you again for taking the time to help and for sharing this amazing software!

Haha I had to look for the formula online ;). The axis inversion is due to Math.atan2(x, y), should be Math.atan2(y, x)

Now it's working perfectly!!
Changing to Math.atan2(y, x) helped, but I also needed to switch the XY ranges to:

{
  "min": 1,
  "max": -1
}

Thank you again for all your help!!!