
I included the encoder and the stomp pedals since I plan to give them a function like changing settings from a list and sending program change messages. The green and red leds are activated by note on and note off messages respectively, while the blue led is triggered by pitch bend messages, which are the majority of the MIDI messages sent by the ARKeytar, and by control change messages. The merger also presents three LEDs for analyzing the type of the incoming MIDI messages. A reduced number of channels was used in this way. This was useful mainly to simplify the connection between the front panel and the Arduino Mega, which is screwed to the base. Moreover, additional MIDI messages, like program change messages can be generated with three stomp switches.Īll the switches are connected to the Arduino using a pair of shift registers. For the same reason, a digital encoder is present.
#Midi patchbay ebay code
The Arduino merges the routed incoming messages together with the ones generated following to the pedals action.Īn additional switch is present to add some generic setting that can be assigned by editing the code in Arduino IDE. The control change destination can be programmed, and the destination MIDI output port can be selected, for each pedal, using switches on the top panel. Once the pedals states are read, MIDI messages are generated if changes happened. Now, by simply moving two switches, I can configure the routing of my MIDI devices.

The routing of MIDI input 2 includes the possibility not to forward the generated messages, since the connected keyboard can be used to control only its internal sounds, instead of controlling some VST software. The MIDI input 1 can be sent to one of the MIDI outputs or to both of them, while the MIDI input 2 can be sent to one of the MIDI outputs or to none of them. By means of two SPDT (single-pole double-throw) switches with three positions, one can tell the Arduino the destination MIDI output port for each of the two MIDI inputs. The idea is to keep the ARKeytar MIDI controller and my keyboard synth connected to the MIDI input of the merger, while the two MIDI outputs are directed towards the keyboard synth and the audio-MIDI interface.


#Midi patchbay ebay serial
Given the need of managing two serial ports (two MIDI inputs, and two MIDI outputs), the Arduino Mega board was chosen since, unlike the Arduino Uno, it is able to manage more than one serial port.
