.TH MIDIMODE 1 "MIDI"
.SH NAME
midimode - make all mode commands explicit
.SH SYNOPSIS
.B midimode
< file(s)
.SH DESCRIPTION
.I Midimode
inserts a mode command on every command that does not already
have one.  E.g. a sequence like:
.Cs
 0 90 3c 40 ;    0.000      0 kon   [ 60]=64  C4 key on
5d    3c  0 ;    0.775      1 koff  [ 60]=0   C4 key off
.Ce
becomes:
.Cs
 0 90 3c 40 ;    0.000      0 kon   [ 60]=64  C4 key on
5d 90 3c  0 ;    0.775      1 koff  [ 60]=0   C4 key off
.Ce
This is particularly useful for files in which editing will rearrange the
order of events.
.I Midimode
is also useful for preparing files to be processed by other
commands that do not understand mode commands well.
Channel numbers are "conserved"; for example:
.Cs
 0 90 37 40 ;    0.000      0 kon   [ 55]=64  G3 key on
 0 91 3c 40 ;    0.000      1 kon   [ 60]=64  C4 key on
5d    3c  0 ;    0.775      2 koff  [ 60]=0   C4 key off
.Ce
becomes:
.Cs
 0 90 37 40 ;    0.000      0 kon   [ 55]=64  G3 key on
 0 91 3c 40 ;    0.000      1 kon   [ 60]=64  C4 key on
5d 91 3c  0 ;    0.775      2 koff  [ 60]=0   C4 key off
.Ce
The command
.I mpuclean
can be used to remove the extra mode commands inserted by
.I midimode.
Thus,
.Cs
midimode <bach | mpuclean >newbach
.Ce
is almost a no-op.
.SH SEE ALSO
dack(1), mpuclean(1)
.SH AUTHOR
Peter Langston, Bell Communications Research
(bellcore!psl)
