I decided to write this post just to tie together some of my experiences of using game controllers of various sorts to make music.
Generic USB controllers like these are generally pretty easy to use:
Since computers come with USB ports on them, it’s usually just a case of plug them in and get going. There are lots of them about and they can be picked up cheaply on eBay and Gumtree or from local charity shops.
The main consideration is what program to use which can interpret the signals the controller is sending out and allow you to use those signals for your own purposes. There are many of these, ranging from simple apps to tweak the operation of a particular device, to large and complex programs designed to customise a device’s every action to the user’s requirements.
This is made possible by the existence of the ‘HID’ standard for USB devices. HID = ‘Human Interface Device’, a description which can be used to cover devices such as computer keyboards, mice, game controllers, joysticks, and the like – all the things which humans use to interact with computers. As long as the device is made to conform to the standard – and manufacturers have readily got used to the idea of doing so – these programs can interpret the input and make it available to be changed to a different input; to perform an action completely unrelated to the device’s original purpose; or send data to another program which can use it creatively.
Multicontrol has the ability to interpret the game controller’s signals and pass them on in the form of MIDI messages, or OSC (Open Sound Control). Designed by Alexander Refsum Jensenius, it’s distributed free for Mac OS. There is a source file downloadable from the site referenced above, although I have no idea if this can be compiled for Windows PC’s.
I’ve also used a commercial program, ControllerMate, which enables very sophisticated interpretation of controller signals. This allows not only for simple button ‘mapping’, where you specify, for example, keystrokes for each controller button, but also, with this window you can build up complicated series of events, initiated by a button press.:
The small drop-down list to the right indicates the wide variety of actions that can be incorporated into the instructions for each button or other control.
The list in the left-hand column indicates a couple of devices which I’ve made customised groups of special controls for: once you’ve set the controls up, you can save them and call them up by name. It’s possible in this way to have several different set-ups for the same device, depending on what you want to use it for at different times.
My favourite program is PureData, or Pd for short. Using Pd means you have to write the programs yourself – but this is done graphically, rather in the manner of flow-charts, rather than by writing lines of code, and the program is specifically designed for making music, so it has typical audio and MIDI functions (Pd calls them ‘objects’) ready to use.
I’ve used Pd both for creating instruments, like the Theresynth, which uses the PCLine Rumble Pad pictured above, and for sound and sample manipulation. The blog post for the Theresynth (which uses one of the joysticks on the controller for changing pitch in a way reminiscent of a theremin), also has quite a detailed description of the Pd programming. I’ve also blogged about various sound manipulation apps (or ‘patches’) in the past, including the StyloSim, which uses the joystick controller pictured above, and the Black Widow.
The StyloSim patch isn’t very extensive, and looks like this:
The small box with ‘hid’ in it, near the top right-hand corner, is the Pd object which recognises input in the HID standard; the ‘route’ objects below split up the different inputs, and then you can send them off to do whatever you need them to do – control oscillators or filters, perform mathematical functions, create MIDI messages, and so on.
While on the subject of software, a handy piece of freeware which I often use is Joystick and Gamepad Tester from AlphaOmega Software. AlphaOmega produce a number of simple but ingenious apps which help you with your Mac, including an app which cuts out that annoying ‘chime’ when the computer opens (my car doesn’t sing at me when I turn the ignition, my hi-fi stays silent until I put in a CD, my TV remains mute until I select a channel – why on earth do computer manufacturers think we want to hear the machine start up! One of life’s unexplained mysteries . . .), but also some apps which can have a value in computer music. I may well have blogged about some others elsewhere.
The purpose of Joystick and Gamepad Tester is to tell you what controls your USB device has, and if they are devices like joysticks, what are the minimum and maximum readings you can get from them: 0 – 127, 127 – 255, etc.
I recently bought a game controller like this from a charity shop:
It looked as if it was originally part of a quiz game, and had a USB connector, so it looked as if it would be easy to use with the computer.
I took it home, plugged it in and started up Joystick and Gamepad Tester.
The instructions say to press all the buttons and move joysticks and other controls so they’re recognised. but when I clicked ‘OK’ on the screen above, I saw this:
I found out first of all what the device was – a ‘Logitech Buzz Controller V1’ – and was able to select it from the drop down list. Note by the way that all the normal USB-connected devices are also listed: in my case, there’s the laptop keyboard, the infrared receiver on the front and the trackpad.
The Apple IR Remote – listed in the screenshot above as ‘IR Receiver’ – isn’t exactly a game controller, and isn’t exactly an HID device like the others discussed here, but it’s worth a brief digression as its uses are very much the same.
As far as Joystick and Gamepad Tester is concerned, nothing was listed when I selected ‘IR Receiver’ or registered when I pressed buttons on any of my Apple remotes – only when I selected one of the two entries ‘IOSPIRIT IR Receiver Emulation’. I don’t know why there are two entries, but they’re identical and are the result of installing either the app Remote Buddy, or its free driver Candelair – or very probably both – as I’ve been working on using Apple Remotes recently (see blogposts, starting here).
A useful feature of Joystick and Gamepad Tester in this respect was that it showed the remote’s individual ID No. in the ‘Now’ column. (The ID numbers in the ‘Min’ and ‘Max’ columns are irrelevant, as they will just show the highest and lowest Remote ID numbers used in the past). Just picking up a remote and pressing a button will change the now column to verify the number.
When I selected ‘Logitech Buzz Controller V1’, all the controls were already listed:
There are 5 buttons on each of the controls, and the list suggests that they are unique – that’s quite a decent number of buttons for a game controller, so that could be handy in some situations. Buttons usually show up with a minimum and maximum of ‘0’, so it was quite interesting see that 4 of them with a different reading in ‘Max’: perhaps these were the big red buttons, one on each handset?
Actually, there weren’t: as you go round the buttons pressing them, you can see exactly which is which – the value appears in the ‘Now’ column: ‘1’ for pressed, ‘0’ for not pressed, which is typical for buttons, so by the time you’ve finished, they all have ‘0’ in the ‘Min’ column and ‘1’ in the ‘Max’ column. If you’re intending to modify the controller you’re testing by taking it out of its case and fixing new buttons to it, this is very useful because you can make a note at this point of which one is which.
Better still, if you click the ‘Save’ button – indicated by the arrow on the screenshot above – you can save the list as a text file, print it out and make your notes on that.
First you’re given the usual ‘Save’ options:
Then Joystick and Gamepad Tester confirms that the text file has been saved and it’s safe to quit or begin testing another device.
I was impatient and clicked ‘Save’ before testing all the buttons, so the text file shows an incomplete test – I haven’t verified yet that each of the buttons gives a maximum ‘1’ when pressed and goes back to a minimum ‘0’ when released.
I was intrigued by the two entries at the bottom for ‘X-Axis’ and ‘Y-Axis’. I studied the device carefully, and could find no control on it which resembled a joystick, which is what an entry like this would be for: data from these sources wouldn’t just be a ‘0’ or ‘1’, but a number moving from perhaps as low as -255 to +255. I’m assuming this indicated that the chip used in the device is capable of supporting a joystick, but this hasn’t been implemented. Perhaps, if one knew how, one could hack the PCB which controls the buttons and add this capability.
There are two things worth mentioning about HID devices at this point. The first is that, provided you leave the USB output leads intact, you can remove the circuit board from the original case, solder your own buttons and potentiometers to it and it will still be recognised as the same device by the computer. This was the theory tested by the Cybersynth, which is basically a Theresynth, as described above, with the PCB removed from the Rumble Pad and put into a completely different case. It doesn’t look like it any more, but the computer still thinks it’s a game controller.
In fact, you can also do this with an old computer keyboard. It’s possible to remove the PCB from these, work out which connections make which letters and wire these connections to your own buttons or switches. I did this with the board from inside an old Apple keyboard (as described here):
It was very cheap, having been scrapped as being broken, but what was wrong with it was nothing to do with the electronics. I took the board out, rewired it, and use it for controlling a looping program.
You may be able to tell from this picture – although the scale isn’t particularly evident – that the PCB inside this particular brand of keyboard is ridiculously large. You could undoubtedly find a make with a much smaller board which would be more practical.
As it happens, I’m using this particular board for an application which requires letters as an input, and no remapping – i.e. ‘A’ is ‘A’, ‘B’ is ‘B’ and so on. However, since the keyboard is an HID device, using one of the programs above, you could change the functions of the buttons and have a very large number of different control buttons available: the equivalent of 26 letters, 10 numbers, numerous punctuation keys; and programs will normally distinguish between lower and upper case letters, increasing the total number of controls even further.
The second thing to mention is that there are many PCBs on the market with circuitry on them to output HID standard signals, and allowing you to attach your own combinations of buttons, switches, knobs and joysticks. People who make their own arcade games like them, so this is where you’re likely to come across them (on sites like this, for example).
Some of these are relatively inexpensive. I got this one, which can encode 12 buttons and 2 joysticks for £8.00, complete with connecting leads for the buttons, joysticks and USB:
You have a free choice of what kind of buttons to attach, and using a board like this is easier than extracting and rewiring an existing game controller board
As for other types of controller: there are many. This one by Nyko for Playstation – which I have in the collection, but haven’t worked on yet – combines the traditional game controller with a QWERTY keyboard:
This one, the Airpad, is interesting because it contains a tilt mechanism which enables control by tipping the device up:
You may notice something odd about the above two controllers – the funny connectors on the end. Your computer probably doesn’t have sockets that shape. This is no problem, though, as Playstation to USB adapters are easy to come by and not expensive. This one cost less than £2:
It’s also possible to find extenders and hubs for Playstation devices, and these don’t usually cost much second-hand on eBay:
Using PS3 (wireless) controllers is also perfectly possible. There are drivers for Windows; later versions of Mac OS (from 10.6 upwards, I believe: see here for further details) have drivers built in, using Bluetooth. Earlier versions of the Mac OS can work with a driver from Tattiebogle.
USB adapters also exist for XBox controllers, although replacing the proprietory connector with a USB plug doesn’t seem difficult, according to this illustrated article.
[Edit: unfortunately, both the sites I used for this information are unavailable now. I’ve left the link in case that site’s unavailability is temporary, and I have an image from the other one:
Once again, Tattiebogle provides a driver for wireless XBox controllers – although you’ll also need one of these wireless receivers:
Third-party receivers can cost as little as £5.
At the time of writing, the most advanced consumer-oriented controllers are the Nintendo wii and Microsoft’s Kinect. The wiimote controller is a hand-held device which uses accelerometers and infrared to detect position and motion in addition to control by button-presses; Kinect uses infrared, cameras and microphone to detect spoken commands as well as hand and body positions from a distance. I’ll be looking at musical uses of these two systems in the next post in this series.