Forums > MaxMSP

Question for Controller..

September 28, 2009 | 12:35 pm

Hello to everybody its my first time in the forum, and i am also nwebie in max/msp, so i would like to ask a question as concern the game controllers, i have connect a classic game controller in my patch and i want to control a slider with the button of the X-axis,
i have already done it, but when i press the button the slider only take one value that is the one that describes the button in my case number 15.. How is there any way to control the slider with the button of the X-axis??

Thanks…


October 1, 2009 | 1:08 pm

Can anyone tell me about a detail tutorial about controllers?

Thanks.!!


October 1, 2009 | 4:01 pm

Not sure how you want to control a slider (a range of values) with a button (one value)…? If you want it to rise or fall slowly while the button is pressed, a bit of logic and some [line] objects will do that:

button –> sel # (whatever the button # is)
to toggle (flips with bang)
sel 0 1 –> 0 makes it go down, 1 makes it go up, via [line]
There’s probably a "button off" code too, using the same button # and outputs a 1 rather than a 0. So you can use [route] for the two-element list and use the 0 or 1 that comes out to determine what the slider does.


October 7, 2009 | 5:20 pm

Hello again,

Here is a better explanation about what i want to do..
I have a slider with a range of values 100, and i have a gamepad, and i want to use two buttons of it so i can go from the one side of the slider to the other slowly, value by value, what i want to say is when i press and hold the button with the value for example 3 i want the slider start going from 0 to 100 and the reverse when i press the button with the value 4 start abstract from 100 to 0..
can anyone explain how can i do this??

Thanks again..


October 8, 2009 | 10:16 am

As always, there are many ways to do it…
You can use [metro] and [accum] to periodically increase or
decrease a value. Then you can simply route the [hi] list to
switch the metros on/off.

like this, for example:

– Pasted Max Patch, click to expand. –

October 13, 2009 | 4:01 pm

Thanks for the answer mudang, i have also a second question for controlling, i have a gswitch2 object and i would like to know if its possible to control it with one button of a gamepad, that is to say is when i press the button the gswitch2 change the output, but when i leave the button it comes back to its first situation because the output of the button again becomes 0, its possible somehow this not to be happen..???


October 13, 2009 | 6:07 pm

yep, sure. that’s easy:

[route 4] (controller number)
|
[sel 1] (only let 1 thru, ignore 0)
|
[gswitch2]

PS: you might want to check out the max tutorials, that come with max Wink


October 13, 2009 | 11:06 pm

Thats works perfect thanks, but i have a question that might be stupid, the gswitch2 object it goes to right when it receives an 1 and to the left when it receives an 0, here we only let an 1 to pass, so how it goes from the one state to another?


October 13, 2009 | 11:20 pm

The [select] object sends out a "bang" when the input matches the argument and this toggles the switch between open and closed, because you’re only sending this message on a "1" from your controller it works, you ignore all the 0s it sends when you release the button. I hope that explains things a bit better.

lh


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