Open In App

arecordmidi Command in Linux with Examples

Last Updated : 08 Oct, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

arecordmidi command in Linux is a utility command which is used to record a standard MIDI file from any number of ALSA sequencer ports. ALSA stands for Advanced Linux Sound Architecture which is a software framework built into the Linux kernel. The ALSA sequencer interface provides a platform to deliver MIDI-like events between clients and ports.

The arecordmidi command is particularly useful for musicians and developers working with MIDI data, allowing them to capture MIDI events directly from hardware or software instruments connected to the ALSA sequencer.

Syntax

arecordmidi -p client:port[,...] [options] midifile
  • -p client:port: This option is mandatory and specifies the client and port from which the MIDI data will be recorded.
  • midifile: This is the name of the MIDI file where the recorded data will be saved.

Basic Example

arecordmidi -p 14:0 geeks.midi

The above command records from port 14:0 into the geeks.midi file. Recording continues until Ctrl+C is pressed by the user. No output is displayed for this command. The -p option is mandatory which specifies the client port.

Key Options for the arecordmidi Command

1. -l Option (List):

This option is used to display all the possible input ports to the user.

arecordmidi -l

2. -b Option (Beats - Musical Tempo):

In the below example,  recording takes place from port 14:0 and is saved to geek.midi file with a tempo of 150 beats per minute.

arecordmidi -p 14:0 -b 150 geek.midi

No verbal output is displayed for this command in the terminal. The recording continues until stopped.

3. -f Option (Frame):

arecordmidi -p 14:0 -f 25 geek.midi

In this particular example, recording happens from input port 14:0 and is saved to geek.midi file with a configuration of 25 frames per second.

No verbal output is displayed for this command in the terminal. The recording continues until stopped.

4. -m Option (Metronome):

arecordmidi -p 14:0 -m 14:0 geek.midi

In this particular example, a metronome signal is given to port 14:0. No verbal output is displayed for this command in the terminal. The recording continues until stopped.

Conclusion

The arecordmidi command provides a robust and flexible way to record MIDI data on Linux systems. If you're a musician looking to capture performances or a developer testing MIDI-enabled software, arecordmidi offers the necessary tools to get the job done. By specifying the correct options, you can tailor the recording process to suit your needs, whether it's setting the tempo, adjusting the frame rate, or using a metronome to guide your timing.


Similar Reads