12 light bulbs correspond to the 12 notes in an octave (minus the octave note). The rectangular box unfolds to position the light bulbs vertically for display, while at the same time providing a platform for the keyboard in use. Playing a note on the keyboard directly via midi, or through the usb port illuminates the light bulb for a particular key. Releasing the note, releases the key. Pedal presses are also recognized and keep the bulb maintained. The bulbs can be controlled without a computer by using the front mounted midi port, or via computer which allows for remote control via midi or osc messages. More about that later...
The light organ was built for and is currently in use by the band Future Dancing , see the video below to see it in action!
Future Dancing - Telling Stories from Future Dancing on Vimeo.
- 12 MIDI/OSC controlled light bulbs via DIN-5 MIDI port or remotely over USB
- Integrated USB hub providing 2 additional powered usb ports.
- Case unfolds into keyboard platform allowing for mounting on just about any keyboard stand.
- Really annoyingly bright LED that indicates to the player where the control is coming from, as if they didn't know...
Step 1: Overview
I. Construction - wooden enclosure etc. (step 2)
II. Electronics - microcontroller circuit and solid state relay control (step 7)
III. Software - avr code as well as virtual midi and osc driver (OSX) (step 11)
Step 2: Construction - Design
The most important things I wanted to keep in mind when designing this were that it needed to be durable for portability, and not require a lot of assembly, since there's not usually a lot of time setting up on stage. It would have been a lot easier to construct something that didn't contain the actual light bulbs, in other words, if the light bulbs had to be screwed in and removed for each use, it would be able to be a lot smaller. Something to keep in mind if you're building your own.
So, the design process for me basically came down to one thing, the width and height of the light bulbs, as that pretty much determined the size of the box. Once I settled on the idea that the light bulbs would fold down inside the box, the rest sort of came easily.
Step 3: Construction - Outer Frame
Each piece was individually cut then glued with wood glue, and screwed in using countersunk drill holes to keep the board flush on the sides and top. The corner pieces had additional 3 sided angle brackets to provide more support. I glued and screwed just about everything together with the exception of the top. For the top, I only screwed it in, so that I could sand it down and get the edges smooth, but still be able to remove it for installing the electronics and later on for staining the wood.
Step 4: Construction - Light Bulb Stand
The board that props the light bulbs, and the light bulb platform itself, needed a 45 degree angle cut on side in order for them to bend together properly when the box is closed. I did this using a table router with a 45 degree cutting bit.
Once the boards were cut, I drilled the holes in the main board using a 1 1/4" spade bit. Something to take note of when using these kinds of bits, they are great at cutting nice round holes of an exact size, they are also great at completely tearing up your wood on the reverse side you start on. See the photos below. Fortunately only the top is visible so I didn't really care, although it did make it a little more difficult when mounting the bulb sockets later on.
Step 5: Construction - Plugs/Switches
The left panel has an indicator led at the top, a pushbutton switch for setting the home note position (explained later), a midi input, and a USB input.
The right panel has the main power switch, and a second usb input.
The only difficulty here was the rectangular usb input and power switch. Both were meant for thin metal panel mount systems, and as a result my 3/4" wood posed a problem. However, with a straight cutter on my router I was able to cut out the back of the panel a bit to make the wood thinner in the area where the connectors went, without sacrificing any ugly protruding front panel parts.
The two panels sit back about a quarter inch because the switch on the right panl sticks out a bit, as well as the led indicator. If they were flush, the box wouldn't close flush at the end.
The last picture shows cutting of the power switch, and later on the USB output. I don't have any magic tools to do that with, just a drill and files, It takes a long time, it's boring, and it's frustrating. I guess when they were designing USB ports they didn't consider them being placed in wood enclosures, jerks! Oh if I only I had a laser cutter to help me with those in the future.... :D
Step 6: Construction - Staining and Assembly
Step 7: Electronics! - Light Bulb Sockets
Anyways, the sockets have two connections for the electrical. One side on all the bulbs is connected all the way back to mains connection. The other side is connected to a relay (see next step), which is connected to the other side of the mains. So essentially all the light bulbs are connected in parallel, which is really the only way to do this.
Since the sockets had screw terminals for the connection, I used the obvious choice of crimp connectors to connect to them, which also saved some time on the wiring. (Anytime you can use crimp connectors you should, they're easy and reliable!)
Step 8: Electronics! - Light Bulb Relays
The circuit of what all the relays look like with the bulbs is the last picture above. Because it's so simple, I just picked up a small perf board at radioshack . The resistors leading into them are necessary since the microcontroller is sending out 5V. If you've ever lit up an led with a microcontroller pin, this is the exact same thing, literally. Inside the solid state relay is a small infrared emitting led which sits next to a photo sensitive mosfet. When you light up the led, the mosfet closes. If you check the datasheet, you need 1.2V across the led with 10mA of current. So, from 5V you get: 5V - 1.2V = 3.8V .....3.8V/(10mA) = 380 ohms. Actually anything in this range will work +- about 100 ohms.
The microcontroller connects to the two relay boards with one strip of ribbon cable, explained in the next section.
Step 9: Electronics! - Microcontroller & MIDI
The eagle files for the controller board are attached, and you can see the schematic above at the end. Nothing really special going on there. Something to keep in mind if you're thinking of building something like this, an arduino would be able to do all this very easily, even those mini ones, all you really need is the solid state relays, then it's only a matter of controlling 12 leds. Also, since the board was made with a different purpose in mind, the power pin on the USB is not shorted to the power on the uC. I did this with a jumper wire underneath the board, which isn't visible in the pictures.
The last thing that's happening from the microcontroller is the LED control of the indicator. It's an rgb led, so there's three pins for that.
Step 10: Electronics! - Power and Hub
Because the power adapter for the hub was meant to be plugged into a wall, I had to pry it apart to get at the wires. I then connected one of the two wires to the mains input, the other to one side of the main power switch on the front. Then from the switch back to mains. That way the main power switch provides power to the controller as well as the light bulbs. Take a note of the third picture, after soldering to the two AC wires, I used shrink wrap to isolate them. That's very important. If it's not obvious at this point, the electrical part of this project is very dangerous if you don't know what you're doing! Using shrink wrap to cover any electrical leads to mains is vital for your own safety.
For the usb output port on the side I used this vertical connector from sparkfun. I then cut the usb cable from the hub to a nice short length and wired it up to the breakout board. (I was starting to run out of space in these corners, so long usb cables had to go.)
Once all the connectors were made, I mounted the power supply and hub to the insides of the case with hot glue and epoxy. Laugh all you want! Hot glue is awesome! No it's not good for long term, but it is great for short term to hold things in place while your long lasting epoxy is able to cure.
Step 11: Software - Microcontroller Firmware
The firmware on the uC is setup to handle either input from the MIDI port, the USB port, or both simultaneously. Switching between modes determines the routing of the messages. In addition, the home note can be set either remotely or locally using the front pushbutton switch. When the switch is pressed, the next note pressed and released on the keyboard will set the first light bulb to be that note. This obviously isn't a necessity, however, I find people are a little less mystified as to what the lights are doing if they see the light bulbs light up in sequence from left to right. When the root note of the key your playing in is the first light bulb, the lights tend to jump around a little less erratically, depending on what you're playing of course. The nice thing is that since this can be controlled remotely, it's easy to set the key of your song so that it automatically updates every time you switch tracks (see the last section on the max4live object using ableton).
When the mode of the unit is switched, the front led lights up a different color, indicating whether the local user has control or whether it is remotely controlled. This goes in the pretty much useless but looks cool category.
The majority of the software is setup to handle the incoming messages (midi/usb). The external crystal drives the uC at 18.423MHz, in order to get 0% error at 115200 baud rate. Aside from going line by line through the code there's not much more to talk about, feel free to ask any questions you have, the codes provided below. The zip file has the entire project inlcluding the avrstudio file (avrstudio5, I recently upgraded and converted all my old projects, you should too! its so much better than avrstudio4!). I left out the individual UART files since they are readily available elsewhere.
Some helpful points when writing for midi. You'll need a UART clock of 31250 baud, which means, for a 0% error, you need a crystal with an integer multiple of that. That works out okay though, since the built in 8Mhz works fine, or 16Mhz, etc. However, a problem arises when combining MIDI UART on the same chip as RS232 UART. The "standard" baud rates, 9600, 112500 etc, don't work well with 8Mhz crystals. So, what to do....well there's two choices IMHO.
1. Use the built-in crystal or similiar frequency (8Mhz...or 16Mhz, 20Mhz etc) and use baud-rate aliasing to correct for the usb.
2. Accept error on one of your lines. Personally, I don't like this option, I know a lot of people run things at 9600 baud with 16Mhz crystals, but I don't like to.
So, here's a bunch of links to aliasing the baud rate using the FT232R driver. I have done this on a PC and a MAC, it works great, and allows you to send data at much much higher transmission rates than RS232 was meant for. For example, instead of peaking at 225kbps, you can go all the way up to 3Mbps (although most atmegas can only do 2Mbps).
How to do it on OSX (follow the steps very carefully, it does actually work, I promise)
And, on a PC
Great article on aliasing the baud rate for using xbee controllers for midi (PC only)
Also, you're going to want to reference this page if you're writing any code for dealing with MIDI messages
Step 12: Software - Virtual MIDI/OSC
I worked on this software for a while a long time ago as part of another project which I still currently use , which is why the main program is called polynomeSerial. It is basically a reimplementation of the monomeSerial software, for anyone who uses monomes. Over time I've added more and more hardware to it. Since I have it running while I'm playing, it's an easy way for me to add more and more hardware to my setup without having to do much programming. All of the hardware I make uses the same USB interface, the FT232R usb to serial adapter, and uses the same communication protocol for sending and receiving messages. The same two message protocol that is used by the monome (by no coincidence of course).
Although monomeSerial has a nice GUI to go with it, for whatever reason a while ago I thought it would suit me better to run out of the terminal. So, there's really not much to show. The program runs by opening up a terminal, and using the command:
l for light organ, p for polynome, and a few other pieces of hardware still in the works are in there as well. Again, feel free to ask questions if you go digging through the code.
Step 13: Software - Max4Live
Step 14: Completion!
Also, for other projects that haven't made it to instructables...yet, visit here.
And please please vote for me for the Epilog challenge! If I win I'll be able to finish a laundry list of projects still in the design phase, and I promise to post detailed instructables on all of them, including the already finished ones.