Xbox 360 controller and hi object – problem with triggers

Oct 31, 2012 at 12:50pm

Xbox 360 controller and hi object – problem with triggers

Hi,

Im trying to hook up the 360 controller to Max and send OSC messages to a audio engine called wwise. The connection works well, but I have a problem with the data comming from the triggers on the back of the controllers.

When I press the right trigger it sends the message “8″ with a value from 32767 to 127. When I press the left trigger it sends the same message “8″ but with values going from 32767 to 65407.

Right now I just look at the number and if its bigger than the initial value 32767 I know that the left trigger is pressed and if its smaller the right trigger is pressed. But how am I supposed to know if both are being pressed simultaneously?

This might be a problem with the hi device not being fully compatible with the controller, or maybe Im missing something..

Any help would be very appreciated.

This is the patch im working on:

– Pasted Max Patch, click to expand. –
#65016
Jul 28, 2013 at 2:28pm

It’s a Windows driver problem. The Mac driver reads both triggers as separate elements, but with PC we have the problem of them being the same element.

I’m working on porting my Mac Xbox patch to PC, so I just ran into this issue recently. Have you been able to find a work-around?

#257389
Jul 29, 2013 at 3:23am

Hi!

No, unfortunately I never found a solution for this problem. So this is caused by the windows driver I guess?

#257426
Jul 29, 2013 at 7:55am

That’s a bummer. The windows driver combine the two triggers as one element, the Z-axis. It’s odd, but apparently that’s how it is for Xbox too. The hardware itself reads it as two separate elements, that’s how the fan-made driver for Mac was able to separate the two.

I guess when programming the controller to work with games there’s always some kind of work around. I don’t know if it’ll work in Max, but if I find a solution I’ll post it here!

These two threads helped me come to this realization:

http://answers.unity3d.com/questions/145763/xbox-360-pressing-both-triggers-simultaneously.html

http://forum.unity3d.com/threads/40542-Need-Help-Xbox-360-PC-controller-Triggers

Let me know if you’re able to find some kind of solution.

#257462
Jul 29, 2013 at 8:47am

edit:

give me ten minutes . . .

#257484
Jul 29, 2013 at 9:38am

Ok, more like twenty minutes :)
The solution assumes that your incoming data is formatted as follows:

“8 leftTrigVals”
“8 rightTrigVals”
….etc

The challenge is to remove unwanted data and to identify and tag wanted data. If the two separate streams are coming in as one combined then, this may not be what you seek and I will need more time. . . .
HTH:

<code>

– Pasted Max Patch, click to expand. –

</code>

Brendan

#257493
Aug 2, 2013 at 8:47am

Brendan,

I tested out your patch by adding it to mine. It works a lot better than what I had for the triggers and it’s a good enough work-around for now, but I was wondering if there is anyway that the data values could be sent more smoothly. They seem to jump over some values as the triggers are pressed down. Also, pressing both of the triggers at the same time kind of works now, but every so often their values jump back down to zero.

I really appreciate that you took the time to write out this patch. Again, it’s a good work-around and I’m satisfied for now. Let me know if you’re able to make it more smooth. I’ll be testing it more too. Thanks!

#257866
Aug 2, 2013 at 9:25am

Hi
If you’re getting what sounds like foldover behaviour, use the zmap or scale plus clip objects. As for smoothing, type that word into the forum search box for a universe of solutions

Brendan

#257869
Aug 2, 2013 at 11:46am

Thanks, Brendan! I appreciate your help!

#257879

You must be logged in to reply to this topic.