Tuesday 12 April 2011

Some thoughts on conductive thread and a sneak peak at some coding

With a heavy heart I had to solder some wires into the gloves this morning. Not the finest hour when you are trying to make everything with thread, but a long string of errors led to this point, at first a few sensors stopped working or gave zero values, and the switches tended to randomly decide if they worked or not. I went through a long troubleshooting process with this, including checking the power hookups and arduino code. It was checking the arduino that really provided the answer as the software would no longer talk to the microprocessor and allow you to update it with the usb connected. Now normally even with everything hooked up to the xbee breakout board it updates fine (as long as the xbee isnt in the board) but this time I was getting an "arduino not in sync resp=0xf9" error when trying to upload. My first thought was that it was something to do with the xbee board, as this also gets involved when your uploading programs to the arduino due to the tx and rx wires being connected. So I disconnected them and the program uploaded fine. Somehow the conductive thread was stopping me updating the firmware, which could of course also account for some of the funky values I was getting into my maxuino patch.

After a lot of thought I've decided that mission critical wires need to be actual wires rather than thread, as things like the tx and rx getting shorted out or returning weird values isnt an option when your playing live, it all has to be bomb proof. Now there are still a few sensors acting funny and switches being intermittent in their response and this is clearly due to the thread. So firstly thats going to get replaced and ideally sewn between layers of neoprene instead of being latexed to see if that makes it more reliable and then dependant on the outcome I might need to break out the soldering iron again, I really dont want to, but the most important thing is that it works not that something in particular is used if its not suitable for the task.

Original Maxuino
Heres a brief snapshot of the code for one of the hands, im essentially running two copies of maxuino that have been heavily edited to do what I want... Firstly heres the original maxuino patch, as you can see apart from the subpatchers that deal with the OSC commands and do the javascript theres not a huge amount to it, midi comes out of the end and there you go job done. Now lets have a look at the left hand code for the gloves.....




My Maxuino Left Hand Patch
 This is the patch im running right now, basically everything bar the core maxuino patcher has been edited in some way to suit my purposes, theres an additional lighting system, routing options so you can send the midi via the internal max network of s and r objects to other channels (this is really important so you can control more than one instrument with your inputs and requires a little receive object to be placed on the channel your looking to send to), a calibration system, options to turn on and off sensors (as you dont want things happening every time you bend your fingers to hit a note or drum. Or maybe you do, you can do that too) and also inputs from the other gloves to control certain parameters, ie switches to change octave, channel the midi is routed to etc...... Quite a bit of data is passed back and forth to make things work, luckily max is fast at doing this and it doesnt cause any kind of unusable latency. However there is a little quirk that you have to work around. This patch has to be frozen to work properly, and you cant use an r object in a frozen patch. It is possible to add one but it causes a constant climb of the cpu usage second after second, so you end up with ableton telling you that you have 300% cpu usage or something ridiculous. However if you pop the R object in an external patch and bpatcher, or whatever, it into your frozen patch everything is fine. So theres a little workaround if you need it.

More on the coding soon.... for now back to conductive thread experiements

Thursday 7 April 2011

Its Alive!


 Its been a long road to get here but the final build of my physical controller has been done. Those of you that know me will know that ive been working on this for a long time. A year ago I built a prototype of these controllers using over the counter components, lots of wiring and a huge box full of circuit boards. Back in those days there was no maxforlive and everything was done in max/msp. However now that this is integrated with live the opportunities are endless and you can create a ridiculously powerful, and more importantly time domain driven, controller system. Here's a video of that original system.....






Since then technology has come a long way and you can pretty much eliminate circuit boards and wiring from your project if you want to make something wearable. The combination of maxforlive and conductive thread/fabric, lilypad arduinos and xbees required a complete redesign of the project and luckily I found a costume designer clever/mad enough to take on the challenge with me. As you can see from the photos below there was a lot of planning and drawing of circuit designs using thread to work out how to cram all the sensors on the gloves.


A first sketch of wiring diagrams
more wiring madness
 These are some of the rough sketches of what we planned to make. Basically the system involves switches, pressure sensors, LED's and accelerometers. One of the downfalls of the original project was that it was damnably uncomfortable to have switches on the end of your fingers, it made it very hard to use and meant that you couldnt do anything with your hands whilst wearing the gloves. Luckily these days its easy to make a switch out of conductive thread and fabric, you can even use the thread to make a resistor so your switches pull to ground when your not touching them, so no floating values here.
Originally I had store bought bend sensors on the fingers, but these presented their own problems, they were difficult to keep in place and the weakest point on the sensors was just after the connections to solder them so they broke, alot. But its pretty simple to make a pressure sensor using conductive thread and velostat and these can serve as a bend sensor if you mount them over the knuckle.

Controller gloves top side
The arduino lilypad has also been essential to this project as its really the only sensible way to connect conductive thread to a microcontroller and with the firmata sofware its super simple to connect them to the maxuino software which gets all your inputs into ableton live. As you can see from the pictures to the right and below the conductive thread has all been covered in latex, this is really a safety precaution to stop wires accidentally touching as you move your hands around, and is a really easy fix for this type of project.
Controller gloves bottom side
The biggest stumbling block so far has been the xbees, mainly because I chose to use the 2.5 versions which have all the fancy mesh networking stuff. For serial cable replacement I would recommend that you go for the first series of xbees as they are a lot quicker to program and get working as you would want. However it is totally possible with the series 2 xbees, you just have to force the controller to look for only the end device your using, if you leave it to scan for anything it can see you end up getting huge latency and packet delays, which pretty makes it unplayable. I noticed this is particularly true when outputting from the computer to the gloves and its pretty pointless to have a light that serves as a metronome indicator if its out of time or freezes! It took many hours of messing around to figure this out but its done now and the system is as stable as you could want.


So thats the build of the gloves done, the software is a whole other issue, due to the flexibility of max and live you can pretty much do whatever you want and build a bespoke system to tightly integrate with how you want to play, but thats something for another post. I hope this whets your appetite to see where this project goes. I'll be posting more about it all soon but if you want to catch me using these monsters live im playing at TAA in London on the 22nd of April and also at Tinnitus in Sheffield on the 29th.

Finally I have to give a massive shout outs to Annike who did all the stitching and sensor making for this project, without someone who could sew and was willing to make and remake things whilst we figured out what would work properly and do what I wanted I would have been back to wires. It took the two of us something like 40 hours of solid making to get these to the point they are now and shes been totally invaluable to getting this project together.

And also I have to thank Onyx Ashanti who patiently answered all my questions about xbees and what he was doing with his own beatjazz controller and was kind enough to give me a whole day of his time when I was visiting Berlin. You should check out his work as hes a fantastic musician, has made a brilliant controller and is one of the nicest people you could hope to meet.

So massive respect to them both, without you this project wouldnt be what it is now. Thank you!