JC Pro Macro (V2) MIDI Controller – Part 2

Following on from the JC Pro Macro (V2) MIDI Controller as a step sequencer, this project shows how it can be used as a generic MIDI controller.

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 previous projects I’m using for the main concepts used in this project:

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

Parts list

The JC Pro Macro V2

The idea here is to have each switch select a specific MIDI Control or Program Change parameter and use the rotary encoder to change it.  There are two modes, governed by the “mode” switch:

  • Live mode – as the encoder is turned a stream of MIDI CC/PC messages is sent “live”.
  • Non-live mode – the MIDI CC/PC message is only sent when the encoder switch is pressed.

Here is a map of how the JC Pro Macro 2 is being used.

JCPMacro2CC

The Code

Once again I’m using the following libraries:

The main idea is that the basic code shouldn’t need to be tweaked much and all the information relating to which MIDI messages to send is stored in a separate file – ccmidi.h.  There is a structure in there that defines the following for each of the eight switches:

  • MIDI CC command to use.  Set it to 255 to specific Program Change rather than a Control Change message.
  • Minimum value to use for the command.  0 by default.
  • Maximum value to use for the command. 127 by default.

If the Maximum value is set to 255 then the control is treated as a “switch” with ON and OFF states rather than a continuous stream of values.  The MIDI spec seems to state that 63 or below is considered OFF and 64 or above is considered ON.

If the Minimum value is set to 255 then the control is treated as a “one-shot” command with a non-editable parameter, specified by the Maximum value.  One example is the “All notes off” command (123) which has a fixed value of 0.

There are two example configurations in the provided file.  The first is mapped to actual MIDI controllers as follows.

JCPMacro2-CC1

In this mapping, “All notes OFF” is a “one-shot” function and “Sustain” is an ON/OFF switch.  All others are continuous changing controllers.

A second mapping is provided using the eight generic controllers as follows:

JCPMacro2-CC2

The MIDI spec isn’t particularly clear but I believe GP 1 to 4 are typically continuous controllers and GP 5 to 8 are ON/OFF controllers.

The one limitation is that the code only supports the “MSB” controllers.  Some controllers have a “14-bit” mode where the value is provided as a most significant byte (MSB) and least significant byte (LSB).  Two 7-bit values thus making a complete 14-bit value.  This code only supports course-grained adjustments by sending the MSB only for any parameter.

As I mentioned before, I have prototype hardware, so a few of the hardware settings are slightly different from the final “production” version.  There is a configuration option at the top to switch over to my prototype hardware, but as I say, you should probably just ignore that!

Once again the code can be built for either USB MIDI or serial MIDI use.

Find it on GitHub here.

Closing Thoughts

I don’t really have a digital audio workstation (DAW) set up to try this, but I believe many allow you to customise how they can be driven by a MIDI controller.  To that end, it may be that if you run this with the “general parameter” configuration then you’ll be able to map the controls over to your DAW fairly easily.

There are a number of enhancements still possible on this code though:

  • Update the code to support 14-bit control values for fine-grained control of some parameters.
  • The JC Pro Macro 2 can be used with an I2C OLED display. It might be nice to have a more accurate visual indication of the parameter values as they are being adjusted.

There is still plenty to explore with this little board yet.

Kevin

Leave a comment