Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/weisjohn/guitar-controller
Interface to a Guitar Hero USB controller.
https://github.com/weisjohn/guitar-controller
Last synced: about 2 months ago
JSON representation
Interface to a Guitar Hero USB controller.
- Host: GitHub
- URL: https://github.com/weisjohn/guitar-controller
- Owner: weisjohn
- License: mit
- Created: 2014-08-20T21:21:17.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2021-06-14T18:44:30.000Z (over 3 years ago)
- Last Synced: 2024-11-18T10:58:56.089Z (about 2 months ago)
- Language: JavaScript
- Size: 43.9 KB
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
guitar-controller
==============Interface to a
[Guitar Hero controller](http://www.amazon.com/Guitar-Hero-2-Controller-Xbox-360/dp/B000NUIYK0/ref=sr_1_1?s=videogames&ie=UTF8&qid=1408563315&sr=1-1&keywords=guitar+hero+controller+usb).### usage
```
var controllers = require('guitar-controller')();
var player1 = controllers[0];player1.on('green.press', function() {
console.log('green was pressed');
});player1.on('green.release', function() {
console.log('green was released');
});
```See the [example.js](example.js) file for more detailed usage.
### API
##### Buttons:
The controller has the following buttons:
- green
- red
- yellow
- blue
- orange
- start
- back
- up
- down
- left
- right
- xboxFor each button, a `press` and `release` event exist:
- `green.press`
- `green.release`
- `red.press`
- `red.release`
- `yellow.press`
- `yellow.release`
- `blue.press`
- `blue.release`
- `orange.press`
- `orange.release`
- `start.press`
- `start.release`
- `back.press`
- `back.release`
- `up.press`
- `up.release`
- `down.press`
- `down.release`
- `left.press`
- `left.release`
- `right.press`
- `right.release`
- `xbox.press`
- `xbox.release`##### Ranges:
- `x`
- `y`
- `whammy`Range events receive a value. For example:
```javascript
player1.on('x', function(val) {
console.log(val);
});
```### examples
1. Plug in the guitar's USB cable.
2. `node [script]` to test scripts in [examples](./examples) folder.
3. Click buttons on your remote and commence mad science.### sample
Here's a [sample integration with baudio](https://www.instagram.com/p/r76CikGakh/). (NOTE: the lag is from spawning a child-process, not from the driver).
### contribution
If you have a Guitar Hero controller that isn't supported, plug your controller in and run [examples/explorer.js](./examples/explorer.js). Create an issue and paste in the console results. Pull requests welcome.