---
name: "midi2mg"
section: "1"
platform: "linux"
package: "midge"
version: "0.2.41+dfsg-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/midi2mg"
---

# midi2mg(1)

convert a midi file into midge(1) text format.

## NAME

midi2mg - convert a midi file into [midge(1)](/midge/1.md) text format.

## SYNOPSIS

**midi2mg** \[ options \] midi\_file

## DESCRIPTION

**midi2mg** reads a midi file and writes its contents to a file in [midge(1)](/midge/1.md) text format. It prints a message to stdout for any midi events it can't handle.

## OPTIONS

**-h** or **--help**

-

  Display help text.

**-v** or **--verbose**

-

  Print verbose messages to stdout.

**-q** or **--quiet**

-

  Quiet. No stdout.

**-o file** or **--outfile file**

-

  Write output to **file**. Otherwise converts file.mid to file.mg Outputs to stdout if **file** is \`**-**'. When outputting to stdout quiet mode is automatically set unless verbose mode is set earlier on the command line.

**-w** or **--ignore-wrong-track**

-

  Ignore MIDI events on the wrong channel instead of exiting.

**-n i\[,j...\]** or **--include-tracks i\[,j...\]**

-

  Only convert the tracks in the comma separated list, with track numbers starting from 1.

**-N i\[,j...\]** or **--exclude-tracks i\[,j...\]**

-

  Convert all tracks **except** those specified in the comma separated list.

**-t** n or **--tuplet-factor** n

-

  An additional factor for files with odd note lengths, to prevent them being translated as decimals (**n** should be a prime number greater than 3).

**-F** or **--no-factorise**

-

  **Do not factorise time values (may help to decipher unusual tuplet** **values).**

## BUGS

**Does not correctly handle some text events.**

**Does not handle SMTPE style tempo events.**

**Does not handle changes of tempo/time\_sig/key if these are on a separate** **tempo track.**

## SEE ALSO

**[midge(1)](/midge/1.md)**

## AUTHOR

**David Riley \<dave@dmriley.demon.co.uk\>**
