multi-touch turntable

dust's picture

here is a multi-touch turn table, im sending out the rotation value osc so i can scratch some audio samples. feel free to hook it up to external time on a video or rate or something like that and scratch your videos. im using some tb feedback and soundflower on the multi-touch version for added effects. i kind of got lost in the conditional logic, probably should have split the turntable into quarters and used a java script gate to switch between x an y coordinates. im thinking i will add some mixer controls later. here is a video of me scratching with it.

PreviewAttachmentSize
mouse_table.qtz1.44 MB
multi_touch_table.qtz1.56 MB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

dust's picture
Re: multi-touch turntable

is there an easy way to calculate clockwise rotation based on x,y coordinates possibly some sort of cartesian method. i know one of you parametric guys has a simpler solution. right now im trying x=cos(x)-360-sin(y)-360 i still need to scale the output and use a conditional because this is only getting me 180˚ so i have to flip the other side with y=sin(y)360+cos(x)360. im just trying to smooth out the rotation based on x,y hopefully without having to scale ???

cwright's picture
Re: multi-touch turntable

it would be easier if you stated your inputs, and what you're expecting for outputs -- It looks like you're getting an x/y pair for inputs, and then you're doing something rotation-ish with them as outputs.

Anyway, here's how to turn an X/Y pair into a theta/radius pair:

radius = sqrt(x*x+y*y);
theta = atan2(y,x); // -- careful with this one, it can explode on you, unless you're in Snow Leopard -- this might also be in radians, not degrees

to smooth out rotations, smooth theta, not the X/Y pair (this was discussed in the Wiimote thread somewhere, someone wanted to smooth out rotations using X/Y/Z, which is wrong).

dust's picture
Re: multi-touch turntable

i made this version that seems to be smother with a cartesian system but the rate is a little off now im not sure which works better for scratching the post qc sensitivity and acceleration have a lot to do with the actual vinyl emulation so im thinking about trying the theta direction hopefully things will not blow up maybe add the second inner record to my second touch and put in qc momentum and a stop button.

PreviewAttachmentSize
mouse_table2.qtz1.53 MB

dust's picture
Re: multi-touch turntable

so the mouse table2 is well (wrong) after trying to use the cartesian coordinate method with vinyl emulation, i realize that i made my expressions wrong and the only reason this version one and or two is working is because of the logic but when i plug in the correct equation. x1=xsin(360)-ysin(360) not sin(x)*360 like i was trying the logic is messed. don't know how i got that backwards. but now im starting over again.

its probably painfully obvious i haven't taken any courses in calculous or trig (teaching myself) although predicate calculous im good at, i know this because got an a+ in that class.

so this seems like a fairly trivial kinematics problem i'm trying to accomplish, i see chris has an answer, i think what he is describing is the Euler's method which is probably the best way to go, i thought for some reason you could take an xy pair and get coordinate data entirely from them in degrees without using R.

so thanks chris still trying to make the smoothest possible rotation hopefully without using logic. so the method your describing is that Euler's method ? looks similar ? maybe i have to do this as a quaternion. the way i see it in my head seeing 0,0 is in the middle of the screen, i would need to split the screen into 4 giving me the idea that a euler -> quaternion would be the way without Z. i'm really just guessing at this point.

its just buggin me because the notations for every example i look are different and i really want to be able to use this in a qc context even a glsl context seeing they have all expressions built in as well.

so thanks chris seems your the guy for kinematics questions i will try your method seeing i have to re do everything anyways. i was able to accomplish this with logic even if it is a bit un smooth.