Slider; separate increase and decrease values

mo0kid's icon

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?

brendan mccloskey's icon
Max Patch
Copy patch and select New From Clipboard in Max.

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 [>]:

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

Roman Thilenius's icon

note to self: first think then post.

brendan mccloskey's icon

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

brendan mccloskey's icon

@ roman

we've all done it too sometimes!

MIB's icon
Max Patch
Copy patch and select New From Clipboard in Max.

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

brendan mccloskey's icon

@ 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's icon

@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.

mo0kid's icon

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!