USB HID Joysticks and Gamepads
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
USB HID Joysticks and Gamepads
Hi, just found out about audacity and I love the program. I'd like to use a USB HID Joystick or Gamepad to control Audacity. For example, I'd like to program buttons for "play", "record" and "play loop", perhaps the direction pad for increasing or decreasing the selection for the current track. I know that I can perhaps bind the USB joystick to keyboard keys, but I'd like to do this natively so that the command is sent to audacity regardless of which program is selected?
For example, if I'm using audacity, but my currently selected program is an internet browser, if I press the space bar, the input is sent to the internet browser, not to audacity. I'd like for the USB joystick/gamepad controller to be bound to the focus of the audacity program.
Is this possible and where would I find resources/documentation to get started?
Thanks,
-J
For example, if I'm using audacity, but my currently selected program is an internet browser, if I press the space bar, the input is sent to the internet browser, not to audacity. I'd like for the USB joystick/gamepad controller to be bound to the focus of the audacity program.
Is this possible and where would I find resources/documentation to get started?
Thanks,
-J
Re: USB HID Joysticks and Gamepads
Audacity has no built in support for joysticks or gamepads but it does have comprehensive support for keyboard control: http://manual.audacityteam.org/o/man/ke ... ences.html
I think that you would need to bind your HID to keyboard keys and/or mouse. See your HID documentation for this.
I think that you would need to bind your HID to keyboard keys and/or mouse. See your HID documentation for this.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: USB HID Joysticks and Gamepads
Can this be a feature that can be added in the future or something that can be done through a plugin? I don't mind write one if this functionality is possible.
Thanks,
-J
Thanks,
-J
Re: USB HID Joysticks and Gamepads
I'd like to contribute anyway I can. My background is in embedded hardware and software design and I have designed several USB devices. My website is at http://www.engscope.com, with some of the projects that I've created. I discovered audacity while trying to improve my guitar playing. The goal is to make a device that can control audacity's selection cursor, loop, play and record. These are very common controls for guitar pedals. I'd like to build a USB device that does all these things exclusively for audacity. I can make the hardware portion of the project as it is the area of my expertise, but I don't even know if this is possible within audacity. Of course, binding this to audacity's keyboard shortcuts is very easy to do, but I'd like to do this through a joystick drivers (such as hid.dll on Windows). This will of course allow you to record/play/loop even while looking at tabs or other reference material.
If this can be done with a plugin, or if some programming is required on the open source itself, I'd definitely would love to contribute.
Thanks,
-J
If this can be done with a plugin, or if some programming is required on the open source itself, I'd definitely would love to contribute.
Thanks,
-J
Re: USB HID Joysticks and Gamepads
I'm not a programmer, but I would think that it may be possible to add HID support with a "module".
Have a look here: http://wiki.audacityteam.org/wiki/Gui_Plug-ins
In particular, have a look at mod-script-pipe http://manual.audacityteam.org/index.ph ... =Scripting
You will also find developer resources here:
http://wiki.audacityteam.org/wiki/Developer_Guide
and
http://wiki.audacityteam.org/wiki/Categ ... Developers
You may also like to register on the developers mailing list so that you are "in the loop" for current development issues: http://audacityteam.org/community/developers
Have a look here: http://wiki.audacityteam.org/wiki/Gui_Plug-ins
In particular, have a look at mod-script-pipe http://manual.audacityteam.org/index.ph ... =Scripting
You will also find developer resources here:
http://wiki.audacityteam.org/wiki/Developer_Guide
and
http://wiki.audacityteam.org/wiki/Categ ... Developers
You may also like to register on the developers mailing list so that you are "in the loop" for current development issues: http://audacityteam.org/community/developers
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
-
Gale Andrews
- Quality Assurance
- Posts: 41761
- Joined: Fri Jul 27, 2007 12:02 am
- Operating System: Windows 10
Re: USB HID Joysticks and Gamepads
So the idea is that when Audacity is running, you can use any standard USB HID but it will only talk to Audacity? Or that the user must use your HID, which does nothing unless Audacity is running?
It seems to me we are not at the first step yet, which would be for Audacity to work with standards- based HID's when it has focus. The current solution to that lack of support is of course to map keystrokes on the device using third-party software, or use an expensive DAW pedal like http://www.xtempozone.com/uses/#stage .
Would you want to write a patch that helps with the "first step"? If we achieve the first step, is another more extensible solution for Audacity to support global shortcuts (that work whatever app has focus) and keyboard media keys?
We know already that wxwidgets (the GUI toolkit that Audacity uses) only supports global shortcuts in Windows. Cross-platform issues might make your original idea difficult too. Do you have experience on Mac or Linux?
Thanks
Gale
It seems to me we are not at the first step yet, which would be for Audacity to work with standards- based HID's when it has focus. The current solution to that lack of support is of course to map keystrokes on the device using third-party software, or use an expensive DAW pedal like http://www.xtempozone.com/uses/#stage .
Would you want to write a patch that helps with the "first step"? If we achieve the first step, is another more extensible solution for Audacity to support global shortcuts (that work whatever app has focus) and keyboard media keys?
We know already that wxwidgets (the GUI toolkit that Audacity uses) only supports global shortcuts in Windows. Cross-platform issues might make your original idea difficult too. Do you have experience on Mac or Linux?
Thanks
Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
Re: USB HID Joysticks and Gamepads
I've done projects on Windows mostly and some Linux, I unfortunately do not own a MAC machine. My priority would be to have this work on a Windows machine, though if it works on Linux, that would be a plus.
I can definitely look into creating a plugin that can bind HID buttons to Audacity functions. The focus issue would be nice to have, but it would be a low priority. I'd love to help, but documentation is a little scarce.
From a software perspective, the HID API can be accessed on Windows through hid.dll and on Linux through input.h. However, I wouldn't even know where to start to invoke the functions in Audacity. If you can point to the direction for anything helpful, that would be great (especially an example). It seems like you have already pointed out that wxwidgets is the way to go as far as accessing functions within Audacity through a plugin. Is there an example of a plugin project that shows how functions are accessed? All I can find on the wiki is http://wiki.audacityteam.org/wiki/Developing_On_Windows and some very scarce information about wxwidget (something about wxwidget still a proof-of-concept, source: http://wiki.audacityteam.org/wiki/Creat ... ts_Plug-In).
Thanks,
-Jianyi
I can definitely look into creating a plugin that can bind HID buttons to Audacity functions. The focus issue would be nice to have, but it would be a low priority. I'd love to help, but documentation is a little scarce.
From a software perspective, the HID API can be accessed on Windows through hid.dll and on Linux through input.h. However, I wouldn't even know where to start to invoke the functions in Audacity. If you can point to the direction for anything helpful, that would be great (especially an example). It seems like you have already pointed out that wxwidgets is the way to go as far as accessing functions within Audacity through a plugin. Is there an example of a plugin project that shows how functions are accessed? All I can find on the wiki is http://wiki.audacityteam.org/wiki/Developing_On_Windows and some very scarce information about wxwidget (something about wxwidget still a proof-of-concept, source: http://wiki.audacityteam.org/wiki/Creat ... ts_Plug-In).
Thanks,
-Jianyi
Re: USB HID Joysticks and Gamepads
Did you look at mod-script-pipe?jliu83 wrote: Is there an example of a plugin project that shows how functions are accessed?
The source code is in /lib-src/mod-script-pipe/
The full Audacity source code is available from svn: http://code.google.com/p/audacity/source/checkout
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
-
Gale Andrews
- Quality Assurance
- Posts: 41761
- Joined: Fri Jul 27, 2007 12:02 am
- Operating System: Windows 10
Re: USB HID Joysticks and Gamepads
I think the more generally applicable you can make your solution, the more chance the Audacity developers would be interested.
Have you looked at other open source media programs to see what solutions they have adopted?
Gale
Have you looked at other open source media programs to see what solutions they have adopted?
Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
Re: USB HID Joysticks and Gamepads
Currently looking at the AutoHotKey program to send commands when Audacity is not in focus. It seems like Audacity ignores all keys or commands sent to it if the focus is not on the program. Is this an intentional behavior or is this due to wxWidgets? I have not yet looked at the source code yet, however, AutoHotKey covers just about every possible binding possible so if it can be made to work with Audacity, that would save a ton of programming.
Thanks,
-J
Thanks,
-J