LittleBits Light Controlled MIDI Sound Instrument
by alexpikkert in Circuits > Arduino
316 Views, 1 Favorites, 0 Comments
LittleBits Light Controlled MIDI Sound Instrument
In this instructable I will show how you can use the LittleBits W6 Arduino Leonardo bit to make music via the MIDI protocol.
This Arduino can send MIDI signals to an attached laptop via USB. This PC uses software to convert these signals into sound. I based my design on the free software sound program VMPK (Virtual Midi Piano Keyboard), combined with VirtualMIDISynth from CoolSoft (also a free progam). MIDI means Musical Instrument Digital Interface: a standard means of sending digitally encoded information about music between electronic devices, as between synthesizers and computers.
Supplies
Littlebits parts:
1 mounting board
2 powersnaps
3 bitsnaps
1 W6 Arduino bit
1 I3 button bit
1 I13 light sensor
1 O9 bargraph bit
1 O3 RGB led bit
1 I6 dimmer bit
1 P1 power bit
Other parts:
1 USB cable for power and data
1 12 VDC power supply
1 laptop PC with VMPK (Virtual MIDI Piano Keyboard) & Virtual MIDI Synth soundfont software
How Does It Work ?
The W6 arduino has three input connections and three output connections.
A few more input/output connections are also available onthe surface of the board.
On input A1 a light sensor is connected to control the pitch value of the music tones.
On input A0 a dimmer is connected to control the tempo of the tones.
On input D0 a button is connected to select the instrument you will hear. I selected 16 instruments out ot the 128 available that will play very nice sounds using this Littlebits setup.
On output D9 a bargraph led is connected to show the anmount of light detected by the light sensor.
On output D5 a RGB led is connected (set to blue color) to show the vibrato ON/OFF setting.
The USB from the W6 Arduino is connected to the PC.
The software will change the MIDI data from the Arduino into sounds.
First you must download the attached Arduino ino program and upload it into the W6 module.
Install both MIDI software programs VMPK and VirtualMidiSynth as explained on their websites.
You can test the installation by using the virtual keyboard on screen.
When done, power up the Arduino. After powering up start the VMPK program. This sequence is important, if you start the MIDI software first you will hear no sounds at all from the W6 Arduino.
Downloads
The Arduino Program
The program uses the MIDIUSB library which is included in the Arduino IDE (Integrated Development Environment).
The light level is measured and transferred into a value between 0 and 255. and is used to set the pitch and the led bargraph light level for indication.
The pitch level (set by the light level) is transferred into numbers betwee 24 and 96 and changed into a pentatonic scale.
The tempo level (0-1023) is transferred into a level between 7 and 255.
The vibrato signal is activated by turning the dimmer into the most right position and deactivated by turning the dimmer in the most left position. This also triggers the RGB blue led ON/OFF.
The button selects one of the 16 instruments from the instrument array.
The MIDI notes are played with a delay set by the tempo dimmer and a random value is added to make the sounds more interesting.
There are four subroutines used for noteON, noteOFF, controlChange (for the vibrato effect) and programChange (to select an instrument).
There is also a deactivated debugging section you can activate and use to see some values on the Arduino screen monitor if needed.