Meta

Raspberry Pi – AirPiano

Wouldn’t it be cool if you could control your MIDI equipped digital piano from your iPhone? Imagine a player piano capable of jukebox queuing up MIDI or Audio files and playing them in order. That was my goal! RPI to the rescue.

My original thought was to turn the Yamaha speakers into a AirPlay device for our many iOS devices. It’s nice to pipe in background tunes without having to hook up a device. AirPlay is great way to do that but I didn’t want to spend $100+ to be able to do that. The Raspberry Pi is more than capable of doing this. I found an extremely helpful blog post here: http://www.raywenderlich.com/44918/raspberry-pi-airplay-tutorial

NOTE: Power is a big issue for the Raspberry Pi. If you are using a WiFi dongle or any other USB device, I recommend making sure your power supply has enough kick to keep the RPI going. I started out with a microUSB adapter that advertised 700mA but performance became very unstable, especially under load. I switched to a 12W Apple adapter that I had handy and the problems disappeared. The RPI FAQ recommends 1.2A (1200mA).

Setup for AirPiano – MIDI Control

Dequeue Service: Run the cron.sh script to have the RPI scan for new midi or wave files to play. Run it with:

bash -x cron.sh 0<&- 1>/dev/null 2>/dev/null &

Apache: Install apache http with mod_php and mysql support

Website Code: Install index.php, setup.php and the folder.png files into the document root of your webserver. Upload the MIDI (*.mid) and WAVE (*.wav) files to this location. Be sure to update $globalBase in setup.php to the folder where these files are located.

AirPlay via Raspberry Pi

Adam Burkepile has the best tutorial I’ve found on how to set up a RPI for AirPlay: