rotary encoder math
Posted: 18 May 2011 09:30 AM   [ Ignore ]
Avatar
Rank
Joined  2010-12-19
Total Posts:  6
New Member

I’m looking into building a simple tuio dj interface in Max/msp. I looked into Mathieu Chamagne’s excellent MMF project, but I want to go without video projection (just a wacom tablet or maybe wiimote on my main screen). The main problem for me is figuring out how to handle the inputs, in particular the rotary encoders. You would, I imagine, need to track 2 cursors and decide if they are moving in a “circular manner”, whatever that means in mathematical terms. I tried reverse engineering MMF, he seems to be doing a polar<>cartesian conversion, but I don’t really see that solving the problem.

Many thanks in advance for your time and assistance

Joe

Profile
 
 
Posted: 18 May 2011 03:12 PM   [ Ignore ]   [ # 1 ]
Avatar
RankRankRankRank
Joined  2008-02-12
Total Posts:  1111
Member

well this is the way i would do it, since you want to go without projection. I would use the first input to define the center and 2nd to determine the angle of rotation. The issue with this is that at one time you can only manipulate one encoder if you get what i mean. Cause without knowing a fixed position you really cant calculate rotation, easily.
On the other hand you could use a simple gesture algorithm e.g. $1 gesture recognizer, and use that but i see problems arising with that tho specially during scratching.

 Signature 

Company Website - Knode Research and Development
My Youtube

Profile
 
 
Posted: 18 May 2011 05:12 PM   [ Ignore ]   [ # 2 ]
Avatar
Rank
Joined  2010-12-19
Total Posts:  6
New Member

Something to think about. I could use a fixed point to focus a deck, and then spin/scratch from there. This means, however, that the turntables would be the only functional rotary encoders available - I could probably live with that, but it ain’t the most elegant solution.

Before I even need to worry about this, I s’pose, I’d need to figure out how I even define a UI element. In other words, I can easily get input from tuio, but handling it in max (deciding which button/fader/dial is the target) is another matter. I suppose I need to use “route” object for givewn x/y ranges.

Thanks much for the suggestion

Joe

Profile
 
 
Posted: 18 May 2011 08:43 PM   [ Ignore ]   [ # 3 ]
Avatar
RankRankRankRankRankRank
Joined  2007-04-08
Total Posts:  2539
Dedicated

Would it not be possible to use MMF even though you’re not using projection? I don’t see why this wouldn’t still work.

 Signature 

MTmini, MTbiggie, & Audiotouch creator & Community Core Vision Co-founder

Follow on:
My Blog | Facebook | Twitter | Youtube

Profile
 
 
Posted: 19 May 2011 11:47 AM   [ Ignore ]   [ # 4 ]
Avatar
Rank
Joined  2010-12-19
Total Posts:  6
New Member

Seth

Many many thanks for weighing in. Awesome work on tuioclient and many other things. You are one of my heroes!

I don’t understand MMF well enough to do what you suggest unfortunately. As far as I can see UI elements exist only insofar as they are displayed, ie you cannot get useful data from tuio without displaying a ui. If you could explain to me how to bypass the whole “get display dimensions and lock the screen” business I’d greatly appreciate it, although my understanding is that the boundaries of the input area are also set at the same time.

Basically, if I want to use mmf I need to be able to build my own ui objects as opposed to using the ones he supplies (or at least understand how to hack his ui objects at a very basic level). If you can help me figure out how to do this I’d be absolutely thrilled. Note that I am using MMF alpha as opposed to mmf - fantastick. If this is a mistake please let me know how I can get mmf-fantastick to work with my setup.

Thanks so much for the input, and again, awesome job on all the projects.

Best

Joe

Profile