Alsa Sequencer aSynchronous PATCHbay

Jonathan Moore Liles <>
April 2007


ASSPatch is an ALSA Sequencer subscription management daemon. This third-party application automates virtual MIDI connections in your Linux studio.

Several graphical patchbays and connection editors exist for the ALSA Sequencer interface. Unfortunately, all suffer from some serious practical limitations--such as insanely complex XML patchbay definitions, lack of working snapshot capability, inability to create common subscription types, and general brain damage.

ASSPatch was written out of sheer necessity; another program of mine, Midipus, being unusable without a patchbay to automate subscriptions as clients are opened and closed during the course of a studio session.

1. Usage

There are two ways to define persistent connections for ASSPatch to manage. The first is to write them down in the patch configuration file (default: $HOME/.ap-patchbay); this is a very simple text file where you can define input, output and bidirectional connections, one connection per line, with no unnecessary mark-up to get in the way. Alternatively, the --action option may be used to influence the running ASSPatch process:

asspatch -a reload|refresh|snapshot

refresh refreshes the connection graph, reload reloads the configuration file and refreshes the graph, and snapshot takes a snapshot of current connections and writes it to a file (default: $HOME/.ap-snapshot.)

To set a snapshot as the default patch definition, simply move it to $HOME/.ap-patchbay or specify the filename with the --config option on the command line.

Unlike some other patchbays, ASSPatch does not attempt to force connections. That is, you may unsubscribe any two ports and the subscription will not be automatically renewed until one of the ports involved is reregistered with the ALSA interface. This allows you to swap connections manually.

1.1. For the Graphical

To avoid typing into a terminal, just configure your favorite desktop environment to run:

$ asspatch -a reload

and others upon a hotkey or panel button press.

1.2. Patchbay Definition Syntax

The patchbay definition file syntax couldn't be simpler:

(from client 'foo', port 'bar' to client 'baz' port 'zap')

foo:bar  |>  baz:zap

For convenience, the following two shorthand methods are provided:

baz:zap  |<  foo:bar

Is equivalent to the first example. And the bidirectional notation:

foo:bar  ||  baz:zap

Is equivalent to:

foo:bar  |>  baz:zap
baz:zap  |>  foo:bar

No quotation marks are necessary for names containing spaces. Ports must always be specified and may either be named or provided in numerical form, but clients must always be named (because client numbers change from session to session.)