MIDI SysEx Patcher Ver.2

by baritonomarchetto in Circuits > Arduino

1370 Views, 6 Favorites, 0 Comments

MIDI SysEx Patcher Ver.2

IMG_20220119_162420_risultato.jpg
IMG_20220119_162341_risultato.jpg
IMG_20220119_162353_risultato.jpg

One of my first Instructable was a MIDI SysEx programmer I realized to fasten up the patching process with one of my knobless synthesizers (Roland JX8P it was) without the need to turn on a PC and grab a mouse.

The project then grown with more synths supported (Roland a-Juno, Korg DW8000, Oberheim Matrix 6 and Sequential Circuits MAX/Sixtrak) and the implementation of a Step Sequencer mode of operation.

Some of those synths are now sold or stored and not part of my current setup, but recently a Korg EX8000 gave me the opportunity to give that hardware a dusting and start patching again: instant gratification it was!

This also called to my mind how tedious it was to realize the prototipe programmer: wiring 16 potentiometers, the MIDI IN circuit and all the other components on perfboard took "forever" ...

Nothing beats a dedicated PCB to score agile assembly and reliability, so I decided it was time to arm myself with my favorite PCB design software tool and give this old-but-useful project new life with a dedicated board (and some improvements...).

In this instructables I will show you how to realize an arduino based MIDI SysEx (and Control Change) programmer/patcher capable of injecting some fun in creating new patches for knobless vintage synthesizers!

I will also share Gerber files required to have the shield's PCB manufactured at the best price around and the firmware to have it running.

Let's go!

Supplies

Follows the Bill of Materials (BOM):

Microcontrollers and ICs

1x Arduino MEGA 2560

1x 6N138 optocoupler

Capacitors, Resistors, and potentiometers

3x 220 ohm resistor

1x 330 ohm resistor

4x 1000 ohm resistors

1x 10K ohm resistor

16x linear, PCB mount, single turn 10 K ohm potentiometers

1x 100nF non polarized capacitor

Diodes and LEDs

1x 1N4148 diode

1x 1N4004 diode

4x LED (3 mm)

Others

16x pot knobs (optional)

4x momentary push buttons

1x DC barrel

1x PCB SPDT switch

2x MIDI (DIN 5) connectors

50x male pinheaders

Main Functions/Features

MIDI SysEx programmer main functions are:

-16 knobs for fast patching on knobless SysEx vintage sythesizers

-Built-in display

-Randomization of parameters for instant patch creation

-Notes sequencing (in three different modes, see description for details)

-Open Firmware

Randomization does not replace a reasonate patching process, obviously. I found it useful when trying to realize something new and different and a way to escape paths my lazy mind always try to impose when patching. It gives what can be considedred as an "always new starting point", as opposed to a sterile, repetitive, base patch.

Note sequencing is made via the same interface used for patching. LEDs track the sequence position and note pitch is determined by the potentiometer position.

Currently supported synths are:

-Roland Alpha Juno (1/2)

-Roland JX8P

-Korg DW8000/EX8000

-Oberheim Matrix 6/6R (> 2.14 firmware)

-Sequential Circuits MAX/SixTrak (Multitrak with adeguate firmware)

-Generic Control Change (not a synth, but available anyway!)

By selecting "Generic" you can send common MIDI control change messages. It could be used with synths supporting such protocol, but keep in mind that you are limited to the range CC10 to CC58.

Hardware Description

The programmer is built around a microcontroller board of the Arduino family: Arduino MEGA 2560. This is the brain of the whole programmer.

Sixteen potentiometers and four buttons are dedicated to user inputs, directly connected to the microntroller board.

Potentiometers are layed down in a 4X4 matrix and each one acts on a very specific patch parameter, as a function of the selected synth and current parameters page. Each synthesizer has it's parameters layed down in a unique way. They mainly follow the manufacturer MIDI implementation chart to keep the code simple and "universal" without stressing too much the limited memory capability of the microcontroller.

Parameters layouts for all supported synthesizers can be downloaded in the prototipe instructable dedicated page.

Four LEDs give visual feedback about parameters pages, sequence position (more on this later) and software processing phases.

A classic MIDI IN circuit built around a 6N138 optocoupler allows MIDI messages to enter the microcontroller board.

Incoming MIDI messages are software "filtered" and then outputted at the MIDI OUT connector toghether with SysEx messages dictated by knob movements.

