Archive for the 'Software/MIDI' Category

06
Nov
13

Notes on game controllers

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:

Game Controller 3

StyloSim6sm

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.

I’ve used several of these for different purposes.  There’s Multicontrol, which I used for this MIDI Drum controller:

MultiControlDrums1

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.:

ControllerMate window

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:

StyloSim2

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:

Logitech Buzz

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.

JAGT 1

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:

JAGT 2

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:

JAGT 3

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:

JAGT 4

Then  Joystick and Gamepad Tester confirms that the text file has been saved and it’s safe to quit or begin testing another device.

JAGT 5

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.

JAGT 6

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.

Cybersynthsm

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):

Blueberry keyboardsm

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.

MIDI CPU insidesm

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:

Zero Delay Encoder Board Rev2 -2

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:

Nyko IMG_1668

This one, the Airpad, is interesting because it contains a tilt mechanism which enables control by tipping the device up:

Airpad IMG_1667

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:

PS Adapter IMG_1669

It’s also possible to find extenders and hubs for Playstation devices, and these don’t usually cost much second-hand on eBay:

Extension IMG_1255

Hub IMG_1561

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:

xboxcablemodpaintThis implies that the Xbox cables have wires using the standard USB colour-coding, so if the wire attached to your USB plug uses these standard colours, they can simply be attached like-for-like].

Once again, Tattiebogle provides a driver for wireless XBox controllers – although you’ll also need one of these wireless receivers:

wireless receiver2

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.

22
Oct
13

Fun with the Apple IR Remote, Part 2: Modifications

In the first part of this series of posts, I described the Apple infrared (IR) Remote system and some software which allows you to use the IR signals for controlling apps on the Mac.

In this post I take a closer look at the Remote controller itself, and describe the way I modified mine.

I must say that I’m not familiar with the silver aluminium remote, although I have no reason to believe it’s substantially different on the inside from the original white remote.  This is the one I have experience of.

What’s good about the white remote is also what’s bad about it – it’s very tiny.  This is great if you just want to tuck it away somewhere and not have a bulky TV/DVD player-type remote to lug about, but not so good from the point of view of it easily being overlooked or mislaid.

So, one reason you might want to modify the remote is to make it larger and more suitable for the human hand.

Frankly, the most cunning solution to his problem is the one described here by Brad Moon.  I hope he won’t mind me using his picture:

Remote wood block

Yes, what Brad has done is simply to glue his Apple remote to a hand-sized piece of wood.  Job done!  As he says in his blog post: ‘Too big to lose, too big to slip behind a cushion or slip into a pocket . . . The Apple TV remote hack has been in place for roughly a month.  In that time, the remote has been lost exactly zero times.’

This certainly takes care of the problem of the unit itself being rather small, but to address the problem of the size of the buttons themselves and their awkward layout, the unit has to be taken apart.  At the time of writing, you can still get hold of these white remotes on eBay for about £3, so if you want to try this, there’s no need to sacrifice the one that came with your Mac.

This is how it’s done:

1_IMG_1533

The picture above shows the unit and the tool (or maybe one of the two tools) you need to open the remote unit.  This is a small Philips or crosshead screwdriver.

As well as being used in a moment for taking out screws, the first thing you can do with it is poke the small depression on the right-hand side of the base of the remote unit.  This releases the battery tray, which pops out on a spring:

2_IMG_1534

Next, you have to undo a screw which is right down inside, next to the release button:

3_IMG_1536

Undo the screw and take it out:

4_IMG_1535

The next bit is the most difficult.  On the opposite side – the lower side in these pictures – is the spring which pushes the battery compartment out.  The spring is firmly attached to the bottom of a small piece of plastic, and you have somehow to grab this piece of plastic and pull it out, with the spring on the bottom of it.

The next picture shows what the spring and the plastic piece look like.  You might reach in and grab it with tweezers or narrow long-nosed pliers, but it’s right up against the edge of the case, and hard to get hold of:

6_IMG_1538

If you look at the full-size version of the picture, you can see that the piece of plastic has tags on it, so I was able to poke the screwdriver under a tag and drag the plastic and spring out.

Underneath where the spring was is another small screw.  Unscrew this and take it out:

7_IMG_1539

You can then pull the battery compartment out.  I did this with a pair of narrow pliers, gripping the white release button, which you can see in this photograph.

8_IMG_1540

Then you can push out the remaining parts left inside the case.  I did that by inserting the screwdriver here:

9_IMG_1541

The circuit board, with the springy battery connectors behind, slid out very easily:

10_IMG_1542

You can carefully detach the end  piece from the circuit board, clicking it off the tabs which hold it in place over the end of the board and the IR LED:

11_IMG_1543

This an exploded view of the remote, with all the parts visible:

11B_IMG_1547

Putting it back together, of course, is the reverse of this procedure.  The trickiest part is undoubtedly getting the spring and its plastic top back in.  This video by Andrew Williams, to which I’m greatly indebted: http://www.youtube.com/watch?v=vuP6CH770NM shows a remote being put back together, and explains the direction in which the tabs must face – front and back – for the plastic piece to go back in the correct position.

*

I wasn’t interested in putting it back together again, so I looked more closely at the circuit board:

12&13_IMG_1545&6

You can see in the top part of the picture the infra-red LED and the 6 buttons.  You can also see 4 screws which attach the circuit board the the plastic fitting.

The first thing to do was take off the six silver ‘domes’ which make the contacts when the buttons are pressed, and see what connections they made.  These are often, in my experience, attached together to a transparent sticky sheet which peels off, and so it was in this case.

Remote PCB IMG_1554

As you can see from this photograph – taken after I’d removed the four small screws holding the PCB to the plastic fitting – each button makes a contact between an outer ring and a centre spot.  All the outer rings were connected together, to what looked like +V, while the six centre spots were separate.  What I wanted to do was transplant the board into a larger unit, so I needed to solder seven wires to the board, and connect them to buttons in the new unit.

The larger unit I’d chosen was this one:

vtech_tinytouch_phone

This is a vtech Tiny Touch Phone: it’s powered by two AA batteries – 3v, same as the Apple Remote; has 12 buttons – exactly twice as many as the Remote, which could be handy for dissociating short, long or double presses; and has flashing lights – which is always good.  It also makes sounds, and under normal circumstances I would be looking to ‘bend’ these, but in this instance making noises wasn’t what the project was all about, so I decided I’d remove the sounds completely by taking out the speaker.

The Phone also has a hollow plastic ‘antenna’, which was perfectly placed for installing the IR LED.

aerial

This is what it looked like inside.  In  this picture the large mechanical unit, which looks like the film sprockets in an old 35mm film camera is obscuring the speaker housing.  With the speaker removed there looked as though there’d be plenty of room for the small Apple Remote PCB there.  The wires for the LED could easily pass from there up into the antenna.

Phone inside IMG_1552

The general idea would be to rewire the button connections on the Apple Remote PCB to the Tiny Touch Phone buttons.  The Phone buttons (visible in the first picture above) are, however, hollow, and make connections with a membrane, rather like  QWERTY keyboard, via their edges .

I wanted to leave the membrane intact, to operate the flashing lights, so I decided to add small tactile switches with longish 3.5mm actuators which would be glued in the hollows with the actuators sticking out through a hole in the top of the Tiny Touch buttons.  It was these switches which would actually operate the IR remote.

