keeping slider in position

Jul 27, 2011 at 8:01am

keeping slider in position

Hello all
I’d like a joystick controler to keep its position, and not going back to its initial position. All i managed to do is creating stack overfows. Sounds like a noob question but i’m sure you guys know how to resolve it.
cheers
ka

#58203
Jul 27, 2011 at 9:45am

yes exactly (but for this you just need to remove the spring !!!)
but also kind of buttons which actually send 0 to 255 values and then go back to the 0 position. How can I “freeze” it ?

#209019
Jul 27, 2011 at 10:53am

Hi kala
the simplest method would be to store the number in [int] and use a [bang] from [change +] to trigger it; or use [change +], [change -] and a [gate]; these objects output a 1 or -1 when the value is either rising or falling, allowing one to open and close the gate:

– Pasted Max Patch, click to expand. –

As you can see, the first method is more accurate.

There are individual objects which perform a similar task, such as [peak], [past] and [maximum], but I find it tricky to operate on realtime number stream input in this way; I guess they are designed to handle lists, but look at the helpfiles for these guys too.

Brendan

#209020
Jul 27, 2011 at 11:37am

cheers !

#209021
Jul 27, 2011 at 1:55pm

I looked again at this and found that the reason for the unreliability of the [gate] method is due to the control flow ordering of Max: from right to left, so one descending number will ‘sneak’ through the gate before it is closed; the solution is to insert a [pipe 1] object before the [gate]‘s RIGHT inlet.

But the [int] method is way simpler

Brendan

#209022

You must be logged in to reply to this topic.