-
-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Gamepad module #1223
base: main
Are you sure you want to change the base?
Add Gamepad module #1223
Conversation
this is super cool, I have to test this. I especially like that you can do sequences! |
Thanks! I’m glad you liked the key sequences. |
is this ready for merge? we can test the controllers when its live i guess |
currently testing it with my snes gamepad. only the blue (X) buttons seems to work, not sure why. can test more later. I also wonder why we need to poll the gamepads in an animationframe? could we only poll it inside the signal? it might save some work. i can try to do that if you also think it's worth trying |
The code I referenced was mostly related to p5.js (and game related), which is why it’s polling against the animation frame. But yeah, for Strudel, it makes more sense to handle the polling inside the signal. That might also be connected to the fact that some button signals were only recognized after adding .segment().
|
- Replace requestAnimationFrame polling with signal - individual signals for buttons and axes from baseSignal - Remove window message-based gamepad state handling for toggleButtons - Add module-level state storage to keep button state across strudel code update
i've tested again, this time all buttons seem to work as expected! I've changed the docs a bit to use mask instead of gain, which makes things more clearer + more performant, as they are not played when inactive. |
in theory, buttonMap would need to be configurable, for example, my controller doesnt match the naming, e.g. x = b etc. not sure if we need this in this PR yet |
Adds gamepad support for Strudel, allowing users to use game controllers as expressive input devices for live coding music.
Examples
Testing Done