Gluing these in without gluing them together so they wouldn’t function proved difficult.  Letting superglue anywhere near them – even the gel type which I usually use – could prove fatal, as it has a habit of running everywhere.  In the end I used epoxy, which is stickier and less runny, and tiny pieces of tissue paper soaked in epoxy to keep the switches in place.  The moon and star buttons aren’t hollow, so I stuck tactile switches with short 1mm actuators to the top of them, on the outside, with wires running in through a small hole.

In the end I only connected up the star: it would have been difficult to make the hole in exactly the right place in the moon and route the wires inside without disturbing the membrane too much.  The star operates the ‘Menu’ button, which is less important than the others and doesn’t require more buttons to distinguish types of presses.

Buttons IMG_1550

In the event, all but one of the tactile switches worked after this treatment, which was OK, as there were two new buttons for each button on the original remote, so all functions would still be available.

To modify the new unit, I first removed the speaker and replaced it with a resistor (two 22Ω resistors in parallel, actually, as I had these lying about.  I didn’t have any 8Ω resistors to match the speaker, but 11Ω, I reasoned, was close enough).

This created enough space in the top of the unit for the small Apple remote PCB.

I reinstalled the buttons in their places and connected the tactile switches together.  One side of each switch was connected to +3v, the other sides of the switches were connected together in pairs (except the moon, as explained above).  This made 7 extra wires running down to the bottom of the unit.  The presence of the wires might have an effect on the operation of the TouchPhone’s original buttons, but this wasn’t important as their only function now was to light up LEDs when the remote was operated, a feature which Apple neglected to provide in the original.

Buttons_connector_IMG_1574

As can be  seen in the above picture, there was just about enough room for a 9-way D socket in the base of the unit.  I put this in partly because it would allow for external operation of the 6 remote buttons – perhaps by means of a footswitch – and partly because it provided a handy link point between the tactile switches and the Apple remote PCB.

To attach the remote PCB, wires were connected to the centres of the 6 switch points, and one of the outer rings, which were all connected together on the board.  3v and 0v power cables were connected to the springy metal pieces which formerly connected to the coin-battery in the original remote housing.  These connectors were shortened in order to fit the PCB neatly in the space where the speaker had been.

PCB_LED_IMG_1577

At the same time I detached the infrared LED and put it on the end of a longer lead, so it would reach to the front of the unit when in operation.

At this point everything was connected up, although not back in place, so I made a quick check, using iChat and the laptop camera in the way described before.  I pressed all the buttons in turn, pointed the unit at the camera, and watched for the infrared LED to come on.

When I was satisfied that it did so, I replaced the membrane and the TouchPhone PCB, as this would make pressing and testing the buttons a great deal easier.

*

For the next step I needed a way of thoroughly testing if the remote worked as intended.  I did this by creating a Tester program, using iRedLite.

It takes quite a few steps to create a ‘Layer’ – a set of instructions for each remote button – in iRedLite, but this is how I created a ‘Remote Tester’.

The ‘Menu’ button has special functions in iRedLite, but the other 5 buttons respond to short presses, long presses and double presses, so 15 separate instructions would be required.  What I decided to do was use Text Edit, and simply have it print the numbers 1 – 15, according to which remote button was activated.

Step 1 was to open iRedLite.  You can set it up in various ways in the preferences, but I have it set so it just opens an icon in the menu bar:

1 iredlite menu bar

The first step is to select the Editor from the drop-down menu:

2 Show editor

This brings up the Editor screen.  The top half of the window is a copy of what iRedLite calls the OnScreen Display (OSD).  The bottom half allows you to edit Layers and Buttons, and select the actions the buttons perform.  I began by creating a new Layer for my Text Edit actions:

3 New Layer

Then I entered the details of this Layer:

4 Name new layer

I typed a name for my Layer into the ‘Title’ box, and then made choices about what would happen when the Layer was selected.  I chose not to have the Layer activated when I switched to Text Edit, in case I wanted to type some text while using iRedLite with another application; but I did choose to have Text Edit activated when I switched to this Layer, because the actions all required text to be typed in it.  I have several remotes, so to be certain which remote was being tested, I set it to respond only to a particular one: in this case, the one with the ID No. 214.

Having finished creating the Layer, I clicked on the small arrow in the bottom right-hand corner of the Editor window.  I believe they call this the ‘Expert’ button, but it’s simply for accessing the section where actions are created and organised.

5 Editor window

Clicking this button opens the right-hand side of the Editor.  In here, if you look in the ‘Application’ column and can’t find the application you intend to use the remote with, click the ‘+’ button at the bottom of the column to add it to the list:

6 New Application

Type the application name in the box which appears.  The program will be recognised if its name is written the same as it would appear if you moved your mouse over it in the Dock.  Text Edit is actually written ‘TextEdit’, so that’s what I typed in the box:

7 Type New Application

Next you have to create a ‘Group’ – not for any special reason, I don’t think: it just works that way.  If you create a lot of actions for one particular application, this allows you to put different types of actions together, i.e. Keystrokes in one Group, AppleScripts in another, and so on.

I just wanted keystrokes, so I created a group called ‘Keys’.  Group names are your personal choice.  Once again, I clicked the ‘+’ sign under the ‘Groups’ column, and typed ‘Keys’ in the box which appeared.

8 New Group

Then it was time to create some actions.  Each action is entered individually, so I had to click on the ‘+’ sign at the bottom of the ‘Actions’ column 15 times, name the actions in the boxes which appeared, and specify what was to be done.

They were all more or less the same, and this is an example:

9 Create actions

Click the ‘+’ sign; name the action – again, this is entirely your choice: I just called them ‘1’ to ’15’; type the name of the application, or choose it if it appears in the drop-down list; check the box if you need the application to come to the front – which I did, because I wanted to read what it had printed; and type in what keystroke or keystrokes should be made.

Allocating the actions to the buttons is just a matter of dragging and dropping the action onto the appropriate button, and clicking ‘Assign Action’:

10 Drag and drop

The button will be given the name of the action – in this case ‘1’, which is the name I had given to the first action, which was to print the number 1.

11 Button number 1

You can rename the button, and I did, calling it ‘1/2’.  This is the reason why:

iRedLite shows the pattern of buttons in the way that it does to indicate that the button nearest the centre performs the short press action (which they call ‘Action on click’), while the button on the outside performs the double press action.  In reality, of course, these actions are performed by pressing exactly the same button on the remote, but it makes it clearer to see which number of presses produces which action.

So the ‘short press’ and the ‘double press’ are specified, but the ‘long press’ action (which they call ‘Action when holding’) remains to be allocated.

I decided to add the long press action to the instructions for the inner buttons, so in the example below I selected the appropriate inner button (Action 4, the ‘+’ button on the remote) and the ‘Advanced’ tab.  This allowed me to drag and drop the action I wanted to be performed as the long press action, printing the number ‘5’.

12 Button 4_5

I added a long press action to buttons 1 (the ‘Left’ button on the remote), 4 (the ‘+’ button), 7 (‘Right’), 10 (‘-‘) and 13 (the centre button) and renamed the buttons in iRedLite accordingly (‘1/2’, with ‘3’ being the double press action for that button on the remote; ‘4/5’, with ‘6’ as the double press, and so on).

