Blog maker

PicoStepSeq – RP2040 Music Creator

Reading time: 3 minutes

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

musical muse

Tod found readily available “step switches” – toggle switches with LEDs – as inspiration. “I wanted to create a MIDI step sequencer, resembling the synths and drum machines of the 1980s that had these switches,” he says. “Their built-in LED makes the status of the parameter controlled by the switch very clear, and they only take up a little more space than a regular tactile switch. And their clicky-clicky sound is ‘chef’s-kiss’.

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

Simple steps

Tod was keen to use both USB MIDI and Serial MIDI, which meant he would need some sort of screen or user interface. Considering the number of GPIOs it was going to need, the GPIO loaded Pico was an obvious choice and made the design of the project easier. Every part – button, LED, display, encoder and MIDI – is wired directly to Pico without the need for GPIO expanders, keymaps or “charlieplexing”, explains Tod. (Assigning multiple functions to a button giving them different responses depending on whether they are on, off, or partially on.)

Since Pico has PWM (pulse width modulation) and mobile 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 35ms refresh rate is relatively slow compared to the rate of incoming MIDI messages.

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

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