Build Your Own Mouse Piano

Building your own Mouse Piano system can be done with off the shelf components and just a bit of software and soldering knowledge. Here’s a list of parts that were used in her construction.

Player Hardware

  • Player Piano – These come in various configurations, and can be found easily on Craigslist for free or inexpensive. Check your local listing.
  • BT-002 Vacuum Pump – This vacuum pump is the heart of the pneumatic system. It comes in a single and double port configuration, but unless you plan to keep the original roll reading hardware in place you should only need a single port.
  • DQF1-6B Micro Air Valve Solenoids (12v) x 88+ – I purchased these from Shenzhen Deyuxin Science And Technology, and they may be the hardest item to acquire since you have to contact the company instead of just getting them from a distributor. The 12v version will match the circuit design and power supply. If you go with a different solenoid be sure to get one that is “Normally Closed” and has an air valve that opens when energized. Also, your piano’s configuration may vary, so more than 88 may be needed.
  • Mean Well SP-200-12 Power Supply (12v, 16amp) – Any 12v power supply will do, so long as it can provide similar amperage. This supply is to power the solenoids exclusively through the solenoid control boards. These units don’t come with any cables. So you’ll want to purchase a power cord, and wiring as well.
  • Mouse Piano Solenoid Control Boards x 11 – The boards can be ordered directly from OSH Park. An 88 key piano should only need 11 of these boards, but OSH Park only takes orders in multiple of 3.
  • TPIC6A596NE High Current 8-Bit Shift Register x 11 – Each solenoid draws 150ma of current, so these shift registers handle 1.2a each.
  • 2×3 Pin Shrouded Header x 21 – These can be found almost anywhere, but must match any 2×3 Pin Ribbon Pinch Connectors you get.

You can either make your own cables, or purchase pre crimped ones. Just be sure to solder your headers to match the direction of the cable ends.

  • 2×3 Pin Ribbon Pinch Connector x 22 – These break easy, so maybe buy some extras unless you’re a pro at crimping these. I lost days in debugging just to find badly crimped cables to blame.
  • Ribbon Cable – 6 Wire – You can get any 6 wire cable, but I like the way this looks.

Key Scanner Hardware

  • Mouse Piano Scanner Board x 6 – Each board can handle 16 sensors. The last board will have empty slots that can be used for controls elsewhere in your piano. The controllers simply sample the analog voltage coming from the connected item. So use push buttons or potentiometers, whatever you like.
  • QTR-1A Reflectance Sensor x 44 – These come in packs of two with headers included. I ordered more than 44 just in case there were some faulty ones, which there were when I started installing them.
  • 3 Pin Female to Female Jumper Wire – You can get jumper wire anywhere, just make sure the boards can reach the sensors. The wire colors may not match the actual power/signal pins on the boards or sensors, but it’ll still work.
  • 3×4 Right Angle Headers (4 Pack) x 6 – Each board will require 16 3×1 headers, preferably all connected for easy soldering. These work nicely but you can find bigger lengths elsewhere.
  • 15.24mm Wide 24 Position DIP Socket x 12 (optional) – If you’re an accomplished solderer then these may not be necessary. But after ruining a couple ICs I found these made the job less risky.
  • 74HC4067 16-Channel Multiplexer/Demultiplexer x 12 – These might be a little hard to find. The V1 board design used the SMD version of this IC, but after burning the heck out of them I switched to the DIP version. If you get the SMD version and a conversion board you can mount these in the DIP sockets. Just be careful not to overheat the chips, as they burn out easily.
  • 6 Position Dip Switch x 6 – The board was accidentally designed for an 8 position switch, but the last two switches aren’t connected to anything, so a 6 position will be sufficient.
  • 2×3 Pin Shrouded Header x 24 – More of these headers.
  • 0.1uF Ceramic Capacitor x 12 – For the ICs.
  • 10k Ohm Resistor x 6 – Also for ICs.

From here the build can really be “choose your own adventure”. Amelia uses two Arduinos with Ethernet shields so that they can be controlled from a Mac over rtpMidi. But you can use whatever controllers work for you.

  • Arduino Mega 2560 (1 or 2) – If you only plan to have your Mouse Piano play music then a single Arduino Mega is necessary, otherwise get a second for key sensing.
  • Arduino Ethernet Shield (1 or 2) – To connect the Arduinos to your network.

Software

Depending on your micro controller your software selection will vary. But if you want to replicate what I did with Amelia you’ll need these pieces of software, or their equivalent.

  • An rtpMidi capable computer – When using macOS use the ‘Audio MIDI Setup’ tool and open the ‘Network’ section of it to connect to your Arduinos. If you’re using Windows you’ll need to download rtpMidi from Tobias Erichsen. At this time I don’t know of a Linux implementation.
  • Virtual Midi Piano Keyboard – This tool lets you send midi messages like any midi controller to whichever midi devices are connected to your rtpMidi session. I use this to send certain commands to Amelia or test the solenoids.
  • Rondo – Quality Midi jukeboxes are incredibly sparse for the Mac. Although this tool isn’t being developed/supported anymore, it’s still the best tool to create playlists and send Midi to your rtpSession.
  • Arduino-AppleMidi-Library – This library will be necessary to build the Mouse Piano Arduino code. I contribute to it occasionally to make sure it still works well with my code.
  • Mouse Piano Arduino Code – All of the Arduino code and Processing visualizations are maintained here on GitHub. These are also updated from time to time as I add more visualizations and controls to Amelia.