aconnect is a utility to connect and disconnect two existing ports on ALSA sequencer system. The ports with the arbitrary subscription permission, such as created by aseqview(1), can be connected to any (MIDI) device ports using aconnect. For example, to connect from port 64:0 to 65:0, run as follows:
- % aconnect 64:0 65:0
The connection is one-way, and the whole data to the sender port (64:0) is redirected to the receiver port (65:0). When another port (e.g. 65:1) is attached to the same sender port, the data is sent to both receiver ports. For disconnection, use -d option.
% aconnect -d 64:0 65:0
The address can be given using the client's name.
% aconnect External:0 Emu8000:1
Then the port 0 of the client matching with the string "External" is connected to the port 1 of the client matching with the "Emu8000".
Another function of aconnect is to list the present ports on the given condition. The input ports, which may become sender ports, can be listed with -i option.
% aconnect -i client 0: 'System' [type=kernel] 0 'Timer ' 1 'Announce ' client 64: 'External MIDI-0' [type=kernel] 0 'MIDI 0-0 '
Similarly, to see the output ports, use -o flag.
You can remove all existing exported connections using -x option. This function is useful for terminating the ALSA drivers, because the modules with sequencer connections cannot be unloaded unless their connections are removed.