> For the complete documentation index, see [llms.txt](https://linux-tutorial-cli.gitbook.io/linux-cli-tutorial/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://linux-tutorial-cli.gitbook.io/linux-cli-tutorial/txt-files/arecordmidi.md).

# arecordmidi

`arecordmidi` is a command-line utility that can be used to record MIDI data on Linux systems. It is part of the `alsa-utils` package, which is installed by default on most Linux distributions.

The `arecordmidi` command is used as follows:

```
arecordmidi [options] [output file]
```

* `options`: These are optional flags that can be used to control the behavior of the `arecordmidi` command.
* `output file`: This is the file that the MIDI data will be recorded to. If no output file is specified, the MIDI data will be played back through the MIDI output device.

The `arecordmidi` command has a number of options that can be used to control the recording process. Some of the most commonly used `arecordmidi` options are:

* `-r`: This option specifies the sampling rate of the recording. The default sampling rate is 44.1 kHz.
* `-c`: This option specifies the number of channels in the recording. The default number of channels is 1 (mono).
* `-d`: This option specifies the duration of the recording in seconds. If no duration is specified, the recording will continue until it is stopped manually.

For example, the following command will record MIDI data for 10 seconds and save it to the file `myrecording.mid`:

```
arecordmidi -r 44100 -c 1 -d 10 myrecording.mid
```

The `arecordmidi` command is a powerful tool that can be used to record MIDI data on Linux systems. It is a valuable tool for anyone who wants to record MIDI data for any purpose, such as creating music or composing soundtracks.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://linux-tutorial-cli.gitbook.io/linux-cli-tutorial/txt-files/arecordmidi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
