.TH RTLOOP 1 "MIDI"
.SH NAME
rtloop \- Convert ``MPU'' files to ``raw'' files & loop them
.SH SYNOPSIS
.B rtloop
[#] [\fB\-t\fP#] [\fB\-dt\fP#] [\fB\-w\fP#] <input >output
.SH DESCRIPTION
.I Rtloop
is a filter that converts time-tagged MIDI data streams
(as produced by record(1) and defined in the \fIRoland MPU-401
Technical Reference Manual\fP)
into
timed, un-tagged MIDI data streams.
Further, \fIrtloop\fP can repeat the data stream an arbitrary number of times.
.PP
Timing of the output is handled through BSD UNIX interval timers
(getitimer(2) & setitimer(2)), which means a quiescent system is
essential for metrical accuracy.
.PP
The optional arguments are:
.IP #
Limit the number of repeats to #.  With no number specified, \fIrtloop\fP
will try to generate data forever.  A limit of 0 is also forever.
.IP \fB\-t\fP#
Set the tempo (beats per minute) to #.
The default is 100.
Because the MPU defines the number of MPU clocks per beat to be 120,
the relationship between MPU clocks, tempo, and time is:
.ft B
MPU clocks = 2 * tempo * seconds
.ft P
.IP \fB\-dt\fP#
Change the tempo by # after each repeat.
For example:
.ft B
rtloop 5 -dt5 <x >xx
.ft P
will go through x the first time at tempo 100, then 105, 110, 115, and finally
at 120.
.IP \fB\-w\fP#
Wait for # seconds before generating any output.  This is often handy in
pipelines where other programs may not start up as quickly as \fIrtloop\fP,
(e.g. mixplay(1) which automatically does a two-second sleep to allow pipes
to start flowing).
.SH SEE ALSO
mixplay(1), mixer(1),
.br
\fIRoland MPU-401 Technical Reference Manual\fP.
.SH AUTHOR
Peter Langston, Bell Communications Research
(bellcore!psl)
