Using two optical mice and an Arduino microcontroller, I have built a Midi Cello. In other projects I have said how easy it is to make these types of projects and this time I really worked at keeping it simple. The two mice are wired to the Arduino Uno or Mega microcontroller and the serial out is wired to a 5 pin Din socket with 2 100 ohm resistors to provide the current limit for the Midi data out and thats it !
Hopefully you will feel inspired to start making your own devices. The components for this project cost around $65. The electronics was bought at RadioShack and the wood was bought at Home Depot. A battery powered screwdriver/drill. a hot glue gun and a saw are tools you probabally already own. If you are going to do electronics then a soldering iron, a pair of thin nose pliers and a pair of side cutters are needed.
The finger board slider was made by cutting a piece of 3/4 inch plastic pipe in half down its length. The slider is just a piece if 3/4 wooden dowel.
The Cello uses two PS/2 compatible optical mice. The PS/2 hardware uses four wires: +5v, 0v, clock and data. The clock wires are connected to digital IO pins that can generate software interrupts. On the Arduino UNO these are D2 and D3. The data wires are connected to digital IO pins D3 and D4. The serial transmit data pin TX is connected to a couple of resistors and the midi out connector.
Once they have been initialized, the mice send X and Y data as they detect movement. The optical sweet spot for the mice is small and the moving pieces need to be kept in it. For the bow sensor a bow rest is glued to the mouse and a backstop keeps the bow against the mouse. For the finger board sensor, a piece of plastic pipe that has been cut length ways is used to keep the slider which is made from a piece of dowel, aligned with the sweet spot.
The software that runs on the Arduino is based on software that I have written for the midi guitar, the Aniversal midi controller and the Doodlebug midi to keyboard convertor that can be used to play the Google Doodles.
Most of the Midi software I develop has a #define DEBUG 1 commented out near the top. When this define is un commented, the serial port speed is set to 9600 baud and debugging info is output instead of the midi data. Use the serial monitor to display this information.
The cello software has two copies of the ps2 mouse code. One coded for interrupt 0 using D0 and D4. The other mouse is handled by interrupt 1 using D3 and D5. The bow functionality is handled by interrupt 0 and the slider is handled by interrupt 1.
There are two defines
When debugging, if you comment out MOUSE1 or MOUSE2 then the debugging output for that mouse is not output.