Piano HAT review – a musical HAT
By Russell Barnes. Posted
Les Pounder looks at a HAT-based piano keyboard which uses capacitive touch keys for input
In 2014, a 14-year‑old called Zachary Igielman launched a successful crowdfunding campaign for his Pi Piano. Originally created using a MCP23017 GPIO expander and a series of momentary switches, the Pi Piano used a piezo buzzer to simulate the tone of a note.
The details
Price: £15 / $24
Maker: Pimoroni
Website: Pimoroni
This review can be found in The MagPi 37
One of Zachary’s advisors was Phil Howard from Pimoroni, who worked with Zachary to create this new and improved version.
Crowdfunded project
The latest incarnation is now known as Piano HAT and uses a capacitive touch-based interface to simulate a portion of a traditional piano keyboard. The board measures 64mm by 56mm and fits neatly on top of the models A+, B+, and Pi 2. Being a HAT board, it also attaches to all 40 of the GPIO pins. As well as the keyboard, we have the ability to raise and lower the octaves and change instruments via three extra inputs on the board.
Hardware is just one part of this project, and the software which supports Piano HAT is all based on Python, which enables existing projects created in this language to easily integrate Piano HAT. Phil Howard has written a series of examples which use the Pygame library to demonstrate how to use Piano HAT as a typical piano via a series of audio samples, which can be swapped for any types of sounds should you wish to build your own input. Piano HAT also comes with a tutorial which demonstrates using the built-in LEDs to teach playing a simple tune, in this case ‘Twinkle, twinkle, little star’. So, using this library, we can code our own tutorial for others to learn with.
Powerful MIDI synthesiser
Software is not just limited to simple samples. In fact, Phil has supplied a number of methods to connect the Piano HAT library to a MIDI service running on your Pi. This then turns the Piano HAT into a powerful synthesiser input for software such as Yoshimi and SunVox, although a Raspberry Pi 2 is required for these applications.
The Piano HAT looks like a rather simple board, but thanks to a clear Python library, well-built hardware, and a powerful MIDI control option, we have a board for musical adventures.
Last word
4/5
Such a simple board, but with limitless applications thanks to Python and MIDI. This is a great platform for musical experimentation and it can easily be used with Minecraft and other projects.
Russell runs Raspberry Pi Press, which includes The MagPi, Hello World, HackSpace magazine, and book projects. He’s a massive sci-fi bore.
Subscribe to Raspberry Pi Official Magazine
Save up to 37% off the cover price and get a FREE Raspberry Pi Pico 2 W with a subscription to Raspberry Pi Official Magazine.
More articles
Make your RAM go further – Raspberry Pi OS memory optimisation tips
In issue 164 of Raspberry Pi Official Magazine we have been playing around with the new Raspberry Pi 5 1GB RAM. While the RAM shortage caused by the demands of AI infrastructure is annoying beyond belief, this has been a great chance for us to really get to grips with RAM. Generating images in Stable […]
Read more →
Mighty Projects – 1GB Computer in Raspberry Pi Official Magazine 164
It’s normal for computers to get faster and more pwerful, but the new-ish Raspberry Pi 5 1GB is a step in the other direction: it has all the processing power and the same GPIO pins of its more costly siblings, but with only 1GB of RAM it’s at a price that’s friendlier on the wallet […]
Read more →
Win one of five 256GB Raspberry Pi Flash Drives
If you’ve been around long enough, you know that every Raspberry Pi accessory is top quality, and the latest Flash Drive is no different. Fancy a big one? We have five up for grabs, and you can enter below… Win 1 of 5 256GB Raspberry Pi Flash Drives
Read more →
