Pages

Thursday, July 5, 2012

Duck!

My third "Duck" show in a row.  So I brought in my Wireless Easy Button, and they wanted it in the show.  It was fairly easy to cram the XBee into the prop remote (soldering to the board to pick up switch traces was less easy, and the 1-watt Luxeon I put in the front is not nearly as bright as a hoped -- that's the flaw in running it on barely more volts than the voltage drop!)

However.  Instead of using one of my computers, they are using the Stage Manager's computer for sound cue playback.  And that means they are using the free version of QLab -- without the money to pay for the MIDI license.

Fortunately, although the java classes for MIDI are basically screwed on Mac OS and will be for the foreseeable future (heck...it isn't as if java itself has a future on the Mac, with all the effort Apple has been making to have everyone dump cross-platform development platforms and write exclusively on Cocoa)...anyhow, although MIDI is a pain, basic sound file playback isn't bad.  So over the Fourth of July, I sat home and wrote and compiled a stand-alone, double-clickable ap that looks for a serial-over-USB, and when it detects activity at the serial port it plays the sound sample out the default Core Audio device.

It took me a chunk of today to figure out the other trick; when transporting it to a different OS/platform, bring the entire sketchbook folder and open Processing and re-compile from inside that folder.  Between Processing and the Mac OS, I was getting a lot of cryptic error messages instead of a simple "library not found" or "wrong library" and this solved the issue because saving out the entire project this way compiles a copy of ALL of the libraries in your #includes.

And here it is on my not-quite-as-ancient G5:





The rubber duck is providing a housing for a XBee Explorer USB, which links the receiving XBee node to the laptop's USB port.  The app window is displaying the selected port and flashes green when the XBee receives a signal.  The hacked remote is under the duck.

The app is total cludge code, of course.  Among other things, I'm not even trying to parse the serial message from the XBee (my mistake on a previous implementation).  Instead I'm simply detecting if ANY serial message is present, and then as soon as I've confirmed that, I wipe the serial buffer! 

(Should have thought of that trick long ago.)



And that's all I have time for.  I have some six minutes of music to compose before the weekend, and I need to learn how to run my new shareware software synthesizer to do it!

No comments:

Post a Comment