arecordmidi
Record MIDI data from a MIDI port
SYNOPSIS
arecordmidi [ -p port ] [ -d seconds ] [ -f format ] filename
PARAMETERS
-p port
Specifies the MIDI port to record from. The port argument is the ALSA port identifier (client:port). Use aconnect -l to list available MIDI ports.
-d seconds
Specifies the recording duration in seconds. If omitted, recording continues until interrupted (e.g., with Ctrl+C).
-f format
Specifies the MIDI file format. Supported formats are: 0, 1. Default is format 1.
filename
The name of the output MIDI file to create (SMF). If the file already exists, it will be overwritten.
DESCRIPTION
arecordmidi is a command-line utility for recording MIDI data from a connected MIDI port on a Linux system. It functions much like arecord for audio, but specifically for MIDI. It captures incoming MIDI messages from a specified MIDI input port and saves them to a standard MIDI file (SMF).
This tool is crucial for capturing MIDI performances from external MIDI controllers (keyboards, drum machines, etc.), MIDI interfaces, or other MIDI generating devices. The resulting MIDI file can then be loaded into a Digital Audio Workstation (DAW) or other MIDI editing software for further processing, arrangement, or playback. arecordmidi relies on ALSA (Advanced Linux Sound Architecture) for MIDI device access and supports different MIDI file formats, selectable through options.
CAVEATS
arecordmidi is designed specifically for MIDI data. It cannot record audio. Ensure the specified MIDI port is active and sending data. Overwriting existing MIDI files happens without warning.
EXAMPLES
To record MIDI data from port 14:0 to a file named mymusic.mid:
arecordmidi -p 14:0 mymusic.mid
To record for 10 seconds from port 24:0:
arecordmidi -d 10 -p 24:0 recording.mid