Running Patches

A wandering minstrel I -
A thing of threads and patches,
Of ballads, songs and snatches,
And dreamy lullaby!

-- Sir William Gilbert, The Mikado

When a patch is started it becomes the current patch. Each connection is started (see below) and passed the patch’s start bytes to send to its output instrument. When a patch is stopped, each connection is stopped and passed the stop bytes to send to its output.

Connections

Connections have an input instrument and (optional) input channel, output instrument and channel, and the following optional values:

If the input instrument’s channel is not specified then all input from that instrument is run through the connection. If the channel is specified then any incoming MIDI bytes on other channels are ignored.

Start

When a connection is started:

Stop

When a connection is stopped:

Processing Incoming MIDI Data

While the current patch is running, MIDI data that comes in from an instrument causes two things happen:

An input instrument can be used by more than one connection. Each connection can modify the data and send it to a different MIDI instrument.