When I’d finished, the set-up looked like this:

13 Finished

Note the button in the top right-hand corner,  marked ’15’.  There are 12 more places in the grey area of the button window where you can drag and drop actions, 6 on the left and 6 on the right.  If you drag and drop an action somewhere in the grey space, a new button will be created there.  This might come in handy if you had a modified control with differently positioned buttons.  In this case, I used one of the spare places for the double press action associated with the centre button.

Removing buttons, should this be necessary, is one of the functions on the drop-down menu where I chose ‘New Layer’ at the beginning.

I opened Text Edit and pressed all the buttons in order, single press first, then long press, then double press, hoping to see the numbers 1 to 15 displayed.  This what I saw:

14 Text Edit Numbers

The numbers were all printed out in order, so the combinations of short press, long press and double press all worked as predicted – but the long presses produced a continuous stream of outputs, even though I tried to take my finger off the button as quickly as possible.  The exception was the Centre button, which produced a single output of the number ’14’, no matter how long I held the button down.

This behaviour might not be what you require if, instead of printing numbers, you want a single specific action to be performed.  You might find the action repeated many times unless you’re able to take other steps to avoid this.

However, for testing purposes, this was fine, and I had established that the remote should, with iRedLite, be able to distinguish between 15 separate actions, despite only having 6 buttons.

*

The final stage of the project was to try out the new Tiny Touch Apple IR Remote to see if it would function correctly, using the iRedLite TextEdit Tester.

I quickly opened Joystick and Gamepad Tester to check the ID number of the new remote, which was 211.  I then opened iRedLite, went to the correct Layer for my Tester, and changed the remote number to which it would respond from 214 – the remote I had originally use to create the Layer – to 211.

The TouchPhone has a Power switch, but in fact the IR Remote worked even when it was in the ‘off’ position; in the ‘on’ position it worked with added lights.  As before, I pressed each button in turn with a short press, a long press and a double press, checking to see that the correct numbers were printed in Text Edit.

They were, so now it was safe to put the unit back together.  I glued the IR LED into the ‘antenna’:

top IMG_1580

fixed the 9-way socket in place:

bottom IMG_1584

and  wrote the ID number on the back.  Now I had the world’s most colourful Apple IR remote!  It could have been the world’s noisiest, had I not removed the speaker, but I felt this would be gilding the lily – and would probably have been a distraction, given that I had conceived of the remote as being part of a sound-modifying system, not a sound-producing system.

Alternative Remote

I was a little upset as, just as I was putting it back together, I broke the plastic link behind the ‘telephone’ button that mechanically ‘winds the film’ and changes the picture on the screen.  However, this only deprived me of more ways of turning LEDs on, and didn’t in any way affect the IR  controls, so ultimately I was satisfied with my achievement.  I didn’t want to spend more time on it at this stage as I wanted to move onto the next part of the IR project.

[Edit: I’ve since managed to get hold of another Tiny Touch Phone and replace the broken film winder, although I haven’t yet had time to change the tactile switch that got glued together].

For this, see Part 3: Additions.

07
Oct
13

Fun with the Apple IR Remote, Part 1: Making it work

This article, by and large, is for Mac owners, as it describes the Apple infra-red (IR) remote control system that’s been used on and off in Apple machines for about 7 or 8 years.  There is an article here which describes the remote being used on a Windows PC, and here on a Mac running Windows, but I imagine these are not common usages for this system.

In fact, I don’t believe the Apple IR system is well known at all amongst Mac users, and I hope this study will show that it can be more useful to music makers than was previously thought.

*

From about 2005, Apple began adding an infra-red remote capability to their machines, which came with an attractive little remote control like this:

Remote IMG_1519

It’s not clear from the picture, but if you haven’t seen one, it’s quite tiny – about 8cm by 3cm.  I’ll be returning to that point in Part 2.

The IR system began with the iMac G5 and quickly spread to the white Macbook, Macbook Pro and Mac Mini.  A slightly larger silver aluminium version of the remote came out in 2009, but also in that year Macbooks stopped being made with IR capability.  It remained as an option on the Macbook Pro, but the remote itself wasn’t being bundled with the laptop.

This is the silver remote.  Note that the ‘Play’ button has been moved from inside the ‘+’, ‘-‘, ‘Left’ and ‘Right’ buttons, and placed separately, to the right of the ‘Menu’ button.

Aluminium remote2 MC377

At the time of writing, the Mac Pro and Mac Mini seem to have built-in IR capability.  It’s difficult to keep track of what does what, however, as newer models of computer seem to be dropping this feature and users are being encouraged to use an iPhone app which does a similar job; but if it has one of these on the front:

IR Sensor IMG_1521

then it’s got IR built in.  The one area where the control seems to have remained popular is with the Apple TV/Home Theatre users.  There was an application called Front Row, which used the remote to control films and music, but I don’t believe this has been in use since OS 10.7.

All of this is a shame, as the ability to control your computer wirelessly can often come in handy, and several companies produce excellent software which greatly expands the ability of the Apple remote to control pretty well any application in any way you want.

Of course, if you have a Mac, then you very likely have the luxury of Bluetooth as well, and I have blogged, or will be blogging, about various uses of Bluetooth.  However, it could be that your Bluetooth system is fully occupied with, say, your wii controller, and this extra way of passing information to your computer becomes a vital necessity.

Although most of the following is based on my experience with my MacBook, which has IR built in, I’ll be speaking about things one might do to add IR capability to a non-IR Mac.

*

First of all, then, the controller and getting it to work:

There are three things to do to make sure your IR remote is potentially going to work.  The first is to ensure that the battery is OK; the second is to confirm that the infra-red LED is lighting up; and the third is to make sure the computer’s IR capability is turned on.

The remotes are powered by a CR2032 coin battery.  Apple designers, as we know, live in a world where bent paperclips are always to hand, so with the white remote – like the method of ejecting stuck CDs – there’s an indentation in the bottom of the case which can be poked with a bent paperclip to eject the battery tray.  In this case it isn’t inside a small hole, so a pen, pencil, or a 3.5mm headphone plug will also work perfectly well.

As illustrated, the silver remote has a different method: a battery compartment which is opened by twisting a small coin in it.

Battery change2

As for checking that the remote is functioning, the essential problem with this is that the light it gives off is infra-red, and therefore you can’t actually see it.

Fortunately, though, cameras can!  So if you have a laptop with a camera at the top here:

Camera IMG_1523

all you have to do it open something like iChat, go to Video > Video Preview and film yourself pointing the remote at the camera and pressing buttons.  If you can see a light like this:

Battery test

then the unit is working.

Finally, you just have to make sure the IR capability isn’t turned off.  Do this by opening System Preferences > Security, and look for this:

Security preferences2

Make sure the box isn’t checked and it says ‘The computer will work with any available remote’.

While on this subject, it’s worth noting that this might not be the situation you want.  If you’re in an environment where there are several remotes in use, you might want  your machine to respond only to yours.  Under these circumstances, the ability to ‘pair’ your remote and computer might be very useful.  Clicking this button:

Pair3

