Introduction: (almost) Universal MIDI SysEx CC Programmer (and Sequencer...)
In the mid eighties synths manufaturers started a "less is better" process that led to barebones synths; this allowed the reduction of costs on the manufaturer side, but made patching tediuos if not impossible for the final user.
Manufacturers themselfs and third party companies realized optional boxes full of knobs to let you actually "play" with your synths sections, but these are silly overpriced nowadays and, as always, we are forced to find cheap solutions by ourself ;)
This project came from my need to easily program patches on my latest synths buy: a Roland Alpha Juno 2 and JX8P. On a side note: best bang for the buck ever!
It started as a simple SysEx controller, they it grow up on me and became something more complex.
In this instructable here I will show you how to realize your own controller: a cheap tool that emulates those highly priced plastic boxes... and more (continue reading for details...).
Step 1: What Exactly This Thing Is (and What Is Not...)
The MIDI SysEx and Control Change controller here is essentially a 16 knobs (potentiometers) and 4 buttons MIDI controller. The default sketch handles three "pages", for a total of 48 synth tone parameters.
I made the controller compatible with control change MIDI messages (a simple and "global" type of MIDI message widespreadly used by synth manufacturers especially from the 90's) and SysEx messages (another type of MIDI message, way less general and highly synth-specific heavily used i.e. by Roland in the 80's).
In particular, the controller is compatible with:
- any synth that can receive MIDI control change (CC) messages;
- Roland Alpha Juno (1/2);
- Roland JX8P;
- Korg DW8000 (untested and likely not working!).
Being the open source nature of the project, it's very easy to support any other synth of your choice (see the code step for details).
Remember that the default code/sketch/firmware supports "only" 48 parameters (three pages of 16 knobs each) so it could not be possible to control all the MIDI messages supported by your synth (think at an Access Virus or Novation Supernova: they accept more or less 110 MIDI compliant parameters). You can easily change the sketch to support more messages, if needed.
The tone parameters layout with all those number could be confusing at first, but it's not "random" as it could look like to some extent; it follows the order of the manufacturer MIDI implementation chart. This was a design choice to keep the code simple and "universal".
You can download an picture sheet with the 4x4 "layout" I realized for Alpha-Junos and JX8P on this page: blue parameters are those you can tweak while on page 1, black those on page 2 and orange those on page 3.
Even if the controller has no screen, toying with synth that show you what parameter is being tuned in real time makes the process of creating a patch a joy. The JX8P, in example, is capable of this; the Alpha Juno, instead, do not show you the parameter being changed and makes things a little bit harder (but creating awesome pathces is definitely doable and easyer than by using the built-in knobless interface).
What about those buttons there?
Well, the first one (upper left in my layout) is for page surfing: jump to the next parameter's page at each press of the button. LEDs will indicate which page you are in.
The second when pressed send the patch you where working on back to the synth (figure it: you made the patch of your life, then touched a program button on the synth surface and the button-specific patch was loaded... all your work have gone! With this button you can send all the values the programmer had memorized during the last patching process. This patch recall process does not work if you press the randomizer again and it's not effective if you did not press the randomize button at least once. The latest patch is not kept in memory after shutdown.
The third is for a secondary function: the randomizer/patcher! Turn full anticlockwise the knobs you want the parameter they act on to lock to minimum value (i.e. oscillator LFO, oscillator envelope, etc.) or turn fully clockwise to maximise the value (i.e. oscillator mix volume, VCA volume, etc.) and press the button to start he randomization process of all other parameters.
The fourth button is there to activate an easter egg (sort of...) I placed in the code after noticing that the layout was perfect for... a 16 steps MIDI sequencer! Exactly: press the fourth button (MODE button), the controller will enter the "sequencer mode" and you will be allowed to trigger notes in a similar way those old analog sequencer did. Nice uh!
Press the MODE button again to go back to controller/patcher mode.
What about those LEDs?
There are 4 LEDs in corrispondence to each button (on the right of each button in my layout) ; these LEDs have multiple pourpouses:
1) they tell you wich parameters page you are in (upper LED is lit when you are in page 1, LED underneath is lit when page 2 is active, LED 3 is lit... you figured it yourself). We are limited to 3 pages ATM, but the code can be easily tuned to handle more pages;
2) the second LED indicate parameters page 2 AND is lit when the microcontroller is sending the previous patch (patch recall);
3) the third LED indicate parameters page 3 AND is lit during the randomization process.
The fourth LED do nothing in MIDI controller mode and is used for global MODE change.
All these functions are transmitted as MIDI messages, so in order to be effective, your synth must be capable/enabled of receiving and interpret this sort of messages!
Step 2: The "Hidden" 16 Steps Sequencer!
As said, while testing the controller I realized that it would be great to let a sequence of notes run so that I could tweak synth parameters and have a better idea of the final effect on the tone. I have a software sequencer (I like seq24 so much!), but this hardware is an almost PERFECT 16-steps sequencer! Then it was only a matter of code to implement it.
You can toggle between controller mode and sequencer mode by pressing button #4 (MODE button).
While in sequencer mode buttons work differently and LEDs give you new informations:
- the first button (SHIFT button) when pressed allows for tempo, note lenght, channels and octave modification; the tempo value is given by the position of the first potentiometer, the note lenght is computed from the second potentiometer position, MIDI channels from the third and fourth potentiometer positions and octave (-1 o up to +2) from the fifth pot. You can control tempo from 40 BPM (turn potentiometer #1 full counterclockwise while keeping button #1 pressed) to nearly 240 BPM (turn potentiometer #1 full clockwise while keeping button #1 pressed). You can set notes lenght to halfs note, quarter note, eights note, sixteents note by turning pot #2 while keeping the SHIFT button pressed. You can set MIDI channels (primary channel and secondary channel) from 1 to 16. The base notes range (from C2 to F#4) can be lowered of one octave or increased by one or two octaves.
By default tempo is set to 120 BPM and note lenght to quarter notes.
- the second button start and stop the notes sequence. As said, if you change mode by pressing the button #4 (MODE) while running the sequence you will enter controller mode but the sequence will continue to run.
- the third button is a PANIC! By depressing it all notes will be shut off.
- the fourth .. ok, you know (global mode, when button #1 is not pressed, and sequence mode , when #1 is depressed while in sequencer mode, mode toggle).
In sequencer mode the MODE button has another practical use. If you press it while keeping button #1 (SHIFT) pressed you can toggle between 3 different sequence modes:
1 - 16 steps mono sequence
2 - 16 steps poly sequence: notes one octave lower than those defined by pots are triggered too (this drains 2 voices per beat)
3 - 8 steps poly sequence, dual channel: two parallel 8 steps sequencies are sent to two different channels (CH1 and CH2 by default); by setting the same channel value both on the primary and seconday channels you can have two parallel 8-steps sequencies played by the same (polyphonic) synthesizer.
About LEDs: as soon as you enter sequencer mode, all four lights will light up. When you start the sequence, LEDs will follow the sequence (or the sequencies). I placed one LED every four potentiometers and is good enought for me. It would be simple to modify the sketch to handle 16 LEDs, one for each step thou.
The step sequencer miss features someone could find necessary: MIDI sync IN, steps hold (you can only shut a step off), CV out.
I have implemented clock OUT, but is someway buggy. I tried two approaches for this (one with and one without timer interrupts), but they both where imperfect (or a total fail). MIDI clock must be strict-perfect to work on the long term. A clock signal is sent anyway and you can disable it directly on the sketch (see later for details).
Notice that this step sequencer is MIDI, or digital if you prefer, so in order to work must be connected to a synth with MIDI IN capable to receive and interpret these kind of messages!
Step 3: Hardware Needed and Building
After all these words, let have some fun!
We are going the common Arduino way. I used an Arduino MEGA because of the high amount of analog inputs (we want a box full of knobby knobs, won't we?! :) ).
In particular, Arduino MEGA can handle 16 analog inputs (with some hardware tweaking, i.e. by muxing, you can increase this but we are not going this route here), so we are going to send the 48 MIDI messages via 16 potentiometrs. Each potentiometer will then control three parameters, one for each "page"; pages are selected by a switch button.
- 1x Arduino MEGA
- 16x linear, single turn 10 K ohm potentiometers
- 16x pot knobs
- 4x momentary push buttons
- 4x LED
- 6x 220 ohm resistor
- 1x MIDI connector
- 1x ABS projects box
Some cable, solder wire and six - eight hours of spare time.
I used a perfboard and some pin headers to realize a sort of shield I soldered the resistors on and directed the cables. This has the advantage of letting you take out your Arduino and use it for other projects (we all run low on Arduino boards at some point!). It's not mandatory anyway and another good approach could be to desolder the arduino MEGA pinheaders and solder cables directly in place.
I used 200 ohm resistors in place of 220 ohm resistors and they work perfect anyway; i would bet even 150 ohm resistors would work great (for both MIDI communication and LEDs).
To shape the box, I first applied some adesive paper on the box surface, measured whrere the holes should be drilled (I had 3 cm from hole to hole to let all the pots to fit) made the guide holes and then enlarged to the right size to let pots thread or buttons thread to pass with a mini drill. I spent more or less 2 hours to finish the box. I realized little holes too, and glued LEDs in place.
I also drilled a hole for the MIDI OUT connector and another for the arduino power connector (I used directly the built-in USB power connector and firmly locked the arduino MEGA in place).
WARNING: always ALWAYS wear eyes and hands protections while drilling, whatever material you are working on (plastic, wood, metals, composites... it doesn't matter: you are at risk both with respect to power tools and chips of material eroded/fired from the moving tool).
Then, I placed all the pots and buttons and soldered the components as per attached picture. An effective way to reduce the weight of the final object (and lenght of cables) is to daisy chain all the pots both on the 5V line and GND line.
And before anyone asks: I know, that box I used is ugly! But it was free and nothing beats free :)
Step 4: Wiring
Wiring things up is easy as wiring a potentiometer (x16), a push button (x4) and LED (x4) to an Arduino microcontroller board. All the Arduino basics are covered here :)
Attached is the wiring. Notice that:
- All analog pins are used (from A0 to A15), one for each potentiometer;
- 4 digital pins (inputs) are used (from D51, D49, D47, D45), one for each button;
- other 4 digital pins (outputs) are used for LEDs (D43, D41, D39, D37);
- MIDI out connection is very simple and asks for two 220 ohm resistors (but down to 150 ohm will work)
- Buttons do not ask for pulldown resistors being that the sketch activates the internal pullup resistors our Arduino MEGA is equipped with.
- Each LED asks for a curent limiting resistor (200-220 ohm are ok for green LEDs).
I used the listed digital pins for comodity, but they are not "special" pins (we are not using the pwm capability of some pins here or some other pin-specific feature): you can set your favourite digital pins, but remember to modify the code accordingly or your buttons/LEDs will not work!
Please, notice that the MIDI OUT connection in picture is FRONT view (not rear view).
Step 5: Software - Some Link for Theory
I am not going to explain the full theory behind System Exclusive or Control Change messages because there are plenty of good articles out there and it is silly to rewrite what has already been written.
Just some quick link for Roland SysEx implementation :
- http://www.2writers.com/eddie/tutsysex.htm (ENGLISH)
and some link for MIDI in general:
Step 6: Software - the Sketch
Here attached is the sketch you should upload to your Arduino Mega.
I tried to keep the programmer as "universal" as possible, meaning that i tried to reduce synth-specific pieces of code.
I tried to keep the code as simple as possible. Adding the step sequencer made things more complex and the code more messy, anyway it was worth it for me. Keeping the code "universal" is why the controller layout is so "random": it follows the parameter order of the MIDI implementation the synth Manufacturer defined in the manual. It could be confusing at first, but you will be used to it very fast.
Actually SysEx messages compatible with Roland Alpha-Juno, JX8P and Korg DW8000 (untested!) are supported. I left the code for Juno 106 compatible messages in case you are in the need for that. The code for Korg DW8000 has not been tested (i don't own one) so please check it for me and report.
Clock out is someway buggy (clock must be strict-perfect to work as it should and probably the two approaches I adopted where not effective). If you prefer to remove that portion of the code, simply uncomment the line
replacing it with
The code includes comments, so there's no need to further comment here.
As always: remember that I am not a coder in real life and for sure there are better ways to code what we are in the need for here. If you are a coder and have suggestion, you are welcome! Please send me any variation that can increase the code's efficiency/effectiveness and I will include it to the main sketch (citing the Contributor obviously!).
I always learn something new by reading some good coder's code ;)
Step 7: Related Projects
As far as I know, there's not a MIDI parameter controller and sequencer out there (maybe the old Behringer BCR2000 with a modified firmware?)
anyway, if you are not prone to realize a box like this but very interested in cheap solutions to control your synth parameters remotely, consider these other alternatives:
- CTRL MIDI editor: this is a brilliant, free open source program running on win/Linux/mac that can turn your PC into a full controller for SysEx synths
- David Konsumer's "junosex" CC converter: this project asks for minor hardware work on your side and the idea is great - an arduino based CC to SysEx converter that let's you use a common non-SysEx MIDI controller (i.e. an AKAI MPK master keyboard) to speak with your SysEx capable synth