Potentially Musical Devices

By | February 3, 2013

{in progress}

Many of the projects I’d like to try center around the possibility of wireless synchronization among several machines, ultimately to a musical beat. One of my first Arduino ambitions was a visual, midi-clocked metronome, which I eventually decided to base on midi-clock coming from a laptop running a sequencer (Ableton Live.) Though I never had a chance to finish that project, I did learn quite a bit about the Midi protocol and some limitations to the Arduino and it’s open source libraries. Recent hardware advances in Physical Computing (Teensy 3.0, Raspberry Pi) have me excited to try and synchronize devices without a laptop. Devices would not need sample-accurate sync, but they would need to look or ‘feel’ right.

I can envision everything from  show control of lights, video etc. to rehearsal, performance and recording tools for musicians – possibly in one box, or perhaps a few boxes that are designed to communicate with each other. To start with, I want to attempt wireless synchronized playback of videos stored on several matching devices.

Hardware considerations

With built-in hardware-assisted HD video playback, the Rasberry Pi is an exciting candidate for this project. The RasPi Model B is $35 (if you can get your hands on one.) Add an SD card WiFi, power and a case and cost is at around $60 per unit. I’d like to stay under $75 per unit if I can. I want it to be relatively inexpensive to own 4 or 5 of them. There may be some potential pitfalls with the RasPi. So far I’ve been reading that the Arduino is a better choice for real-time control of things that might need very critical timing – for instance, auto-pilot on a DIY drone. (I’m uncertain the Pi could “freewheel” if it lost clock signal or something like that.)

{note: I need to look closer at: the missing link. This device is sending OSC over Wifi…}

Software considerations

It may be possible that VLC media player could handle synchronized video or audio playback across multiple machines. However, as of this writing (02/2013) VLC does not yet support hardware-accelerated playback on the RasPi. Regardless, I’m not sure about depending on a full installation of VLC as part of the package. The only accelerated player out there right now (except for RaspbMC) is Omxplayer, which works very well. The trick will be controlling Omxplayer via Python, C or whatever is appropriate while maintaining the ability to select media, start and stop in sync with several other players.

With sync as a primary goal, I’d like to try and nail down a couple of technical foundations. For example: should I set up and rely on a WiFi network (in potentially unknown venues) or use inexpensive radio transmitters and receivers? There are pluses and minuses to each approach. A wifi network requires a certain amount of administration (though there are probably ways around my newbie frustrations so far.)

There’s also an issue of protocol. I’ve considered broadcasting some sort of linear timecode (LTC, like SMPTE or Midi TC) as it’s pretty much the industry standard for show control. Each “slave” machine would lock onto the broadcast timecode, and then execute “cues” from a playlist… ‘at 20 minutes, 30 seconds and 10 frames play Video 2,’ for instance. Or ‘at 25:35:00 start a click track at 135BPM.’ There are a few examples of SMPTE generators and readers for the Arduino/AVR on the web, so it seems possible. If the slave machine can freewheel, or continue on it’s own without sync for a short time, it might account for lost frames due to radio interference.

However, there are a few reasons I feel absolute time may not be the way to go for a potentially musical product. What if the operator wants to adjust the tempo of a sequence while it is playing? In that case it might be more appropriate to transmit something similar to midi beat clock using relative time, where the distance between clock signals is relative to tempo. In that case, I’m thinking some kind of machine control and position information would need to be encoded into the clock signal.

More later…