kyma•tweaky . How . ConvertRectangleToPolar

Question (or Task)

I have a MIDI touch pad controller that puts out X-Y controller values. I would like to use the angle and radius of where I touch on the pad as a controller in Kyma.

Solution(s)

You can use two different modules in Kyma to achieve this: ArcTan and SqrtMagnitude.

Each of these modules require the X coordinate to be in the left channel of the Input and the Y coordinate to be in the right channel of the Input. You can do this by placing two Constants into the Left and Right inputs of a ChannelJoin Sound. In the left channel Constant, put in !X, and in the right channel Constant put in !Y. (If you want the origin of the circle to be the center of the touch paf, you should use the VCS editor to change the range of the !X and !Y controllers to be -1 to +1.)

To get the angle, put the ChannelJoin into the ArcTan. The output will be in the range of -1 to +1, with -1 corresponding to -180° and +1 corresponding to +180°. You can use this Sound in an expression in any parameter field to control the parameter with the angle of the touch on the touch pad.

To get the radius, put the ChannelJoin into the SqrtMagnitude. The output will be in the range of 0 to +1, with 0 corresponding to the center of the pad and +1 corresponding to the edge of the pad. You can use this Sound in an expression in any parameter field to control the parameter with the radius of the touch on the touch pad.

-- KurtHebel - 17 Feb 2004

WebForm
Question: How can I convert X-Y touch pad controllers to radius-angle controllers?
Keywords: angle, radius, x, y, rectangular coordinates, polar coordinates

----- Revision r1.1 - 17 Feb 2004 - 21:06 GMT - KurtHebel
Copyright © 1999-2014 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding kyma•tweaky? Send feedback.