PicoStepSeq - RP2040 music maker

By Rosemary Hattersley. Posted

Embedded systems and hardware hacking hold no fear for Tod Kurt, who has years of experience with both. Tod shares expert tips on Arduino and MicroPython, and recently unveiled this PicoStepSeq MIDI sequencer based on our favourite microcontroller board.

Prior to his adventures in Raspberry Pi Pico programming, Tod’s company, ThingM, had launched a “simple but popular” USB LED notification light known as blink(1). This provides a visual indication that you’ve received a message, email, retweet, and so on. The idea behind the PicoStepSeq is also visual: using GPIO pins, Tod planned to program Pico to light a series of LEDs at varying intensities when each note played. “The Pico and the RP2040 are wonderful parts. So much possibility in such a small, inexpensive package!”

Musical muse

Tod found easily available ‘step switches’ - lever switches with LEDs - as an inspiration. “I wanted to make a MIDI step sequencer, looking like the 1980s synths and drum machines that had these switches,” he says. “Their integral LED makes it really clear of the state of the parameter that the switch is controlling, and they take up only a bit more space than a regular tactile switch. And their clicky-clicky sound is ‘chef’s-kiss’.”

Tod was also keen to make a Raspberry Pi version of a four-button step switch project he’d read about on the Adafruit website. “MIDI is a very forgiving protocol and much easier than trying to make an actual synthesizer”, says Tod. He thinks step sequencers are “a good way to think about music creation, because it limits you to only eight notes and a small amount of time.”

Simple steps

Tod was keen to use both USB MIDI and serial MIDI, which meant he’d need some sort of display or user interface. Given the number of GPIOs he was going to need, the GPIO-laden Pico was an obvious choice and made project design a breeze. Every part – button, LED, display, encoder, and MIDI – is wired directly to the Pico without the need for GPIO expanders, key matrix, or ‘charlieplexing’, says Tod. (Assigning multiple functions to a button by giving them different responses if they are enabled, disabled, or partially enabled.)

Since Pico has PWM (pulse-width modulation) and movable UARTs, Tod could simply assign a command to any pin, as well as use variable brightness LEDs. Getting the timings right for the I2C displays was trickier: their 35 ms refresh rate is relatively sluggish compared to the rate of incoming MIDI messages.

Tod turned to CircuitPython for its displayio library, which sends only necessary messages over I2C. With this, “most display updates take 5-10 milliseconds, which means I can still send notes with relatively good timing,” Tod explains. The code is on GitHub.

Tod is already thinking of how to refine the StepSeq with “a MIDI arpeggiator that has a little bit of music theory built into it, so it always stays in the right musical key.” The exact hardware can become a nifty tiny synthesizer too, he adds. “Perhaps the improved audio circuitry will be in PicoStepSeq Mk II.”

From The MagPi store

Subscribe

Subscribe to the newsletter

Get every issue delivered directly to your inbox and keep up to date with the latest news, offers, events, and more.