For a class, my teammate and I decided to develop a MIDI based system that has a responsive light for each note played. For example, if you plug our little setup to a keyboard, pending on which note you press, you’ll get a specific color. You’ll need a list of several items, but the reward is quite nice! Plus, there are a lot of possible improvements and developments from the original idea, so please take the liberty to expand on this concept once you’ve put everything together.
Step 2: Putting It All Together
The main format of this schematic is that each pin of the LED is connected to a different pin on the Midi Shield. note the lower voltage for the red leg of our LED. The cathode goes to ground. The midi shield connects on top of the Arduino, which is why extended headers are necessary for the function of our lights. This is an extremely simple and straightforward build, but it provides a lot of room for expansion as well.
Step 3: Midi Concepts…
To program with Midi, you must understand a few key concepts that determine how the information is read.
Midi sends information with 3 bytes of information at a baud rate of 31250. The first byte determines whether a note is turned on, the next byte determines what pitch is played, and the third byte determines the volume of the note. It is important to note the order of the information as if you don’t set the code to read in this order for only 3 bytes, funny things start happening. Trust us.
Consider the following code:
//reads the serial port to see if there is any incoming information boolean check_midi() { while (Serial.available() >= 3)//when three bytes available { if (Serial.available()) { digitalWrite(3,HIGH); location_byte = Serial.read();//read first byte in_note = Serial.read();//read next byte in_volume = Serial.read();//read final byte return true; } } }
[box color=”#985D00″ bg=”#FFF8CB” font=”verdana” fontsize=”14 ” radius=”20 ” border=”#985D12″ float=”right” head=”Major Components in Project” headbg=”#FFEB70″ headcolor=”#985D00″]
What you’ll need…
Step 1 — Materials Needed:
1 Arduino- The Arduiono used for this project was a Freeduino v 1.22. This did not come pre-assembled, Other boards can be used, as long as the pins are able to line up with those used on the midi shield
1 Midi Shield- DF Robot Midi Shield (http://www.dfrobot.com/index.php?route=product/product&product_id=526). This Midi Shield did NOT come with extended headers, so we needed to replace the pins connecting the shield to the arduino with extended headers. This process requires desoldering and soldering tools, so consider this when choosing your midi shield.
1 LED- RGB LED (4 pins) — Check the information on your LEDs before using them. You can use an LED calculator http://led.linear1.org/1led.wiz to determine the proper resistors needed for your circuit. The Arduino produces 5 volts.
1 MIDI Cable (USB to MIDI is optional, it depends on the instrument used with your midi shield
2 1kΩ resistors (Brown-Black-Red)
1 560Ω resistor (Green-Blue-Brown)
The resistors used depends on the LED. These resistors produced a consistent brightness between all three colors. the 1kΩ resistors were used for the blue and green legs, and the 560Ω resistor was used with the red leg.
Wires — For the simplest experience, choose Red, Green, and Blue wires for the different legs of the LED, and a black wire as the ground.
Breadboard
4 Extended Headers (Optional) Only used if the Midi shield needs to be modified.
[/box]
Step 4: Optional Ubuntu Setup
For those of you using Ubuntu and what to set up your Arduino to run off of your computer, here are some quick instructions to get that set up!
Install ALSA and VMPK in the Ubuntu software center
Open a console, and run ‘qsynth’ — select a sound font in the settings.
Plug in your Midi to USB cable.
Open ALSA, and wire it where the Midi-In goes to the VMPK-In, VMPK-Out to the qsynth-In
Read more: Midi Light Show using Arduino