LinuxCommandLibrary

midisnoop

Monitor MIDI events

SYNOPSIS

midisnoop [OPTION...] [CLIENT:PORT...]

PARAMETERS

-d, --dump
    Dumps raw MIDI bytes as hexadecimal values. This option is useful for low-level debugging and examining the exact byte stream of MIDI messages.

-l, --list-ports
    Lists all available ALSA MIDI sequencer ports, showing their client and port IDs. This is useful for identifying which ports to connect to for monitoring.

-c client:port, --connect=client:port
    Connects to a specific ALSA MIDI port to snoop its events. Multiple ports can be specified by repeating this option or by listing them as arguments after options.

-p, --parse
    Parses and displays MIDI messages in a human-readable, symbolic format (e.g., 'Note On', 'Control Change'). This is the default behavior if no other output option (like -d or -m) is specified.

-m, --midi-dump
    Dumps MIDI messages with their types and basic parameters. Offers a more structured view of messages compared to a raw byte dump (-d) but less detailed parsing than -p.

-v, --version
    Displays the version information of midisnoop.

-h, --help
    Displays a concise help message, outlining command usage and available options.

DESCRIPTION

midisnoop is a lightweight command-line utility designed to monitor and display ALSA MIDI events in real-time. It acts as a passive "snooper," capturing MIDI data streams from specified ALSA sequencer ports and presenting them in a human-readable format. This tool is invaluable for diagnosing MIDI setups, verifying the correct transmission of MIDI messages from hardware devices or software applications, and understanding the flow of MIDI signals within a Linux audio environment. It can interpret and display various MIDI message types, including Note On/Off, Control Change, Program Change, Pitch Bend, System Exclusive (SysEx) messages, and more. Because it only observes and does not alter the MIDI stream, midisnoop is a safe and non-intrusive diagnostic tool. Users can specify input ports by name or ID, list available ports, and choose between detailed parsed output or raw byte dumps. It's an essential utility for musicians, audio engineers, and developers working with MIDI on Linux.

CAVEATS

midisnoop primarily operates within the ALSA MIDI subsystem; it does not directly interact with JACK MIDI or other MIDI layers without appropriate ALSA-to-JACK bridges.
The output can become very verbose with high MIDI traffic, potentially scrolling rapidly.
It is a monitoring tool only and cannot send or modify MIDI messages.

CONNECTING TO PORTS

To monitor MIDI events, midisnoop needs to connect to an ALSA MIDI port. You can find available ports using the -l option (e.g., midisnoop -l). Once you have the client:port ID (for example, "14:0" for "Midi Through:Midi Through Port-0"), you can specify it as an argument (e.g., midisnoop 14:0) or using the -c option (e.g., midisnoop -c 14:0). If no port is specified, midisnoop typically attempts to connect to all readable ports or waits for new connections, depending on its version and configuration.

INTERPRETING OUTPUT

The default output (achieved with -p or implicitly) displays parsed MIDI messages, including event types (e.g., "Note On", "Control Change"), channel numbers, and relevant data values (e.g., note number, velocity, controller number, value). System Exclusive (SysEx) messages are usually shown as sequences of hexadecimal bytes, often prefixed with 'F0' and suffixed with 'F7', representing the start and end of a SysEx message, respectively.

HISTORY

midisnoop is an integral part of the ALSA (Advanced Linux Sound Architecture) utilities package. It was developed to serve as a crucial diagnostic tool alongside the evolution of ALSA's MIDI sequencer capabilities, offering a command-line interface for real-time MIDI event inspection. Its continued maintenance and usage reflect ALSA's enduring role as the standard sound system for professional audio and MIDI operations on Linux.

SEE ALSO

Copied to clipboard