Pi Pico MIDI Matrix Decode – Part 2

This is taking the solderless breadboard “keyboard” from my Pi Pico MIDI Matrix Decode project and committing it to stripboard.

  • In part 3 I expand it to four octaves.

2021-02-06 16.17.15

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 tutorials for the main concepts used in this project:

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

Parts list

The Circuit


This is the same circuit as the Pi Pico MIDI Matrix Decode but with all connectors broken out at the top for connection to the microcontroller.

The far left pin is the common pin.  All other pins relate to one of the switches.  Due to how the common connections have been made, the “black” notes appear before the lower “white” note in the sequence, so the pins across the top are ordered: C#, C, D#, D, E, F#, F, G#, G, A#, A, B.

There are no resistors on the board, so internal PULL_UPs are required in software.

The size of the board is such at several can be put side by side to add more octaves.  The circuit above shows an additional row of pin headers which can be used to connect to the next octave if required, but more on that another time.

2021-02-06 16.17.23

The Code

This is using the same Micropython code for the Raspberry Pi Pico as used previously.  The only difference is in the pin mappings, which are defined as follows now:

# Switch OFF will be HIGH (operating in PULL_UP mode)
row_pins = [3,2,5,4,6,8,7,10,9,12,11,13]

Note the “cross-over” mentioned for the black/white notes above.  Of course you could choose to do the “cross-over” in hardware and simply wire the board up slightly differently.  That is up to you!  I’ve chosen to keep a one-to-one “in order” mapping for the wires between the keyboard and the Pi, so will probably stick with that.

Whatever pin-mapping you use, this change will have to be made after downloading the code, which still has the mapping from the last project.

Find it on GitHub here.

Closing Thoughts

This is a neat little module with many uses and I plan to make a few of these for more experiments.


2 thoughts on “Pi Pico MIDI Matrix Decode – Part 2

  1. Just a thought… could the pin read velocity you could theoretically use just one pin to decode your keyboard; it’s cool to see this multiplex approach on the Pio Pico anyway. Great job! Very neat presentation and all that useful information!

    Liked by 1 person

    1. Hmm. I’m not sure… I guess the more typical approach to cut down on pins is to use analog inputs (which I talk about in “part 3”). I’m not sure how you’d do it with velocity… I suspect if you are talking time for signals to travel then I believe that is how capacitive inputs are scanned, but I’m not quite sure how it would apply here. It might be possible, but I guess it will be a lot more complicated! I’ll have a think 🙂

      Thanks for dropping by and commenting.



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