Arduino MIDI Multi MUX Controller

This project revisits my Arduino MIDI Mux Step Sequencer showing how it could be expanded to support 32 potentiometers or more in a MIDI controller.

IMG_6181

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 core principle is the same as described in the Arduino MIDI Mux Step Sequencer in that we are using one analog input to service 16 pots via a multiplexer.  But as the Arduino has six analog input ports, it can easily access up to six multiplexers at a time.

And as each multipler can in principle be turned on or off using the EN pin, then each analog input can support several multiplexers at the same time too, but in this project I’m keeping things simple by having one MUX per analog input.

All multiplexers share the same four address pins so the same channel on each multiplexer will be active at the same time.  They all require 5V GND and the SIG pin connecting to the relevant analog port on the Arduino.

I’ve connected up A0 and A5 for no real reason other than these are simple for the hardware I have to test it with – I used my set of 16 slider pots and the shield part (disconnected from the Arduino) of my “KLONEMIDI” bank of 16 pots as you can see in the photo above.

The Code

The core principle is as follows:

Setup():
  Set four address lines as OUTPUT

Loop():
   For each address value:
      Set the address using the address lines
      For each connected MUX:
         Read the analog value from the corresponding analog INPUT
         IF the value has changed since it was last read
            Scale the value from 0 to 1023 to 0 to 127
            Send the corresponding MIDI Control Change message

There are definitions at the start of the code detailing all the pins to be used and a list of MIDI CC message values to use for each pot.

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.

Find the USB MIDI Version on GitHub here.

Closing Thoughts

In this setup there are 8 digital IO pins free on the Uno.  If each of those was used for a MUX EN line, then in theory it should be possible to connect up 48 multiplexers to a single Arduino Uno!?  That would mean it could, again in theory, scan 768 potentiometers!  I shudder to think what the response times would be though.

Without the EN pins, then I still have 6 multiplexers on an Uno and 8 on a Nano.  That would still support 96 and 128 potentiometers respectively.  That is a lot of knobs to fiddle with!

Kevin

Leave a comment