Skip to main content

Auto-connect new JACK ports.

Project description

Auto-connect JACK ports as they appear and when they match the port patterns given on the command line or read from a file.

Description

jack-matchmaker is a small command line utility that listens to JACK port registrations by clients and connects them when they match one of the port pattern pairs given on the command line at startup. jack-matchmaker never disconnects any ports.

The port name patterns are specified as pairs of positional arguments or read from a file (see below) and are interpreted as Python regular expressions, where the first pattern of a pair is matched against output (readable) ports and the second pattern of a pair is matched against input (writable) ports. Matching is done against the normal port names as well as any aliases they have (run “jack-matchmaker -oia” to list all available ports with their aliases).

As many pattern pairs as needed can be given.

Usage

Automatically connect the first two ports of Fluidsynth to the audio outs:

jack-matchmaker "fluidsynth:l_01" "system:playback_1" \
                "fluidsynth:r_01" "system:playback_2"

Both the output port and the input port patterns can be regular expressions. If a match is found on an output port, the matching port will be connected to all input ports, which match the corresponding input port pattern:

jack-matchmaker "fluidsynth:l_\d+" "system:playback_[13]" \
                "fluidsynth:r_\d+" "system:playback_[24]"

You can also use named regular expression groups in the output port pattern and fill the strings they match to into placeholders in the input port pattern:

jack-matchmaker "system:midi_capture_(?P<num>\d+)" \
                "mydaw:midi_in_track_{num}"

Run jack-matchmaker -h (or --help) to show help on the available command line options.

Pattern files

In addition to or instead of from positional arguments on the command line, port patterns can also be read from a file given with the -p/--pattern-file option. The file must list one port pattern per line, where the first line of every pair of two lines specifies the output port pattern, and the second specifies the input port pattern. Empty lines and lines starting with a hash-sign (#) are ignored and whitespace at the start or the end of each line is stripped.

Example file:

# left channel
.*:out_l
    system:playback_1

# right channel
.*:out_r
    system:playback_2

When you send a HUP signal to a running jack-matchmaker process, the file that was specified on the command line when the process was started is re-read and the resulting patterns replace all previously used patterns. If there is an error reading the file, the pattern list will then be empty.

Requirements

  • A version of Python 3 with a ctypes module (i.e. PyPy 3 works too).

  • JACK version 1 or 2.

  • Linux, OS X (untested) or Windows (untested, no signal handling).

Acknowledgements

jack-matchmaker is written in Python and incorporates the jacklib module taken from falkTX’s Cadence application.

It was inspired by jack-autoconnect, which also auto-connects JACK ports, but doesn’t support port aliases. jack-autoconnect is also written in C++, and therefore probably faster and less memory hungry.

The idea to read ports (patterns) from a file and re-read them on the HUP signal was “inspired” by aj-snapshot.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

jack-matchmaker-0.5.0.zip (27.0 kB view details)

Uploaded Source

jack-matchmaker-0.5.0.tar.gz (21.9 kB view details)

Uploaded Source

Built Distribution

jack_matchmaker-0.5.0-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file jack-matchmaker-0.5.0.zip.

File metadata

File hashes

Hashes for jack-matchmaker-0.5.0.zip
Algorithm Hash digest
SHA256 a6a80e6ee54e6068c50c1d25e9c40d5c76c18a1a87d951726ccdc03fd302489f
MD5 05c0af24fc34c0d3ad3c85e9b51d2c12
BLAKE2b-256 fd673bc0c895410c8f44606a3e164ed85381e0baa8b04c9498886a325e4bffa3

See more details on using hashes here.

File details

Details for the file jack-matchmaker-0.5.0.tar.gz.

File metadata

File hashes

Hashes for jack-matchmaker-0.5.0.tar.gz
Algorithm Hash digest
SHA256 d41577fac2df0edfceb7fd2334a6a47e74a54749a1574c39e872de36526f72ea
MD5 9dfa37a50dcfd41c39c1832a0dfc21fc
BLAKE2b-256 b26eff9fb518cad3949ba578ed4d34b9c22b4d0fc47c839d63af234174e3fdd5

See more details on using hashes here.

File details

Details for the file jack_matchmaker-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for jack_matchmaker-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 335c96e5bd650c37f92a3cfbbee065d3c53e0ea2a7aa95fc8c6e0d9f953521ee
MD5 48f1bd7829ade559d85749aec94bcfb8
BLAKE2b-256 ba88bdbc5a53244548fd0b6ad73fca4ab70d5095367f94429d217e2351bd1d98

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page