Kyma Forum
  Kyma Support
  Wacom (X,Y) Coordinates to Circular Coordinates (R; Theta)

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

next newest topic | next oldest topic
Author Topic:   Wacom (X,Y) Coordinates to Circular Coordinates (R; Theta)
Sylvain KEPLER
Member
posted 06 August 2005 05:27         Edit/Delete Message   Reply w/Quote
Hey

I'm about to process the X,Y coordinates from the Wacom Intuos, in order to get from these the actual pen angular position .

At this stage I moved the circle 's 'center' in the middle by applying the '-0.5' operator to the !PenX en !PenY. Very Simple.

Then, I calculate the radius by doing r = (X²+Y²)sqrt.

So the theta angle is supposed to be the result of an arcTan operation.
Theta should be given by : ((!PenX-0.5)/(!PenY-0.5))arcTan.

However, here is my problem, I can't do such thing as asking the arcTan operation applied to that expression. It seems the arcTan only accepts dealing with constant values, but rejects dealing with variables.

("there is an error in one of the parameters being edited. Would you like to close the sound edited anyway and drops the changes to its parameters ?"...)

Any help ?

PS : my following goal will be screening the angle for comparaison operations in order to create misc operations (according the Pen position around the imaginary circle centre, that's why screening the angle is my wish).

Thanks in advance.

[This message has been edited by Sylvain KEPLER (edited 06 August 2005).]

IP: Logged

SSC
Administrator
posted 06 August 2005 11:48         Edit/Delete Message   Reply w/Quote
There is an ArcTan Sound that you could use by feeding a Constant with your X and Y values into it.

Also, you could use !PenAngle and !PenRadius which has those calculations already done for you.

[This message has been edited by SSC (edited 06 August 2005).]

IP: Logged

tuscland
Member
posted 07 August 2005 03:46         Edit/Delete Message   Reply w/Quote
Salut Sylvain !

At page 327, in the "Kyma X Revealed" manual, you can send the message "theta" and "r" to a Point (the notation is X@Y) to get the values you want.
So, if you have the coordinates X and Y, you can do :

code:
angle := (X@Y) theta.
radius := (X@Y) r.

Et voilà !
Cam

PS : je suis aussi français ;-)

[This message has been edited by tuscland (edited 07 August 2005).]

[This message has been edited by tuscland (edited 07 August 2005).]

IP: Logged

Sylvain KEPLER
Member
posted 07 August 2005 10:53         Edit/Delete Message   Reply w/Quote
You know what ? I'm happy .
That's the magic of kyma. I had forgot the arcTan was available as a protoype. I'm that kind of guy who, sometimes, live on clouds and like to create a world of his own..;-)

IP: Logged

Sylvain KEPLER
Member
posted 08 August 2005 10:38         Edit/Delete Message   Reply w/Quote
The ArcTan Protoype is welcome in my current sound design. Saved...but

The prototype reference gives not enough info about what should be the input's nature, how scaled is the output (0-1 value or -1 to 1 value etc, in degrees, in radians ??)...

well, as for the input, all that matters is a ratio.
But as for the arcTan output, would the output be given between 0 and 1 ? Let's suppose then I need to get the cosine out it, should I think of multiplying the arcTan by 2*pi ?...

I tried the idea of using the !PenRadius and !PenAngle in my sound but they are somewhat (a bit to be honnest) useless.

What I need to do actually is a rotation of the "0° reference", a bit like if I would rotate the intuos. To do this I need, for instance, to take the ratio !PenX/!PenY which gives the Tan of the angle (I need prior this to translate the X;Y origin to the center of the intuos). Then I need to calculate the ArcTan (thanks to the given prototype) of the ration X/Y. Then Add an angle (ie +30°) and then output the sinus or the cosinus of the global angle.


IP: Logged

SSC
Administrator
posted 08 August 2005 10:47         Edit/Delete Message   Reply w/Quote
To rotate the tablet, you could add an offset to the pen's angle, as follows:

rotated x coordinate -- !PenRadius * (!PenAngle + (30 / 180)) normCos

and

rotated y coordinate -- !PenRadius * (!PenAngle + (30 / 180)) normSin

Change the 30 to the desired number of degrees of rotation.

IP: Logged

Sylvain KEPLER
Member
posted 08 August 2005 11:25         Edit/Delete Message   Reply w/Quote
Nice idea ideed ! Many Thanks !
I tried it and it works...but (always a shadow in the frame ) not 'like a charm'. I get a sort of 'offset' mixed with the final signal which is quite hard to get rid off by adding, multiplying or dividing a value...I'll try to adjut the settings to get the best performance out of it.
Maybe, I assume, this may be caused by a personal lack of comprehension about how the normCos and normSin functions work.
Maybe you could let me know about it ?

I might also try to reach my goal by doing some sort of trigonometry with sinus and cosinus operations Since I need to add an anlge and since I have better results by operating with Sin and Cos...as we know , Cos(a+b) is CosaCosb - SinaSinb and Sin(a+b) is SinaCosb+SinbCosa...I'll let you know about how I get on with this other possibility.

[This message has been edited by Sylvain KEPLER (edited 08 August 2005).]

IP: Logged

Sylvain KEPLER
Member
posted 08 August 2005 12:19         Edit/Delete Message   Reply w/Quote
...news from the works...
Well I actually reached the goal by manipulating on Cos and Sin as described above in my previous post.
Despite this, I'd like to get your help on how astutely use the normCos and normSin functions. Could you ? Thanks for your help.


IP: Logged

SSC
Administrator
posted 08 August 2005 13:30         Edit/Delete Message   Reply w/Quote
x normCos = (pi * x) cos

x normSin = (pi * x) sin

They are convenient versions of the sinusoids that are periodic with period 2 instead of period 2 * pi (or 360 degrees). (!PenAngle is also periodic with period 2.)

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