Forums > MaxMSP

rotary encoder. up down object

March 18, 2008 | 11:46 pm

hello all, im using an arduino with a rotary encoder into max, basically ive got digits going up one way and down the other. is there an object that can recognize the up and down movements? i think ive seen one but wasn’t too sure..

cheers


March 19, 2008 | 1:33 am

On Mar 18, 2008, at 4:46 PM, James wrote:

>
> hello all, im using an arduino with a rotary encoder into max,
> basically ive got digits going up one way and down the other. is
> there an object that can recognize the up and down movements? i
> think ive seen one but wasn’t too sure..

You could cobble a solution together using either counter, accum, or
IncDec (and probably several more that I’m forgetting. They each have
the plusses and minuses.

IncDec is the easy answer, but something based on counter might give
you a more flexible solution.

Chris Muir
cbm@well.com

http://www.xfade.com


March 19, 2008 | 5:19 pm

is there not an object that can recognize if the number value is going up or down?


March 19, 2008 | 5:45 pm

You could easily make an abstraction using [expr] or separate
comparison operators (i.e. < , >, =, etc.) to compare the value of the
current input with the value of the previous input.

On Mar 19, 2008, at 11:19 AM, James wrote:
>
> is there not an object that can recognize if the number value is
> going up or down?

—-
Steven M. Miller
Professor, Contemporary Music Program
College of Santa Fe

Home < http://pubweb.csf.edu/~smill>
SFIFEM <
http://sfifem.csf.edu>
Atrium Sound Space <
http://atrium.csf.edu>
OVOS <
http://pubweb.csf.edu/~smill/ovos.html>
CMP <
http://www.csf.edu/academics/contemporary_music/>


March 19, 2008 | 6:07 pm

On Mar 19, 2008, at 10:19 AM, James wrote:

> is there not an object that can recognize if the number value is
> going up or down?

Detecting whether a number is going up or down is trivial, but I don’t
think that that’s really what you want.

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 86 69 27 196617 t i i;
#P toggle 103 126 15 0;
#P number 86 42 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 103 101 27 196617 >;
#P comment 121 126 53 196617 ascending;
#P connect 2 0 4 0;
#P connect 4 1 1 0;
#P fasten 4 0 1 1 91 93 125 93;
#P connect 1 0 3 0;
#P window clipboard copycount 5;

What is the arduino actually delivering? Some sort of delta based on
number of clicks of the encoder? Is it a positive number if CW, and a
negative number if CCW?

Chris Muir
cbm@well.com

http://www.xfade.com


April 5, 2008 | 11:54 pm

[change +] and [change -] are your friends …


April 5, 2008 | 11:57 pm

actually it turns out im having some troubles in the arduino code, has anyone got one of these working in max?


April 10, 2008 | 12:24 am

I’ve been using an arduino board with max happily, my current project
involves controlling 4 servo motors through a max patch.
I also did a project involving sending 6 integers to max from the analogue
inputs on the arduino.

I would guess that you should get as much as you can right at the arduino
side of things before trying to tackle it in max. Maybe you could have two
variables in the arduino code, for comparing the current and previous inputs
from the optical encoder, and sending the difference to max, so -1 would
indicate a negative direction and 1 a positive direction, and larger numbers
may indicate some sort of force/speed.

Do you have any specific questions pertaining to the arduino code?

On 06/04/2008, James wrote:
>
>
> actually it turns out im having some troubles in the arduino code, has
> anyone got one of these working in max?
>
>


Viewing 8 posts - 1 through 8 (of 8 total)