---
name: "smfrec"
section: "1"
platform: "linux"
package: "midish"
version: "1.5.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/smfrec"
---

# smfrec(1)

record a standard MIDI file

## NAME

**smfrec** – record a standard MIDI file

## SYNOPSIS

**smfrec** \[**-amxy**\] \[**-g** *measure*\] \[**-d** *devname*\] \[**-i** *devname*\] midifile

## DESCRIPTION

The **smfrec** utility records a MIDI file. It can add recorded events on top of an existing midi file. To stop performance, send an interrupt signal to **smfrec** (for instance by pressing control ^C on the terminal). The options are as follows:

- **-a**

  Append mode. Play the given midi file and append to it a new track containing recorded events.

- **-m**

  Use metronome.

- **-x**

  Synchronise to the default [midi(4)](/midi/4.md) device instead of using an internal clock source.

- **-y**

  Send midi timing information to the default device. Useful if it is a slave MIDI sequencer.

- **-g** *measure*

  Start playback and recording at the given measure number.

- **-d** *filename*

  Default [midi(4)](/midi/4.md) device from which to record and on which to send midi events. If not specified, the content of the MIDIDEV environment variable will be used instead.

- **-i** *filename*

  Alternate input [midi(4)](/midi/4.md) device. Voice events (notes, controllers, etc) received on the input device will be recorded and sent as-is to the default device. Without this flag, the default device will be used for input.

The **smfrec** utility is an interface to [midish(1)](/midish/1.md). If more specific features are needed, the user may consider using [midish(1)](/midish/1.md).

## EXAMPLES

The following will play *mysong.mid* and append to it recorded events from device */dev/rmidi4*; metronome will be used.

```
$ smfrec -a -m -d /dev/rmidi4 mysong.mid
```

## SEE ALSO

[midish(1)](/midish/1.md), [smfplay(1)](/smfplay/1.md), [midi(4)](/midi/4.md)