will enable you to do that (provided you’re logged in as an Administrator).

When you click it, it tells you how to do the pairing:

Pair2

Rather like a wii controller, you point the remote at the computer (but in this case it must be from just 3 or 4 inches away) and press the ‘Menu’ and ‘Next’ (‘Right’) button at the same time.  After a few moments (maybe 5 seconds), the following large icon will appear on the screen, with the ‘link’ sign flashing:

Pair icon IMG_1523

The remote and the computer are now paired; the ‘Pair’ button changes to an ‘Unpair’ button, and the text now says ‘This computer will work with only the paired remote’.

The process of unpairing them is simply a case of clicking that button:

Unpair2

Using the remote itself, you can unpair it by pressing ‘Menu and ‘Left’ at the same time, for about 5 seconds.

According to Apple, the remote works up to 9 meters (30 feet) from the receiver.  Unlike Bluetooth, of course, we’re talking about light here, so there can’t be anything in between the remote and the receiver that would block the signal – although you might be lucky and able to bounce the signal off a wall on on its way to the receiver.

*

So, now the remote is working, what can you do?

The answer is, not a lot.  You can use Front Row to watch films or listen to music, unless you have a modern operating system, 10.7 or later; you can remotely control iTunes, or you can make your computer go to sleep and wake up.  Not very practical for making music, which is, after all, what this blog is about.

[Edit: since writing the above, I’ve installed OS 10.6 and a newer version of the program VLC, from Videolan, an excellent free audio, but predominantly video, file player.  Some of VLC’s functions can be controlled with the Apple Remote, which is handy.  I don’t know if this can be done with earlier versions of Mac OS].

So, an important part of making the remote work would be to find some suitable software to interpret the input.

The first thing I looked into when I got my remote out of the cupboard and got it working was whether it would work with PureData (Pd).  Many types of HID (Human Interface Device) will act as musical instruments or effects devices – as I have described in the blog before – and so can the Apple IR Remote, although only to a limited extent.

I used a generic ‘HID Tester’ patch which I had created for investigating different devices, and determined first of all that the IR system was recognised by Pd – in this instance as Device 0:

Pd device no

I activated Device 0 and pressed all the buttons in turn, but this is all I got:

print desktop2

So unfortunately Pd was only able to recognise two of the buttons on the IR Remote, ‘+’ and ‘-‘.

*

This was of limited value, so I needed to see if there was any software which could expand the usefulness of the device.

Luckily, there was.  There are several programs, in fact, which can greatly extend the range of control  the Remote can give you.

Andreas Hegenberg’s BetterTouch Tool (BTT) has a section for the Apple Remote, although is generally more aimed at the Magic Mouse and trackpad

bettertouch2

Nowadays, in fact, Andreas seems to be concentrating on the amazing Leap Motion Controller, which is going to deserve its own blog page one of these days.

I wasn’t able to test out the BetterTouch Tool: it’s free, so there’d be no problem for you downloading it (from here, for example) and trying it out, but only supports OS 10.7.  There might be a legacy version still available for 10.6, but I couldn’t find one for 10.5, which I’m still using.

I did find a screencap, though, which shows that button presses are known as ‘Gestures’.  This is an example of the window in which button presses are assigned different actions:

BTT Gesture setting

*

Mira is a dedicated Apple Remote app which, when installed, is controlled from System Preferences.  The opening view shows the remote buttons in the centre: you click on each button to assign a function to it, which may be a keystroke, system action, or instruction open a program (including AppleScripts).

mira windows

Mira supports short presses and long presses, effectively doubling the number of actions available from the 6 buttons, and provides a number of combinations of short press/long press combinations.  A comprehensive Help menu is available by clicking the ‘?’ button in the bottom right-hand corner of the Mira window.

Duo Press_Help

Mira is available from Twisted Melon in versions for OS 10.4+ and 10.5+.  Also available, for the deprived Mac with no IR receiver, they offer the Manta TR1 plug-in USB IR receiver.  At the time of writing Mira costs $15.95 (Canadian) for single licence and $29.99 for 3 licences; the Manta TR1 costs $19.99; and a bundle of 1 Mira licence and a Manta costs $29.99.

*

Remote Buddy looked particularly promising as it also offered control of wide array of remotes, not just the Apple remote, but other makes from the likes of Griffin and Sony, iPhone and iPod Touch, and even Nintendo wiimotes.  OS 10.4.6 and above are supported.

Remote Buddy also installed its driver, Candelair (also available as a free stand-alone).

Configuring the remote’s buttons consists of specifying an application – although ‘Default’ and ‘Virtual Remote’ options are available – and defining a group of actions called ‘behaviours’.

Picture 2_2

There are appropriate suggestions for each application, and you can create your own Custom actions.  Like Mira, Remote Buddy supports short and long button presses and allows the same kinds of action choices; Help is available from the Remote Buddy menu.  It costs €19.99.

As a matter of fact, once I had installed Remote Buddy/Candelair, the following entries showed up in PureData:

Pd Remote Buddy_Candelair Devices2

Opening these device numbers, I was able to see two more actions displayed:

Pd long press l & r2

However, I wasn’t able to use these with the [Route] object, as one normally would.

Even if you don’t use Remote Buddy, I’d recommend installing Candelair, as I’ve encountered a number of instances like this where the presence of this alternative driver allows you to do things that can’t be done otherwise.  It can be controlled – even uninstalled – in System Preferences:

Candelair Screens

*

Undoubtedly, the be-all-and-end-all of infrared applications is iRed.  Designed to work with the iTrans infrared module – which transmits as well as receives  – this system can, in a nutshell, allow you to control your computer with any infrared control and allow your computer to control any device with an infrared receiver.

Possibly slightly extravagant for present purposes – and it doesn’t work with the standard Apple IR receiver, of course (which doesn’t transmit).  However, iRed Lite is much more the sort of thing I’m considering here.

In fact, for several reasons, this is the one I chose to use, partly because it’s free, partly because I liked the flexible onscreen display window, partly because it recognises short presses, long presses and double presses.

When opened, all that appears is an icon in the menu bar.  Clicking on this icon brings up a choice of actions, including opening the Onscreen Display or the Editor window.  This view of the Editor windows shows some of the important features:

Edit window

1.  This panel replicates the Onscreen Display.  The buttons are laid out here in the same format as the buttons on the remote.  The ‘extra’ button at the end of each row is for the ‘double-click’ action.

2.  This section, when the ‘Button’ tab is selected, allows for changing the style of the buttons.

3.  In this section the action performed by the button can be changed.

4.  This drop-down menu, as the name suggests, allows the settings for different Layers to be displayed.  A Layer is a collection of actions, usually applying to the same application.  When a Layer is active, the actions described in that layer are the ones which will be performed when the remote buttons are pressed.

5.  This drop-down menu gives access to more functions, such as remove selected button, create or remove a Layer and open the Character Palette for access to special characters and symbols.

6.  Clicking this arrow reveals or hides the sections on the right-hand side of  the picture in which more complex actions can be specified.

7.  Clicking on the ‘Add Action’ button allows actions to be specified which replicate keystrokes or mouse movements; a third possibility is to run an AppleScript.

8.  The special action is chosen in this area.  The picture shows a simple AppleScript to initiate an iTunes function.