The presence of both MIDI IN and MIDI OUT connectors allows you to place the programmer in between your main MIDI source (sequencer, PC... whatever) and the synthesizer to be controlled.

The 0.96" OLED display is the main news on the hardware side. The first version of the patcher couldn't give any feedback about the synth in use or any set parameter. This forced me to code the sketch such that all SysEx for all supported synths where sent at the same time. This had a detrimental effect in timing and overall code efficiency, not to mention the case where more than one of the supported synths were connected to the patcher via a MIDI Thru box. Problem solved! :)

To power the Patcher you have various alternatives:

1) send +5V (center positive) to the shield DC barrel (preferred method). You can use a cheap and common smartphone power adapter. The power input is protected against inverse polarization with a diode. Please notice that in case the protection is triggered your power supply could be damaged (no harm to the patcher though). You have been warned.

2) use Arduino's built in USB input conector (+5V). This is equivalent to method #1.

3) use Arduino's built in "external" power connector. In this case a 7 to12V power supply must be used. The difference in voltage is converted into heat, so the whole programmer could go hot. Pure waste of energy: NOT recommended.

4) connect a 9V battery to BAT+/BAT- inputs. This is equivalent to method #3.


WARNING: I have recently had the opportunity to use another MEGA clone with the programmer shield. This clone had the USB connector a little bit displaced and touching the "CLBAC/START" LED terminals. This is obviously not good!!

When you insert the programmer shield on your arduino MEGA be careful and apply a small piece of insulating material between the USB connector and shield, if necessary.


The latest hardware revision is hosted HERE (Github).

My projects are free and for everybody. You are anyway welcome if you want to donate some change to help me cover components costs and encourage the development of new projects.

>>HERE<< is my paypal donation page, just in case you want to push the development of new projects ;)

Assembly Notes and Warnings

IMG_20220119_151833_risultato.jpg
IMG_20220119_153814_risultato.jpg
IMG_20220119_155106_risultato.jpg
IMG_20220119_160736_risultato.jpg
IMG_20220119_161126_risultato.jpg
IMG_20220119_161530_risultato.jpg

I layed down the project to have all circuits and components on a single printed circuit board, with only input and feedback elements on the top/front side, all the others on the bottom side.

This made the board a little more "complex" meaning that component side and a solder side are mixed up: some component is soldered on top/front layer, some other on bottom layer.

Needless to say that it's very important to solder components on the right layer or the patcher will likely not work as it should.

In the attached pictures you can see the soldering steps I followed:

-smallest components on the bottom layer (solder on top layer - resistors, capacitors, diodes)

-medium height components on bottom layer (pinheaders, IC socket, switch, DC barrel)

-smallest components on top layer (solder on bottom layer - buttons and LEDs)

-biggest components on top layer (potentiometers)

-biggest components on bottom layer (MIDI connectors)

-display (top layer)

Now you can connect your Arduino MEGA 2560 with the latest firmware uploaded.

Mount the display a little bit angled with respect to the main PCB for ease of reading.

Solder potentiometers brackets first, then the three signal pins.

Contrary to my first prototipe, this patcher misses an external box/enclosure. You can anyway think to (partially) assemble this same PCB for a boxed patcher: your project will be more reliable with circuits on a professionally manufactured PCB instead of on perfboard.

Assembly process will be faster too even if, depending on your components placing, you could loose the advantage of having all of them (especially potentiometers) already wired/connected.

In case you don't care about all the aforementioned advantages and are determined in realizing this programmer on perfboard, all adopted circuits and wirings are public and described in my original prototype instructable.

How to Use

screenLayout.jpg

Select your current synthesizer first by rotating potentiometer #6 (Synth) while keeping pressed "Shift" button. The synth name will be shown on the display (bottom right).

There are two operation modes: Patcher (Programmer) mode and Sequencer mode. The two modes are not mutually exclusive, so user can tweak patch parameters while a sequence is running.

Patcher Mode

In this mode 16 potentiometers layed down as 4X4 matrix are used to set patch parameters values.

The current sketch handles three pages of 16 parameters each, and the user can cycle between pages by pressing the PAGE button.

Note that depending on the synthesizer the parameter position on the matrix may vary. Picture sheets of parameters are downloadable on the patcher prototype Instructable.

In patcher mode LEDs indicate which group of parameters (page) user is currently tweaking.

