XY Values to a Single Linear Value

Jul 25, 2011 at 1:55pm

XY Values to a Single Linear Value

Hi guys,
What I want to do is use the analogue sticks on my xbox 360 controller as jog wheels to control sample players. I.e. when I rotate the sticks at their outer edge, a clockwise motion plays the files forwards, counterclockwise backwards, the faster the rotation, the faster sample plays etc etc.

To do this I want to take the x and y values from the sticks and convert them into a single linear value. I’m sure there’s an obvious solution to this, but I can’t see one.

Any ideas guys?

#57852
Jul 25, 2011 at 2:29pm

Hi

while I’m looking at this, read this thread, particularly the use of [cartopol].

Brendan

#207549
Jul 25, 2011 at 2:44pm

Hi Brendan,
Thanks, [cartopol] was exactly what I was looking for!

Chris

#207550
Jul 25, 2011 at 2:51pm

Keep us posted – I’m still banging my forehead against the Max window!

Brendan

#207551
Jul 25, 2011 at 3:04pm

For my purposes (as a live performance instrument) I’m going to use some sort of averaging to convert changes in angle into a float between -2 and 2 for send into [groove~]

#207552
Jul 25, 2011 at 4:57pm

doh! forgot to include the link

http://cycling74.com/forums/topic.php?id=30664

Brendan

#207553
Jul 27, 2011 at 11:48pm

If your maths is better than mine (likely), then your solution may well be more elegant than this:

– Pasted Max Patch, click to expand. –

Brendan

#207554

You must be logged in to reply to this topic.