Tested on:RPi3; Raspbian Jessie
Prerequisites:Raspberry Pi with Raspbian Jessie and internet connection (see steps 1-7 in the Introduction)
Hardware:Piano HAT and Drum HAT
2 * Black HAT Hacker
40 pin IDE cable
(optional) shutdown button

RPi-Band: DrumHAT and PianoHAT simultaneously on a single Raspberry Pi

Two of the greatest Raspberry Pi hardware attachments (HATs) are the Piano HAT and the Drum HAT, both available on Pimoroni.com. The software coming with the HATs is close to plug&play and works fine, but only for one HAT at a time. The software presented in this post, RPi-Band, allows using both the Piano HAT and the Drum HAT simultaneously on a single Raspberry Pi. Plus, the Pimoroni 8-Bit-synthesizer is integrated into the Piano instrument selection button.
Although the software was only tested on the Raspberry Pi 3, it propably works well enough on the RPi2 or RPiB+.

Hardware Setup
For my RPi-Band, i used two black HAT hackers (from Pimoroni, too) to plug the two music HATs onto a single Raspberry Pi. Be cautious with the assembly- an inverted IDE cable may break the Pi or the HATs.

RPi Band Setup

RPi Band Setup

Alternatively, you could combine two IDE cables into a three headed one or build a simple custom circuit. It’s a parallel split, essentially.
Also, note the optional physical button attached to the drum HAT. It’s there for safe shutdown and sits between pin 14 (GND) and pin 18 in BOARD numbering.

Installing RPi-Band
The installation is simple and quick. Connect everything like shown above, plug in the speakers, then boot the Raspberry Pi and enter in the terminal

Using RPi-Band
Start RPi-Band with

It takes a few seconds to load. RPi-Band is initially configured for the piano sound set and the regular drums. The piano sound set supports different octaves which can be chosen by pressing the piano HATs Octave buttons. Pressing Instrument switches the piano sound set. One of the supported instruments is an 8-bit-synthesizer for the piano. Pressing Octave toggles the wave type combination. When in 8-bit-mode, the drums also are in 8-bit.
Press the physical button for safely shutting down the RPi.

Standalone instrument
For using RPi-Band as a standalone instrument, autostart RPi-Band by opening .bashrc with

and add the line

at the end of the file.

Have fun!

Piano HAT on GitHub: https://github.com/pimoroni/Piano-HAT
RPi-Band on GitHub: https://github.com/JoBergs/RPi-Band
Pimoroni webshop: https://shop.pimoroni.com

Knight of Pi

Johannes Bergs aka Knight of Pi. Diploma in Bioinformatics, some Webdesign and Python coding then. Living in the beautiful city of Vienna.


Time limit is exhausted. Please reload CAPTCHA.