RNDMZ! (randomize) button is used to give to any patch parameter a random value. You can lock a specific parameter to maximum value by turning the potentiometer fully clockwise before pressing RNDMZ!. You can lock it to a minimum value by tuning fully anticlockwise the potentiometer. Successive randomization processes keep user maximised or minimized parameters constant, so there's no need to repeat the process every time.

CALLBACK button is used to callback all user previous movements on parameters. Values set by the latest randomization process that have not been modified by the user are also kept.

MODE button is used to cycle between Patcher Mode and Sequencer Mode. The current operation mode is shown on the display (bottom left).

Sequencer Mode

SHIFT button when kept pressed allows for tempo, step lenght, MIDI channels, sequencing mode and octave modification.

While keeping SHIFT button pressed you can:

-set BPM by turning pot #1. By default tempo is set to 120 BPM and step lenght to 1/16 notes.

-set notes lenght (steps lenght) to 1/4 note, 1/8 note, 1/16 note, or 1/32 note by turning pot #2. This will affect the overall sequence duration for obvious reasons.

-set primary MIDI channel by turning pot #3.

-set secondary MIDI channel by turning pot #4.

-transpose the sequence by turning pot #5. The base notes range (from C2 to F#4) can be lowered of one octave or increased by up to two octaves.

-change sequencer mode by pressing MODE button (see mode list in the following).

Beats per minute, primary MIDI channel and octave/transposition level are displayed on screen. Please notice that these values are updated at SHIFT button release only!! Actual values are not displayed untill SHIFT button is released. This is because the display update has a big CPU load and introduces sensible lags.

START button starts or stops the notes sequence.

PANIC! button send a all-notes-shut-off MIDI message to the connected synthesizer.

MODE button toggle between global modes (pather or sequencer) if SHIFT button is not kept pressed; toggles between sequence modes (see the folowing modes list) if SHIFT is kept pressed.

Sequence modes:

-16 Steps Mono Sequence: classic notes sequence through 16 steps.

-16 Steps Poly Sequence, Single Channel: notes one octave lower than those defined by pots are triggered too (this drains 2 voices per beat and will work with polyphonic synths only).

-8 Steps Poly Sequence, Dual Channel: two parallel 8 steps sequencies are sent to two different channels (MIDI channe 1 and 2 by defaut); by setting the same channel value both on the primary and seconday channels you can have two parallel 8-steps sequences played by the same (polyphonic) synthesizer.

About LEDs: as soon as you enter sequencer mode, all four LEDs lights will light up and the word "sequencer" will be drawn on screen (bottom left).

When you start the sequence, LEDs will follow the running sequence (or sequences). The sequencer uses one LED every four potentiometers.

About firmware uploading: I have a preference for hardware serial vs software serial. This has the advantage of keeping the CPU free from the task of emulating a serial interface, but the disadvantage of a "collision" with the MIDI IN circuit. To solve the "problem" and allow the uploading of a firmware without the need to disconnect the arduino from the shield every time, I have placed a SPDT switch (SW1) onboard. This must be set to "prog" position when a new firmware has to be uploaded, or to "MIDI" for normal operation (don't try to find "prog" and "MIDI" silkscreens in the attached pictures: I have added them after my PCB order :) ).

The latest firmware revision is hosted HERE (Github).

There's Always Room for Improvements!

The step sequencer code miss features someone could find necessary like MIDI sync, steps hold, etc.

Clock OUT is implemented, but 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 as it should, so I decided to disable it by default (the code is there anyway).

The display part of the code is limited and for sure you noticed mostly related to the sequencer parameters. It would be of significant use to display the patch parameter name and values while tweaking potentiometers, but this would be at the cost of a massive use of CPU cycles to update the display. If we consider that this would not eliminate the need for a parameter reference sheet and that I am not 100% sure arduino's RAM would suffice...

The display update massive use of CPU is also why new/updated parameters values are displayed only at the end of the modification phase (in other words when you release the SHIFT button) and not "on the fly".

In general, there's room for improvements also for the already implemented functions: I am not a coder in real life and suggestions are welcome!

Acknowledgments

IMG_20220128_150122_risultato.jpg

The PCB pictured in this Instructable was sponsored by JLCPCB, a high-tech manufacturer specializing in the production of high-reliable and cost-effective PCBs.

Their customer service is very good and PCBs a great value for the money!

Their contribution in the realization of this module was essential sooo... many thanks! :)

By registering at JLCPCB site via THIS LINK (affiliated link) you will receive a series of coupons for your orders. Registering costs nothing, so it could be a nice opportunity to give their service a try ;)