---
name: "tmrec"
section: "1"
platform: "linux"
package: "tclmidi"
version: "3.1-4"
release: "Debian 2.1 (Slink)"
platforms: ["linux"]
url: "https://new.carta.tech/tmrec"
---

# tmrec(1)

a tclmidi script to record a MIDI file

## NAME

**tmrec** – a tclmidi script to record a MIDI file

## SYNOPSIS

**tmrec** \[**-dev** **-DevicePath**\] \[**-merge**\] \[**-thru**\]\[ \[**-repeat**\] **-play** *play\_filename*\] \[**-tempo** *tempo*\] \[rec\_filename\]

## DESCRIPTION

**tmrec** is a [tclmidi(1)](/tclmidi/1.md) script that records a MIDI file while optionally simultaneously playing another MIDI file. If a record filename is not specified, the recorded MIDI file will be written to stdout. By default **tmrec** creates a format 0 MIDI file containing the recorded events and any meta events found in the optional play file. The options are as follows:

- **-dev** **-DevicePath**

  Use DeviceName as the device instead of the default */dev/midi0*.

- **-thru**

  If this flag is specified, data arriving at the MIDI IN port will be passed to the MIDI OUT port. By default, the data is not passed.

- **-merge**

  With this option, **tmrec** will create a format 1 MIDI file from a combination of the newly recorded events and the tracks contained in the optional play file. If the play file is a format 0 file, it will be split into a format 1 file. The recorded events will appear as a new track after all the tracks found in the play file.

- **-repeat**

  This option specifies that the play file should be repeated until recording is finished. It is only valid with the **-play** option.

- **-play**

  This option specifies that another MIDI file should be played while recording.

- **-tempo**

  This option specifies the tempo to use for recording. It is only valid if a play file is not specified. If a play file is specified, tempos are taken from it instead. The default tempo is 120 bpm.

If a play song is specified, a message will be printed saying the file is being loaded. Once loaded, the program will wait for the return key to be pressed before beginning to record. If a play file is specified and is not playing in repeat mode, recording will stop when the play file ends. Otherwise, recording stops when a return key is pressed.

Since **tmrec** makes use of the midirecord(n) [tclmidi(1)](/tclmidi/1.md) command, this program will only work if [tclmidi(1)](/tclmidi/1.md) was compiled with a device interface.

## SEE ALSO

[tclmidi(1)](/tclmidi/1.md), midirecord(n)

## AUTHORS

Mike Durian - durian@boogie.com
