This project is a portable, Arduino-powered, grid-based MIDI controller that boots up into a variety of apps to do lots of things with sound. It has 16 backlit buttons, used as both inputs and outputs to give the controller some visual feedback. 2 potentiometers give analog control, depending on the app the pots are assigned to tempo, MIDI velocity, pitch, and scrolling (making the avaible grid space larger than 4x4). An x/y accelerometer and an x/y gyroscope add some playful, gestural control to the device; most of the apps implement a "shake to erase" control and several respond to tilt in various ways. It boots up into 7 different apps (described below), though it has the potential to boot up into 16 total. This device is primarily a MIDI controller, but I've also written an app that allows you to pull the button and analog data into MaxMSP and to control audio.
This controller was inspired by both the monome and tenori-on. When I was in college, I built a large touchscreen display, based on the Arduinome monome-Arduino clone schematics and code, that worked with all the open source monome applications written in MaxMSP. There are a ton of people building their own monome-type devices using these buttons from Sparkfun and the Arduinome code, as well as a few variations on the theme. With this project, I was interested in making a device that was a little more self-contained and relatively cheap to make (lots of buttons = lots of $). In keeping more with the concept of the tenori-on, this controller does all its app processing itself, it does not rely on a computer to process button presses/analog controls into MIDI. This means you can plug it directly into a synth or any device that understands MIDI and you're good to go, no computer required. It runs off a beefy LiPo battery that keeps it running for days on a charge, so it's fairly portable as well. In keeping with the monome side of things, it's totally open source and can be adapted to your particular audio setup/needs. All the Arduino code is up on github (click the cloud-shaped button to download), along with a MaxMSP patch that decodes data from the controller into something usable in Max.
An overview of the apps I've written so far:
Pixel Tilt - One pixel moves across a 2D keyboard with tilt, triggering MIDI as it moves. Control velocity and basenote with pots.
Flin - Music Box app based on monome. Speed and velocity of notes controlled by y tilt. Paging across 16 "lanes" with pot. Shake to erase.
Serial Communication with MaxMSP - Pull data from buttons and analog controls into MaxMSP and use Max to send LED states. Supports 5 bit analog controls for x/y accelerometer and 2 pots. This is great if you want to run audio processing applications with the controller. Download SerialDemo app (SerialDemo.maxpat, included with the Arduino files, click the cloud-shaped button here) to parse data in Max. Beat slicer (shown above) app is included with the Arduino files as well.
Arpeggiator - Plays a two, three, or four note arpeggio, similar to this app I wrote for monome. One pot controls the speed of the arpeggio, another controls velocity. Notes within the arpeggio can be shifted up or down by one semitone via button controls. The whole arpeggio is transposed via x tilt. Press the leftmost note in the arpeggio to play the notes in ascending order, press the rightmost note in the arpeggio to play the notes in descending order, and press a middle note in the arpeggio to play the notes in a random order. Shake to erase.
Boiing - Bouncing pixels that generate polyrhythms, based on this tenori-on app. Bounce direction based on y tilt. Speed and MIDI velocity (loudness) controlled by pots. Shake to erase.
Step Sequencer - Four note 16 step sequencer. Pots control tempo and paging across sequence. Shake to erase.
MIDI Keyboard - Simple MIDI keypad. Control velocity and basenote with pots, pitchbend with x tilt.
(1x) Button Pad 4x4 - LED Compatible Sparkfun COM-07835
(1x) Button Pad 4x4 - Breakout PCB Sparkfun COM-08033
(1x) Arduino Uno Sparkfun DEV-11021
(1x) Accelerometer/Gyro 5 Degrees of Freedom Sparkfun SEN-11072
I put a 3-axis accelerometer and 2 axis gyroscope in this controller to give it some gestural control, but so far I haven't actually used the gyro in any apps, and I've only got the x and y axis of the accelerometer wired up. That means you could sub in a simpler/cheaper part like this. Update: this part is no longer available and I'm having a hard time finding an analog gyro to replace it. This analog accelerometer board will work, and as I said before, I haven't actually implemented any apps with the gyro yet, so it's not really necessary. the wiring is a little different for the new accelerometer, but if you connect x, y, z, gnd the way I've described in the rest of the schematics, and connect the 5V from the Arduino to the accelerometer's Vin, it should work the same.
(16x) White 5mm LED (3mm is fine too) Digikey C513A-WSN-CV0Y0151-ND
(2x) 74HC595 shift register Digikey 296-1600-5-ND
(1x) 74HC165 shift register Digikey 296-8251-5-ND
(3x) 16 pin IC socket Digikey AE9992-ND
(16x) 1N4148 Diode Digikey 1N4148FS-ND
(4x) current limiting resistors (value will depend on LEDs, sample calculation included in step 5)
(4x) 10kOhm 1/4watt resistors Digikey CF14JT10K0CT-ND
(1x) 220Ohm 1/4watt resistor Digikey CF14JT220RCT-ND
(1x) 5-Pin MIDI Jack Digikey CP-7050-ND (optional - explained in step 27)
(1x) USB type B female jack Digikey 732-2734-ND (optional - explained in step 27)
(2x) 10kOhm linear taper potentiometer Digikey 987-1308-ND
(1x) Size N Panel-Mount Coaxial DC Power Jack with Switch Radioshack 274-1573 Update Digikey CP-002AHPJCT-ND this part may look different than the one pictured, check the datasheet/use a multimeter to be sure connection are correct.
(1x) SPST Toggle Switch Digikey 360-3289-ND
(1x) Size N Coaxial Power Plug Digikey CP3-1000-ND
(1x) Midi Cable Amazon (optional - explained in step 27)
(1x) Li-Ion 7.4V Tenergy 2200mAh Rechargeable Battery module with PCB Amazon
(1x) Tenergy Universal Smart Charger for Li-Ion/Polymer battery Pack (3.7V-14.8V 1-4 cells) Amazon
(1x) MIDI to USB cable Amazon (optional - explained in step 27)
(2x) Knobs - the knobs I got are out of stock (from newark) as long as it fits a 0.25"/6.35mm shaft it will work, pick something you like:
22 Gauge Wire, various colors Jameco #9313-0-R
electrical tape Radioshack 64-2373
wood/acrylic/project enclosure (I used this 6"x6"x2" bamboo box The Container Store)
double sided foam tape Amazon
All schematics for this project are shown above. Detailed overviews of the 74HC595, 74HC165, and power connections are given later in this Instructable. All the Arduino pin connections are listed below:
0 - Gyroscope Y (Y4.5)
1 - Potentiometer 1
2 - Gyroscope X (X4.5)
3 - Accelerometer Y (YAcc)
4 - Accelerometer X (XAcc)
5 - Potentiometer 2
0 - serial in - this must remain unconnected
1 - serial out - this is hooked up to the MIDI output
2 - 74HC165 data pin (Q7)
3 - 74HC165 clock pin (CP)
4 - 74HC165 latch pin (PL)
5 - 74HC595 clock pin (SH_CP)
6 - 74HC595 latch pin (ST_CP)
7 - 74HC595 data pin (DS)
no connections to digital pins 8-13