arecordmidi Command in Linux with Examples

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.

Syntax:

arecordmidi -p client:port[,...] [options] midifile

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.

Options:



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.

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.