Actions can be dragged and dropped onto the buttons in the panel on the left and different patterns of buttons can be created for ease of understanding or to match modified remotes.

*

Modified remotes is the subject of Part 2 of this series of posts, but before we leave the topic of software, I must just mention a small command-line app which runs from the Terminal.  I haven’t yet worked out if this is potentially useful or not yet, but it’s called iremoted and ‘listens for button-press events and prints the identifier (the HID element cookie, to be precise) of the button in question’.

A description of the program can be found here, together with the source code in a file called iremoted.c.  Its GitHub entry is here.  I compiled it from the Terminal by typing the recommended instruction ‘gcc -o iremoted iremoted.c -framework IOKit -framework Carbon’.

When I ran it, sure enough it showed me the HID element of the code sent by each button press, like this:iremoted Terminal window2

It’s interesting that ‘+’ and ‘-‘ were the only two buttons that showed an entry when pressed before another entry when released.  Whether this has anything to do with the fact that they were the only two buttons to show up in PureData, I don’t know.

The above isn’t the only information passed via the infra-red link when a button is pressed.  I’ve read numerous articles on the subject which, frankly, I don’t understand – they either don’t say the same thing, or they say the same thing in a different way . . . suffice it to say that 4 different pieces of information are transmitted each time a button is pressed, according to the NEC Infrared Transmission protocol, which Apple remotes use (in a slightly non-standard way): the first two are purely Apple’s own ID, the third is the instruction code, as above, and the fourth is the remote’s individual ID.

*

The individual remote ID is the final thing I want to deal with in this post – which I ought to do, as I glossed over it rather surreptitiously when talking about ‘pairing’ earlier on.

When you pair a remote with your computer, you’re not pairing just any remote in the vicinity: you’re pairing a particular remote; and the way the computer knows which particular remote is being paired is because of its individual ID, which is a number from 0 to 255.  This isn’t fixed: it can be changed, although not to a number of your choice.

The advantage of pairing a remote is that you can – as  in my earlier example – ensure, in an environment in which several remotes might be in use, that your computer responds only to your remote.  If by some chance you find yourself in a situation in which there are two remotes with the same number, you can change the number and re-pair it.  To change the number, all you do is press ‘Menu’ and ‘Play’ (the centre button) at the same time, and the number will increment.

I have read that the remote will attempt to pair when you do this, so if you don’t want to pair at the same time, do this outside the distance from the computer (3 or 4 inches) which is required for pairing to work.

So, pairing can be useful.  But what might be even more useful is not to pair a remote with your computer, but to allow the computer to recognise individual remotes by their IDs and have them do different things.  Programs like Remote Buddy do this, as the following screen shots show:

Multiple Remotes

Checking the box ‘Enable support for multiple remotes’ – indicated by the arrow at the top – brings up the list beneath.

In the right-hand column, remotes are distinguished by their ID number, not paired, but associated with different ‘behaviour’ groups.

*

In the iRed Lite Editor window, clicking on the ‘Layer’ tab brings up a number of parameters that can be altered, one of which is the ID of the remote which will control this layer.  The actions described will not be performed by another remote with a different ID.

iRed Layer window2

This raises the possibility of using a number of separate remotes for entirely separate purposes, using modified remotes with multiple ‘personalities’, or teaching a universal remote with a learning capability to mimic remotes with different IDs.  This article: http://funwithcomputers.wordpress.com/2008/03/01/using-the-harmony-880-remote-with-your-macs-built-in-ir-port/ describes a project to teach a Logitech Harmony 880 to imitate 8 Apple remotes via Remote Buddy.  In this way 48 different buttons were created (could have been 96, but long presses were not configured) and all manner of things could be controlled in a home theatre set-up.

At some point, you might want to check the ID Number of your remote.  If you’ve only got one, chances are its number will pop up everywhere.  If you have more than one, someone else uses one in the vicinity of your computer, or you haven’t really used it before, here are two ways to find out what it is.

The first thing to say is that isn’t always quite as easy as it might be, as only ID number changes seem to be registered.  If you have more than one remote, it’s less of a problem – every time you use a different remote there’s a number change; if you have only remote, the following needs to be done the first time you use your remote after booting up the computer:

Open iRedLite and select ‘Preferences’ from its drop-down menu, and then ‘Apple Remote IDs’.  It will probably show ‘0’ as the current ID number.  Press a button on your remote, and it will display the remote’s ID number, as below.  If you have more than one remote, you can check the numbers here at any time, as the change from one ID number to another will be registered (although once I was fairly sure I wouldn’t be incrementing the IDs any more I wrote the numbers on the back of each remote!)

Apple Remote ID No window2

Another useful program you could use for this purpose is Joystick and Gamepad Tester.  I’ve blogged about this at greater length elsewhere, but since the Apple infrared receiver is part of the USB system, it will be picked up by this program, which is designed to identify buttons and other controls on USB devices (such as joysticks and gamepads).
In my experience, this only worked after I’d installed Candelair, as recommended above.
I open Joystick and Gamepad Tester and click ‘Ok’:
JAGT 1
I can then choose from a drop-down list.  Instead of choosing ‘IR Receiver’, which normally shows nothing, I choose ‘IOSPIRIT IR Receiver Emulation’:
JAGT IOSPIRIT

A list of buttons and functions appears, the last being the Remote ID number.  Pressing a button on the remote shows the current ID number in the ‘Now’ column.  Any button will do, as the device’s ID number is transmitted as part of every message.  Don’t take any notice of the ‘Min’ and ‘Max’ columns, as they just show other device ID numbers that may have been used before.

JAGT ID No

*

Some of the above could only legitimately be described as ‘fun’ by those of us with a rather esoteric definition of the word.  In Part 2 I’ll progress closer to using the IR remote for modification and music-making purposes.

25
May
13

UCreate Music, Part 3 – the software

The issue of the UCreate software is a contentious one, as the software to allow users to swap around the sounds and effects in their UCreate could only be used by connecting to the UCreate website; but after a couple of years Mattel took down the website and it was no longer possible to do this.

There is a long and very interesting discussion on the subject – from which many of the ideas below originate – at http://nomeist.com/ucreate-music/199.

The way it originally worked was this: the first time you plugged in your UCreate it automatically connected to the website, and downloaded a program, which – on the Mac at least, looked like this:

UCreate window ishot-3

This confirmed that your device was connected, and gave you the Firmware version (I think version 9 was the last one) and the individual number of your device.  Each time you plugged in your UCreate and opened the program, this is what you would see.  As the instruction at the top suggests, if you rested your cursor on various parts of the picture, you were given an explanation of the function of the various controls, for example:

Rollover ishot-6

However, more importantly, if you clicked the tab on the right, ‘Music portal’, you were able to log onto the website:

UCreate portal screen 2

As you can’t do this now, I’ve had to rely on an old screenshot from a Windows PC.  I don’t have any screenshots of what you would find when you got there, and even the Wayback Machine only shows a background image, presumably because the site operated via a Flash app; but you were able to download some alternative sounds directly to the UCreate device, and move the effects around.  What users anticipated was, as time went on, more sounds and new effects would appear, perhaps even a community of users sharing their own creations.

Instead, the site was closed, and you now see only this:

