Pi Pico PIO Poly Tone MIDI “Pack”

This is a simple “pack” design for the Pi Pico PIO Poly Tone Keyboard providing 8-note tone-style polyphony with MIDI in functionality.

2021-03-13 14.05.57

Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

These are the key Arduino tutorials for the main concepts used in this project:

If you are new to microcontrollers, see the Getting Started pages.

Parts list

The Circuit


The actual circuit design is shown in the first diagram.  The second shows which of the GPIO pins are being used, colour coded as follows:

  • Blue – the PWM “tone” outputs.
  • Green – breakout headers for the analog pins.
  • Ochre – breakout headers for two digital pins.
  • Black – various links to GND.

The circuit is the same passive mixer used in the Pi Pico PIO Poly Tone Keyboard project.

If you’re wondering about the slightly odd choice of IO pins for the PWM outputs, I’ve chosen them so that they won’t clash with some of the Pimoroni “packs” I have and plan to play with.  Using the arrangement as chosen here the board won’t clash with my RGB Keypad or Pico Audio “packs” and it is also compatible with my own MIDI “pack”.

You can build this on proto board, but I put it together using another Pimoroni product (no, I have no link with the company, I’m just a fan) – their Pico Proto board.  This is a simple proto board but already of the right dimensions for the Pico and with the two outer rows linked as you’d expect in a dedicated proto “shield” style device.

Here are some photos showing the build sequence.

2021-03-13 13.29.542021-03-13 13.32.14

Laying out the parts and then positioning the headers and socket (without soldering) to size-up where everything has to go.

The eight resistors go on first, between the IO pin links and a central common point which will eventually connect to the jack socket via the capacitor.

At this point the jack socket and capacitor are soldered on, followed by the two sets of male headers for the optional analog and digital pin breakout sections.

I realised whilst writing this up that I haven’t added a header for a positive connection to the analog section, so at this point I had to go back and turn the 5-way header into a 6-way to include a header pin for 3.3V.

In this final set you can see the ground link to the jack socket and I’ve added an addition 2-pin header to attach my oscilloscope if I wish. The two 20-way set of low-profile female headers are added underneath and it is complete.

The Code

The code is a slightly simplified version of the code used for the Pi Pico PIO Poly Tone MIDI Keyboard. It is also using the modified version of the PIOBeep library I used in that project too.

I’ve taken out the built-in button handling and made it MIDI only. It also needs a slightly different list of pins.  As mentioned above, I’ve chosen a pinout that leaves it compatible with other “packs” I might wish to use in the future.

osc_pins = [9,12,13,14,15,16,20,21]

At present there is no use of the additional analog or digital breakouts either – they too are for future experiments.

The code supports all MIDI notes between A1 and A7. It can’t really go any lower without changing the PIOBeep library.

Find it on GitHub here.

Closing Thoughts

I feel that this “pack” has now set me up hardware wise for a range of experiments with the Pico.  Things I now want to explore include:

  • Attempting different waveforms via the PIO system rather than just square wave “tones”.
  • Adding some potentiometers to allow combinations of notes to stack up – trading polyphony for multiple oscillators per note.
  • Adding some buttons to select modes.
  • Driving it from my RGB Keypad.

You can see in the photo at the start of this post that this sits really nicely alongside my Raspberry Pi Pico MIDI “pack” Interface using a Pimoroni dual-expander.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s