Arduino MIDI Multi MUX Step Sequencer

This applies the same extension from the Arduino MIDI Multi MUX Controller to the Arduino MIDI Mux Step Sequencer showing how it could be expanded to support 32 potentiometers or more in a MIDI step sequencer.

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 Arduino, see the Getting Started pages.

Parts list

  • Arduino Uno
  • 32x 10k potentiometers
  • 2x 75HC4067 (or similar) 16 port multiplexer chip or breakout modules
  • MIDI out module (for examples, see Arduino MIDI Interfaces)
  • Breadboard and jumper wires

The Circuit

ArduinoMIDI32MultiMux_bb

The circuit is exactly the same as for the Arduino MIDI Multi MUX Controller.  Once again I’m hanging a single MUX off each analog input pin.  There is one slight (optional) change though – one of the analog inputs can be used as a tempo pot.

The Code

This is a relatively minor modification to the Arduino MIDI Mux Step Sequencer.  The key feature is to work out which MUX and therefore which analog input pin to be reading. I do that as follows:

int mux = playingNote / NUM_POTS;

Recall that NUM_POTS is the number of potentiometers per MUX so this should work for either 8-way (4051) or 16-way (4067) multiplexers.  I’m assuming that only 8 or 16 potentiometers are supported, but it might also work if you are using less – as long as you have the same number on each multiplexer.

The number of steps in the sequence is defined at the top too:

#define NUM_STEPS 32

This has to be the same as NUM_MUX * NUM_POTS.  I don’t check so if this isn’t the case then odd things will happen like not enough notes for pots or not enough pots for notes…

Find it on GitHub here.

USB MIDI Version

If you have an Arduino capable of running native USB, such as a Pro Micro or another ATmega32U4 board, here is a version with optional USB MIDI support via the USB MIDI transport for the Arduino MIDI Library.

The basic steps in the code are as follows:

#include <USB-MIDI.h>
USBMIDI_CREATE_INSTANCE(0, MIDI_UD);

// Then replace all MIDI.sendXXX calls with MIDI_UD.sendXXX calls

Find the USB MIDI Version on GitHub here.

Closing Thoughts

Once again, in theory it would be possible to have up to 96 potentiometers just off the six analog input pins (assuming no tempo control) but with a little enhancement to support the EN pins it could be more.

If you actually build one with more than 16 pots, then I’d really like to see it – do drop me a photo and tell me about it!

Kevin

Leave a comment