Failed to connect

Not only was access to the existing sounds and effects withdrawn, but, worse still, also the means of loading them into the UCreate devices; and everyone who used one was stuck with whatever sounds they currently had installed.

For most, this was the original sounds the UCreate came with, or one of the extra packs that had been available on the website.  I had the extra packs, but couldn’t use them because there was no separate software available to install them on the machine.

Some astute users had observed that the downloading process occurred in two parts: first the sounds were downloaded from the website to the host computer; then they were transferred from the computer to the UCreate.  The time-lag between these two operations allowed their own sound files, suitably renamed to match those being downloaded, to be quickly substituted between downloading and transferring.  The timing of this was crucial, and could be a bit hit-and-miss, so one proficient user, ‘scragz’, even wrote a routine for Macs that automated the task (https://github.com/scragz/ucreate-loader); but if these were still in the machine when the site was taken down, these were the sounds you were left with.

The following article describes how samples can now be loaded into the UCreate, and furthermore how you can create and use your own samples in the device.

*

First of all, I should say that this isn’t entirely straightforward,  but there are basically 3 steps to getting your UCreate to accept new sounds.  These are:

Step 1. Get your computer to recognise your UCreate device;

Step 2. Create the right kind of sound files for the device to use; and

Step 3. Load the sounds into the device.

Fortunately, there is now a step by step video tutorial on YouTube at https://www.youtube.com/watchv=Ehh1fn6D2Lk&list=PLJSvyfpaaK7ESfsIWcdwDMCS-YhIw1xc4 which tells you exactly how to do it.  This was made by Krimzon Ninja, who’s done some marvellous work in sorting this problem out, following on from a user by the name  of ‘marbs’ who created a program a couple of years ago (http://marbs-online.blogspot.co.uk/) which he called ‘u-load’.

Part 1 of the tutorial lists the programs required, and setting up the folders you need on the computer.

Part 2 describes how to get your computer to recognise the UCreate.

Following the instructions in the videos is the best way to do it, but these are my original notes from the first version of this article, which may help:

Step 1. Getting the computer to recognise your UCreate device.

If you just plug your UCreate into the computer and run u-load, you’ll get this:

screengrab 1

which is no help at all.  What you need to do is install a USB driver to communicate with the device.

The way to do this is as follows:

a.  Download the driver installer program ‘Zadig’ from here: http://zadig.akeo.ie/ (choose a version according to whether you’re using XP, Vista or Windows 7), and unzip it with a program such as ‘7-Zip‘.

[Edit: Now, what I’ve been told is that not every version of Zadig will do. There are different versions for XP and Vista or later.  I used this one: http://sourceforge.net/projects/libwdi/files/zadig/zadig_v1.1.1.137.7z/download which worked fine].

b.  Start Zadig, go to the ‘Options’ menu, and select ‘List All devices’.  marbs’ instructions said ‘choose GENERALPLUS-MSDC from the drop-down list’.  I didn’t have this on the list, so I used the ‘Edit’ function to rename the one item that was there – I don’t know if this was necessary or not, but as there was only one file in the list, and only one USB device plugged in – the UCreate – I knew it must be the right  one.  Just make sure you identify the correct device or terrible things might happen!

c. Then click the ‘Install Driver’ button.

This picture shows the Zadig window, with the 4 actions to take:

Zadig List all devices2

1) Choose ‘List All Devices’ from the ‘Options’ menu.

2) Only one item appeared on the list, which is the long box partly hidden under the drop down menu.  Probably a good idea anyway to make sure the UCreate is the only USB device connected, to avoid confusion. I checked the ‘Edit Name’ box so I could rename it ‘GENERALPLUS-MSDC’.

3) Actually, I can’t remember what was selected here.  I didn’t change what it already said, which is probably what is showing here.

4) Clicking this button starts the installation.

d.  The installation wasn’t instant: it took a couple of minutes, and some messages came up about restarting devices.  I switched the UCreate off, restarted the computer, switched the UCreate back on, and started u-load.

This time I got the following message:

screengrab 2

which was a whole lot better, indicating that u-load now recognised the UCreate, and was ready to load sounds and effects into it.

You only have to do this once, then your device is set up.

One final thing: I think it only fair to point out what marbs says at the end of the README file: ‘To use the original application delivered with your ucreate, you have to deinstall the [USB] driver in the device manager.’

In other words, you won’t be able to use the UCreate’s original software now, unless you can do this deinstall. I’m not sure whether Zadig does this or not; but I believe it’s designed not to remove existing drivers, so it would be possible, I presume, to restore the UCreate to its original state with this or with the Windows Device Manager.  It’s a moot point whether it would worth doing it, of course, since the website on which the original software depends no longer exists.

(Doing this on the Windows computer, incidentally, didn’t stop the original software from running on the Mac when I later connected the UCreate to that).

This is what you see when you press 1, then ENTER for ‘Help’:

uload help

This tells you exactly what u-load can do: ‘Make’ = group your sound files together into a big file which can be used by the UCreate; ‘Write’ = load these file groups onto the UCreate.

*

Step 2.  You need to create some sound files of the type that u-load and the UCreate can use (with the extension ‘.lop’).

Part 3 of the tutorial video describes how to create your own samples with the program Audacity.

Part 4 shows how to convert your samples to the format used by the UCreate with the programs Lopgen_a – Lopgen_e.

The 5 Lopgen programs can be downloaded from: https://drive.google.com/file/d/0B_ZkjKZUhAHQbWVsSWhuZXBFOFE/view?pli=1

There are some restrictions on the samples you create – principally making sure the files are not more than 5 seconds long.  There were reports in the past of some UCreate devices being irreparably damaged by not doing this.

The Lopgen programs don’t require the UCreate to be plugged in, they just work on sound files stored in a particular location on your computer.

All you have to do is create ‘.wav’ sound files with the correct attributes, and then have LopGenerator turn them into files the UCreate can recognise.

Edit the files in Audacity, to ensure:

a. they’re mono and 5 seconds long:

5secs

b. The project rate is 8000:

8000

c. They’re saved as ‘Other uncompressed files’ and, by clicking ‘Options’, the header is set to ‘WAV (Microsoft)’ and they’re encoded as ‘Unsigned 8 bit PCM’.wav

d.  Finally, you need to remove all Metadata before saving the file.

Once the file or files are done, copy them to the folder with the appropriate version of Lopgen in it, and run Lopgen.

*

Step 3: The final step is to load the sound files into the UCreate.

Part 5 of the tutorial video shows how to do this using the program ‘u-load’.

To do this, you’ll be typing 2, then ENTER (‘Make SamplePackage’, as the Help screen tells you), which will create a file which you can load onto the UCreate with a ‘Write’ command.

But first, you need to rename the sound files you created, and put them in particular directories.  There are 12 buttons on the UCreate for sound files – not including the two at the bottom for your own recordings – so u-load will be expecting to see 12 files with the names ‘sample_0.lop’, ‘sample_1.lop’, ‘sample_2.lop’, etc., up to ‘sample_11.lop’.

So, find the 12 sounds you want to load, rename them like this, and put them in a folder called ‘Samples’.

Type 2, then ENTER, and u-load will ask you to give a name for the file it’s going to create from your samples.  Type in the name, press ENTER, and it will gather the 12 samples together and create the file.

