I'm trying to create an instrument using my game controller, and i have a simple problem. I need the buttons to switch things on and off when i press them, but of course it sends one signal when pressed and another when released. I know there's a way around this, but I'm quite new to PD and I don't know how. If someone could help I'd really appreciate it. Thanks!
-
Hid controllers?
-
you could probably use [select]
-
Yes,
If they are simple boolean operators, there will be 2 values being sent. 1 = on 0 = off.
[select 1] will do something when 1 (on) is triggered. and ignore the off (0) value But it will only be able to do that one thing.
If you want to turn that button into an on/off toggle you need to have [select 1] bang into a X[+1] which is fed into a [% 2]. Now a tap of the button adds 1 to a counter and the modulus object splits between odd and even numbers, thus giving you two trigger-able states (0 and 1 or on and off!)
Dual 1.8 IBM G5: Mac OSX 10.4.11 -- Asus eeePC 701: Pure:Dyne / eeeXubuntu GNU/Linux -- myspace.com/thearifd
-
I made an HID object for a joypad, want me to post it, or do you wanna DIY?
-
thanks for all your help guys! i'll try these things out. and yeah, nestor, i'd love to take a look at yours. i do want to build my own, but i could learn alot by looking at others.