aconnect
Connect and disconnect ALSA MIDI ports
SYNOPSIS
aconnect [-dEeivVL] [-o|-i] [client:port] [client:port] ...
PARAMETERS
-d, --disconnect
Delete specified connection(s).
-e, --exclusive
Create exclusive connection (single input reader).
-E, --exclusive-unlock
Unlock previously exclusive connection.
-i, --input
List input ports only.
-o, --output
List output ports only (default).
-L, --list-connections
List current connections, not ports.
-v, --verbose
Enable verbose output.
-V, --version
Print version and exit.
-h, --help
Show usage help.
DESCRIPTION
aconnect is a command-line utility from the ALSA (Advanced Linux Sound Architecture) suite for listing, creating, and deleting connections between MIDI sequencer ports on Linux systems.
ALSA's sequencer provides a framework for routing MIDI events between software clients (like synthesizers, sequencers) and hardware devices. Each client has numbered ports; output ports send data, input ports receive it. Without connections, MIDI data doesn't flow between them.
Run aconnect alone or with -o to list output ports, -i for inputs, or -L for active connections. Connect ports with aconnect src_client:src_port dst_client:dst_port, enabling fan-out to multiple destinations. Use -d to disconnect, -e for exclusive links (single reader), or -E to unlock them.
Port IDs come from listings, e.g., 14:0 for a MIDI input, 128:0 for a virtual keyboard. Verbose mode (-v) aids debugging. Essential for MIDI routing in studios, it's lightweight and scriptable but requires ALSA permissions for some ports.
CAVEATS
Client/port numbers from listings; system ports may need elevated privileges. Connections persist until disconnected or clients exit. No GUI; use qjackctl or aconnectgui for visuals.
EXAMPLES
aconnect -o
List available output ports.
aconnect -i
List input ports.
aconnect -L
Show active connections.
aconnect 14:0 128:0
Route MIDI from hw client 14 port 0 to synth client 128 port 0.
aconnect -d 14:0 128:0
Disconnect.
PORT DISCOVERY
Ports shown as client_num:port_num (e.g., 128:0) or names if subscribed. Use aseqdump to monitor MIDI flow.
HISTORY
Introduced in ALSA 0.9.x (early 2000s) as part of alsa-utils; evolved with kernel sequencer API, now in alsa-utils 1.2.x for modern Linux distributions.


