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:
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 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!