Monomepi Raspberry Pi music box
By Russell Barnes. Posted
A Raspberry Pi music box featuring old and new technology in perfect harmony, meet Monomeipi
Advertisement
Get started with Raspberry Pi – everything you need to know to start your journey!
With hammers hitting the bars of a toy glockenspiel to play a tune, the Monomepi sounds just like an old-fashioned music box, but this Pi-powered contraption is based on new technology… and on quite a lot of LEGO. “It was just my luck that the components fitted with the LEGO bricks almost perfectly!” reveals its creator, Joon Guillen.
He got the idea after seeing a couple of videos of Arduino-based music boxes a few years ago, while working on a Conway’s Game of Life Pi project using a Monome Grid, a versatile piece of hardware that can be used to control music and more.
Building a Monomepi music box
For the Monomepi, the Monome is connected to a Raspberry Pi 3 running a step sequencer program, which registers the user’s button.presses on the Monome and lights them up accordingly.
The Pi then sends serial commands to an Arduino Uno connected via a ProtoShield kit to eight servo motors, which move makeshift hammers to play glockenspiel notes to match the pattern shown on the Monome. On the latter, the user can switch buttons on and o to alter the sequence as it plays.

“The contraption itself took only two or three evenings to build,” Joon tells us. “I focused most of my energy on the software side, so the physical construction was almost an afterthought.”
To build it, he borrowed a bunch of LEGO blocks from his young daughter. “They were the first things I thought of using. I haven’t the talent for crafts, and so LEGO was the quickest way to build the contraption. My daughter even added some blocks of her own in there!” While the construction was quick, the project as a whole took around two months, with Joon working casually over the course of several evenings and weekends. “Most of it was figuring out the step sequencer logic, Arduino code, and optimising performance.”
The main Python program running on the Pi is based on a Monome library Joon had created for his previous project. “That took a very long time, as I had zero Python knowledge when I started out. The library has since undergone several improvements through the years.”
While Joon opted to control his servos via an Arduino, he says there’s no reason why anyone creating a similar project couldn’t trigger them from the Pi itself, using a suitable motor driver board. And if you’re lacking a Monome (quite an expensive piece of kit), a touchscreen could be used instead: “A web-based UI should work, too. Or, if one isn’t necessarily trying to make a step sequencer, push buttons or [a computer] keyboard are viable control alternatives.”
As a part-time musician, Joon plans to sample the Monomepi to use in at least one of his tracks. He’s also looking to improve the project by “adding features to the step sequencer program, such as having more than 16 steps, and the ability to use multiple velocities. Other than that, I am trying to think of more ways to use my servos with the Pi!”
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
Get started with Raspberry Pi in Raspberry Pi Official Magazine 161
There’s loads going on in this issue: first of all, how about using a capacitive touch board and Raspberry Pi 5 to turn a quilt into an input device? Nicola King shows you how. If you’re more into sawing and drilling than needlework, Jo Hinchliffe has built an underwater rover out of plastic piping and […]
Read more →
Win one of three DreamHAT+ radars!
That’s right, an actual working radar for your Raspberry Pi. We reviewed it a few months ago and have since been amazed at some of the projects that have used it, like last month’s motion sensor from the movie Aliens. Sound good? Well we have a few to give away, and you can enter below. […]
Read more →
RP2350 Pico W5 review
It’s Raspberry Pi Pico 2, but with a lot more memory
Read more →