Kyma Forum
  Tips & Techniques
  Panning polar coordinates

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   Panning polar coordinates
garth paine
Member
posted 16 May 2013 19:36         Edit/Delete Message   Reply w/Quote
Hi all - my math is not strong and so I need some help

I am tracking someone (MoCAP) in a 3D space - I want to use the location of that person to pan a sound to that point on the radius of the circle of 8 speakers being driven by Kyma.

So I am using MultichannelPan and want therefore to convert to location of the person into a range of 0-2 to drive the Angle parameter. I know the x,y,z location of the user, and I know the centre of the space. I know the size of the world as a total length x, y, z - I was thinking if I used the 'x' and 'z' positions and compared them to the centre point of the space and then used arcTan to calculate the angle from 0 pan - which will sit on the line dissecting the space on the 'x' plane at the centre point of the world - that this would give me and angle from 0 to 360, and that dividing that angle by 180 would give me the panning Angle - All messages are coming in as OSC messages.

However, I can not work out how to do this in Kyma - was going to use a SoundToGlobalController but am getting myself confused by the math. Would love some help from one of you math brains

Thanks, Garth

IP: Logged

SSC
Administrator
posted 17 May 2013 17:05         Edit/Delete Message   Reply w/Quote

cartesiantopolar.kym

 
Hi Garth,

Will this do the trick? It uses the ArcTan Sound to get:

angle = arcTan (y/x)
radius = (x**2 + y**2) sqrt

assuming x & y range from (-1,1) with zero at the center of the circle.

IP: Logged

SSC
Administrator
posted 17 May 2013 17:06         Edit/Delete Message   Reply w/Quote
p.s. Who is MoCAP?

IP: Logged

garth paine
Member
posted 17 May 2013 18:48         Edit/Delete Message   Reply w/Quote
MoCAP is a Parisian, Tunisian philosopher who specializes in Agency and actor network theory :-)

I am working with a Motion Capture system (Optitrack) with Realtime OSC output.

[This message has been edited by garth paine (edited 18 May 2013).]

IP: Logged

pete
Member
posted 17 May 2013 18:57         Edit/Delete Message   Reply w/Quote
I think the

angle = arcTan (y/x)

will only give you 180deg twice,

You may need to include, if x is minus, angle =angle+180Deg (or PI if in radians).

Pete

[This message has been edited by pete (edited 17 May 2013).]

IP: Logged

SSC
Administrator
posted 17 May 2013 19:52         Edit/Delete Message   Reply w/Quote
Hi Pete,

The output of the ArcTan Sound is the four-quadrant arctangent... so it does take the signs of x and y into account.

Go ahead and give it a try.

IP: Logged

pete
Member
posted 18 May 2013 09:12         Edit/Delete Message   Reply w/Quote
Ohh that's classy

nice work

Pete

IP: Logged

All times are CT (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply

Contact Us | Symbolic Sound Home

This forum is provided solely for the support and edification of the customers of Symbolic Sound Corporation.


Ultimate Bulletin Board 5.45c