{"id":21521073,"url":"https://github.com/weisjohn/guitar-controller","last_synced_at":"2025-04-09T22:21:41.571Z","repository":{"id":19899546,"uuid":"23164673","full_name":"weisjohn/guitar-controller","owner":"weisjohn","description":"Interface to a Guitar Hero USB controller.","archived":false,"fork":false,"pushed_at":"2021-06-14T18:44:30.000Z","size":45,"stargazers_count":9,"open_issues_count":6,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T00:15:03.776Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/weisjohn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-20T21:21:17.000Z","updated_at":"2024-06-22T02:57:32.000Z","dependencies_parsed_at":"2022-08-26T22:00:31.150Z","dependency_job_id":null,"html_url":"https://github.com/weisjohn/guitar-controller","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weisjohn%2Fguitar-controller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weisjohn%2Fguitar-controller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weisjohn%2Fguitar-controller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weisjohn%2Fguitar-controller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/weisjohn","download_url":"https://codeload.github.com/weisjohn/guitar-controller/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248120236,"owners_count":21050913,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-24T01:05:40.079Z","updated_at":"2025-04-09T22:21:41.539Z","avatar_url":"https://github.com/weisjohn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"guitar-controller\n==============\n\nInterface to a\n[Guitar Hero controller](http://www.amazon.com/Guitar-Hero-2-Controller-Xbox-360/dp/B000NUIYK0/ref=sr_1_1?s=videogames\u0026ie=UTF8\u0026qid=1408563315\u0026sr=1-1\u0026keywords=guitar+hero+controller+usb).\n\n### usage\n\n```\nvar controllers = require('guitar-controller')();\nvar player1 = controllers[0];\n\nplayer1.on('green.press', function() {\n    console.log('green was pressed');\n});\n\nplayer1.on('green.release', function() {\n    console.log('green was released');\n});\n```\n\nSee the [example.js](example.js) file for more detailed usage.\n\n### API\n\n##### Buttons:\n\nThe controller has the following buttons:\n\n - green\n - red\n - yellow\n - blue\n - orange\n - start\n - back\n - up\n - down\n - left\n - right\n - xbox\n\nFor each button, a `press` and `release` event exist:\n\n - `green.press`\n - `green.release`\n - `red.press`\n - `red.release`\n - `yellow.press`\n - `yellow.release`\n - `blue.press`\n - `blue.release`\n - `orange.press`\n - `orange.release`\n - `start.press`\n - `start.release`\n - `back.press`\n - `back.release`\n - `up.press`\n - `up.release`\n - `down.press`\n - `down.release`\n - `left.press`\n - `left.release`\n - `right.press`\n - `right.release`\n - `xbox.press`\n - `xbox.release`\n\n\n##### Ranges:\n\n - `x`\n - `y`\n - `whammy`\n\nRange events receive a value. For example:\n\n```javascript\nplayer1.on('x', function(val) {\n    console.log(val);\n});\n```\n\n### examples\n\n1. Plug in the guitar's USB cable.\n2. `node [script]` to test scripts in [examples](./examples) folder.\n3. Click buttons on your remote and commence mad science.\n\n\n### sample\n\nHere'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).\n\n\u003cvideo class=\"_c8hkj\" poster=\"https://scontent-iad3-1.cdninstagram.com/t51.2885-15/e15/10611027_733367740062756_306429960_n.jpg?ig_cache_key=NzkxNDgxNDIwNzgzMTM1MDA5.2\" src=\"https://scontent-iad3-1.cdninstagram.com/t50.2886-16/10627084_716851585030335_697839434_n.mp4\" type=\"video/mp4\" autoplay controls\u003e\u003c/video\u003e\n\n### contribution\n\nIf 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.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweisjohn%2Fguitar-controller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweisjohn%2Fguitar-controller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweisjohn%2Fguitar-controller/lists"}