This is a simple “pack” design for the Pi Pico PIO Poly Tone Keyboard providing 8-note tone-style polyphony with MIDI in functionality.
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:
- Getting Started with the Raspberry Pi Pico: Inputs and Outputs
- Raspberry Pi Pico’s PIO for mere mortals – Part 3 – Sound
- Pi Pico PIO Poly Tone MIDI Keyboard
If you are new to microcontrollers, see the Getting Started pages.
- Raspberry Pi Pico
- 8x 1kΩ resistors
- 1x 10uF non-polar capacitor
- 3.5mm jack socket
- 2x 20-way female headers (I recommend “short” headers, mine have a plastic hieght of around 5mm)
- Optional: 5-way and 3-way male headers
- Protoboard or Pi “Pico Proto” from Pimoroni
- Optional: Raspberry Pi Pico MIDI “pack” Interface or other DIY MIDI Interfaces
- Amplification and MIDI source for testing
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.
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 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.
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.