Forums > MaxMSP

Slider; separate increase and decrease values

May 31, 2010 | 12:52 pm

I would like to create a horizontal slider that outputs a different message dependent on the direction it is moved. It will be a 16 step integer slider used to shuffle a step sequencer.
What expression will allow the slider to light either a left or right bang?


May 31, 2010 | 3:46 pm

Is this what you want: "if $i1 > $i2 then bang else out2 bang", $i2 being a slightly delayed version of $i1 slider output; here are two different versions, one using the above method, the other using [t i i] and [>]:

– Pasted Max Patch, click to expand. –

This represent a crude type of ‘hysterisis’, where we are evaluating current output compared to most recent.

Brendan

EDIT
it seems the solution on the left is a little erratic if you click in different positions, as opposed to dragging/scrolling


May 31, 2010 | 4:15 pm

note to self: first think then post.


May 31, 2010 | 4:19 pm

Hey Roman
thanks for the tip – did you look at my solution? Clicking (as opposed to dragging) on the slider on the left causes unpredictable results; it doesn’t always work


May 31, 2010 | 5:40 pm

@ roman

we’ve all done it too sometimes!



MIB
May 31, 2010 | 5:52 pm

maybe I’m not seeing the problem here, but wouldn’t this do the trick?

– Pasted Max Patch, click to expand. –

May 31, 2010 | 6:38 pm

@ MIB
i’ve been using [change] and similar for ages; i also always use the helpfiles, and not once did i spot the +/- argument. Nice one



MIB
May 31, 2010 | 6:51 pm

@brendan

we are all guilty of that with object we use a lot and think we know… that’s why I love this forum so much. someone is always pointing out some new trick or feature that hasn’t quite made it in ones active repertoire yet.


June 1, 2010 | 12:14 pm

Brilliant! Thankyou. Whilst the first method didn’t quite work it’s good to see other ways and their shortcomings.
So many objects to learn!


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