I wasn’t sure whether the file required the extension ‘.upload’ or not, so I created one with and one without.  The first screengrab shows the name ‘Beats’ being entered, then ENTER:

create Beats2

At this point, I had to close u-load, switch the UCreate off and on again, and reopen u-load.

Type 4, then ENTER (‘Write SamplePackage’): u-load will ask you which file to upload.  Give it the name of the file you just asked it to create, it will load the samples onto the UCreate, and you’re ready to go!

write Beats finished2

*

To add files to the two spaces originally used on the UCreate for your own recordings, create .lop files as above, and put them in a folder called ‘Recordings’.  They can be loaded into the two special spaces by typing 5, then ENTER (‘Write RecordPackage’).  u-load will ask you for the name of the first file to load: tell it the name, and press ENTER.  It will then ask you for the name of the second file: give it that, too, press ENTER, and the two files will be loaded onto the UCreate.

*

[Particular thanks to KrimzonNinja.  He acknowledges his influences at the end of the video tutorial].

13
May
13

Guitar FXBOX – Part 1, the software

I haven’t blogged about the guitar before, although this is the conventional instrument I play.

There are enough places on the web to find descriptions of commercially produced effects – of which there are many thousands – and, with possibly one or two exceptions, I won’t be writing about these.

However, I thought it might be worth describing some which I’ve been using which were written using PureData and which together I’ve called the ‘FXBOX’.

Some of the effects I’ve bought have cost £100 – £200, but for no extra expense other than a computer – which I assume you must have, as you’re reading this – and a little know-how, all these effects and more are available.

I have to say, I didn’t write the majority of these effects myself. The know-how has come from examples in tutorials or instructions for PureData, like this one: http://en.flossmanuals.net/PureData/ or this one: http://pd-tutorial.com/ or from the PureData forum at http://puredata.hurleur.com/.

A particular inspiration was Pierre Massat’s ‘Guitar Extended’ blog. Pierre has developed a sophisticated system using an Arduino and a Raspberry Pi to make and control the sound of the guitar, which you can read about in detail here: http://guitarextended.wordpress.com/.

In my case, there were a small number of particular effects I wanted to combine in a single unit, and my good fortune was to find this Spectral Delay patch by Pierre Massat (from an original by Frank Barnecht, based, in turn on work by Johannes Kreidler, whose tutorial is referenced above): http://guitarextended.wordpress.com/2012/02/07/spectral-delay-effect-for-guitar-with-pure-data/

This became the central element of the FXBOX project. What is does is to give different delay times to different harmonics of the input, producing an effect which Pierre likens to ‘hundreds of sparks or stars that fall like raindrops or broken crystal’ – a poetic, but apt description. More conventional echo effects are also available from this patch.

In the FXBOX I put a couple of conventional effects before the Spectral Delay, namely Chorus and Distortion, and a variable attack patch; at the end of the chain I added patches for panning and stereo imaging. The two interesting effects which remain are a pitch controller – the normal guitar input can be raised or lowered by up to an octave – and an unusual ‘freeze’ effect, which can produce either a static drone or a very odd series of pitches in response to the input.

This screenshot of the main page shows the various effects and their controls: FXBOX10 Screenshot I’m very grateful to Pierre and others for making their patches available for everyone to use.

