General

converting XY coordinates to AD

Started by Audiorama on .

Sign in or create an account to join the conversation.

9 posts

Topic starter
Hi everybody,

I'm trying to pilot the wonderful max4live plugin multichannel send nodes with Lemur.
(I use already the multiball object as an X,Y pad to do quadrophonic spatialization in Live, rather easy ;)
But this m4l plugin must receive Angle and Distance coordinates.
So how could I convert my x,y coordinates (sent by the multiball object) to a,d coordinates, before sending them to the m4l plugin ? :(
Based on the Pythagorean theorem I think you can calculate the distance between two points defined by x,y coordinates taking under consideration that they form a right-angled triangle with their x and y's being the legs and the distance being the hypotenuse.

Without digging too deep into it and checking if it is indeed true for all posible combos of x,y (location of points in each of the four cartesian, ermmm, is quadrants the correct english word?, not sure)....aaanyway.....I THINK (please do bother to check, Im not sure)

If we have point A (xA,yA) and point B(xB,yB) and their distance d then

d squared = (xB-xA) squared + (yB - yA) squared

therefore the distance d is

d= square root of ( (xB-xA)squared + yB-yA)squared)

For the angle, I dont have a clue! lol

EDIT: distance calculation confirmed, a few lines down in the wiki article above, just saw it! lol
thanks for your quick reply :D
i'm gonna precise my problem :
in a xy pad , you define usually the position of one point by two values on the two axes. that's what we can do with the multiball object, no ?
we can send two CCs or more (three in fact) in order to spatialize a sound in a quadrophonic space. (on a Ableton Live audio track, for instance)
Now, there is a very nice Max4Live plugin that can spatialize your sound on as many speakers you want (up to 12).
But in this plugin , the position in the square is defined in another coordinates mode , which is AD : Angle and Distance ...

My problem is : how can I convert the x,y coordinates (given by the multiball object) in these a,d coordinates in order to drive this spatialization in the m4l device ?
BTW this one does what you want and it accepts those things i dont know of, x,y coordinates!

http://www.maxforlive.com/library/device/1120/xy-send-nodes

As for the initial Distance/Azymuth thing, yes I really dont have a clue what M4L means with Distance and Azymuth but ANY distance of ANY point towards ANY other reference point could still be calculated by what I said earlier!