One or two people whose patches came from posts on the Pd forum, I know only from their online names: ‘ralf’ for the Freeze function [http://puredata.hurleur.com/sujet-6100-fft-freeze-help], and ‘dack’ for the Pitch Shifter from his ‘Guitar multi-effects rig’ [http://puredata.hurleur.com/sujet-2525-guitar-multi-effects-rig].

The various patches which are required to make the FXBOX work are here [Edit:  these are the revised files after changes described in Part 3 of this post]:

http://www.andymurkin.net/Electronica/FXBOX/abswitch~.pd

http://www.andymurkin.net/Electronica/FXBOX/crossfader~.pd

http://www.andymurkin.net/Electronica/FXBOX/expression.pd

http://www.andymurkin.net/Electronica/FXBOX/FXBOX22.pd

http://www.andymurkin.net/Electronica/FXBOX/Guitar_specdelay~.pd

http://www.andymurkin.net/Electronica/FXBOX/LoopGenerator.pd

http://www.andymurkin.net/Electronica/FXBOX/midiin.pd

*

All the variable controls are available on the screen, but I decided for practical performance purposes it would be best to have presets which could be selected quickly.

In addition, after starting to use the FXBOX, I rapidly came to the conclusion that it needed a controller which was easier to use than the laptop trackpad. For one thing, you can’t adjust a setting manually and still keep playing. So I set about designing a controller which would also be compatible with PureData. Some controls might practically be operated by hand, but essentially this would have to be a foot controller with buttons and pedals for the various presets, and for adjusting settings which might need to be changed while playing.

The second part of this post describes the controller.

24
Jan
13

The Black Widow MkII and more on sample manipulation

I recently came to use the Black Widow sample manipulator again and decided to make some improvements to it.

IMG_1245

Black widow controls

Initially, I improved some of the existing features: what I had at first perceived as ‘unreliability’ in its responses to button commands was really only a difficulty in making the required number of presses to ‘fix’ volume, filter or pan settings on a sample.  This involves making one, two or three quick presses on the hatswitch button – like making a single, double or triple mouse-click reliably – not perhaps one of my best ideas, and a little difficult to execute, especially without any feedback as to whether the fix had been made or not.  So I added indicators to show if the fixes were on or off.

I then moved the sample arrays onto the same page, so there was no need – as there had been in the original – to move from page to page on screen to see what was happening with the samples being played.  This screen also now has the various indicators for volume, filter, playing position within the sample, etc., visible next to the representation of the waveform in the array:

monitorscreen

Above each array are also indicators ‘REVERB ON/REVERB OFF’ and ‘ECHO ON/ECHO OFF’.  I thought simple versions of these two effects would be useful, and added them to each of the output stages.  Having run out of buttons on the Black Widow, these effects are manually turned on and off by using the ‘W’ and ‘E’ keys on the computer keyboard.  (Although ‘E’ makes sense for echo, ‘W’ doesn’t for reverb, but I chose these two letters so as not to conflict with another program I commonly use, where ‘R’ and ‘V’ have particular functions; and ‘W’ happens to be next to ‘E’).

Also, on the right-hand side, indicators for ‘Auto Speed’ and ‘Number of sections done’ refer to the next change I made: a function to allow the Black Widow program to run automatically.  It’s designed to do this in a similar way to the way it’s operated manually: one sample at a time is operated on, and there are built-in delays between stages to allow a particular selected combination of settings to play for a while before being changed.

The particular settings are chosen by random numbers generated by the program.  In normal operation this will allow them to range between minimum and maximum values in each case.  In the event that this wide range is not required (for example, turning the  filter to minimum usually has the effect of turning the sound off, as does turning the playback speed to zero), there is now a page on which minimum and maximum values can be set for each parameter of each sample:

sampleeditor

It’s possible here to fix any parameter, so it cannot be changed during ‘auto’ mode; and to fix any sample to play back at normal speed, full volume, average filter setting and centre panned.

Finally, I added a third section in which samples can be recorded into the arrays, rather than loaded from existing sound files.  This could be useful for variety in a ‘live performance’ in which short samples (90 seconds is PureData’s default maximum) could be recorded and almost immediately loaded and manipulated, manually or automatically.

The screen that opens automatically when the app is run has had to be expanded, and now looks like this:

mainpage

It looks a bit complicated, but I haven’t mastered the method of producing a neat GUI; however, it works fine, and is easy to use if the numbered steps are followed.

The PureData file on which the app is based is here.

Here’s an example of the Black Widow in operation:

The 4 short samples used here are a recording of  a park, birdsong, running water and a live performance of the Cracklephone.

*

It’s perhaps worth mentioning here, as I haven’t done so anywhere else, a very handy little device I used, not wanting to have a full-sized keyboard in the way when I was trying to use the Black Widow controller.  This is the so-called iPazzport, a miniature keyboard and trackpad, which connects to the computer by USB.  It looks like this:

iPazzport

If you imagine that the trackpad is slightly smaller than the trackpad on a laptop, this gives you an idea of just how tiny the keys are – but I was still able to press the correct key when required.  In case of difficulty it comes with a stylus and a small attachment which fits on the end of the finger, with a point underneath it.

Mine was about £10 off eBay, but I don’t know how readily available they are now: the one you see these days is a wireless version which costs a bit more, between £15 and £20.  There are now some similar items – also wireless – styled rather more like TV remote controls, which look as if they might have larger keys.

*

Also worth mentioning here, if you’re interested in this kind of thing, is the work of Karlheinz Essl.  You can read about him here: http://en.wikipedia.org/wiki/Karlheinz_Essl_junior and on his website at http://www.essl.at/.

Of particular relevance in relation to the Black Widow project is one of the various programs Essl has created for sample manipulation, fLOW, which is described like this: ‘fLOW . . . generates an ever-changing and never repeating soundscape in real time that fills the space with flooding sounds that resemble – metaphorically – the timbres of water, fire, earth, and air. This ambient sound scape generator adjusts itself through various parameters and controllers that are represented in real time on your screen.’  It comes with four samples, which are are loaded and manipulated automatically via a comb filter, ring modulation, frequency shift and a flanger, but you can also load your own samples into it for a more personalised experience.

Flow

You can read about fLOW and download it from http://www.essl.at/works/flow/download.html.  I don’t remember how much it costs, but it isn’t very much, and well worth the money.

This is an extract from a track created with fLOW. The source file was an edited recording I made of a boat passing through a lock in Earith, Cambridgeshire:

It’s well worth reading more about Essl, too.  His main preoccupation is one that I’ve become interested in in recent years: ‘music that is created at the moment of its sounding (“realtime composition”)’. Improvisation, looping and manipulation of sound and music samples are all part of the same field, and chance can play a significant role.  In a later post I’ll be mentioning another his programs, REplay PLAYer (found at http://www.essl.at/works/replay.html), a multi-featured program for manipulating a single sound sample.

[Edit: that post is here]

*

Finally, a very nice freeware program with similar features which I’ve used is Sineqube’s Sapling, which is described here: http://www.sineqube.com/blog/?page_id=157.  Sapling provides an easy means to load 4 samples and vary – manually or automatically – the speed and volume of playback, and the length of a loop created within each sample.  It works well with short samples and allows a very useful combination of automatic and manual adjustments to be made in real time as the samples are played, and a facility for recording the output to disk.

sapling screenshot 2

This is an extract from a track created using Sapling.  The source file was an edited version of some recordings I made on my iPhone of a windmill in Burwell, Cambridgeshire:

*

With all of these programs, including the Black Widow in Auto Mode, I enjoy setting up the conditions and listening to the samples play, although for a more permanent record of what was created, I normally edit the recorded results.

*

[Edit: more modifications have been made to the Black Widow (although not for sample manipulation). See this post].

26
Oct
12

The Black Widow – Sample Manipulator

I was lucky enough to get a decent joystick for a good price from eBay, a Speedlink ‘Black Widow’:

Obviously, this is a bit more sophisticated than the controller with small joysticks which I used for the StyloSim, and the kind of thing used for semi-realistic flight control programs, having a throttle on the left-hand side and joystick on the right, and a nice feel to it.

As for musical applications, it connects to a computer via USB, as can be seen in the photo, so is very suitable for use with PureData’s ‘hid’ (Human Interface Device) function.

I thought at first of designing an instrument, but felt this would be less easy to operate than the Cybersynth or Theresynth, which used gamepad-type controllers.  An effects device like the StyloSim would be possible, but at the moment would seem like going over old ground: something I might come back to later.

Instead, I decided on a device for manipulating samples.  At the time I thought this was an original idea, but I have subsequently discovered someone who does this – in quite a different way, but using the same kind of device: http://www.youtube.com/watch?v=9wdb6-QLnQ0.

That was Johannes Kreidler, a very interesting contemporary German composer making music with cutting edge electronics.  Check out his website at http://www.kreidler-net.de/english/index.html or type ‘Johannes Kreidler’ into YouTube.  Kreidler is also an expert on PureData, as it happens, and wrote the very good tutorial ‘Programming Electronic Music in Pd’, translated into English at http://www.pd-tutorial.com/english/index.html.

So, I used PureData to create a simple device for manipulating samples with the Black Widow.

There are 4 buttons on the front of the Black Widow:

These are used to control up to 4 separate samples: when the Black Widow Pd app is first opened, the buttons are pressed one by one to load the 4 samples; when in use, the throttle, joystick and other controls operate on the sample whose button was last pressed.

As for the other controls, these are: on the left, the throttle, which includes two buttons on the reverse,left and right:

Pressing the left-hand button on the back of the throttle and moving the throttle forward from the central position increases the sample playback speed; moving the throttle backwards from the central position increases the playback speed, but plays the sample backwards.  When the button is released the speed and direction are fixed.  Pressing the right-hand button on the back of the throttle toggles the playback direction.

Moving the joystick to the left pans the sample to the left; moving it to the right pans it to the right.  Moving the joystick forward from the central position increases the playback volume; moving it backwards from the central position increases the centre frequency of a bandpass filter.

The other buttons on the joystick have the following functions:

The button F3, when pressed as the sample is playing, sets the start point of a section within the sample; F4 sets the end point.

The hatswitch has 4 functions: RIGHT cycles playback from the start point to the end point of a section set with the F3 and F4 buttons; DOWN pauses playback; UP Restarts playback; LEFT fixes a volume or filter setting.

F2 restarts playback at normal speed from the beginning of the sample.

This is the control window, in the process of loading a sample:

There are some problems with it: it doesn’t always seem to respond to instructions, particularly the ‘Fix’ command from the hatswitch, don’t quite know why.  Also, the interface isn’t very practical: if you want to look at what you’re doing as well as listen, there are separate windows for each sample which you have to bring to the front.

However, it mostly works as described, and is quite entertaining to play with!  I’ll post a sound file shortly.

[Edit: the Black Widow has been superseded by the Black Widow, MkII, described here].




andymurkin

May 2017
M T W T F S S
« May    
1234567
891011121314
15161718192021
22232425262728
293031  

Enter your email address to follow this blog and receive notifications of new posts by email.