shithub: riscv

ref: a54fcac01609be9438f6fb05b4da4be01c303383
dir: /sys/man/1/dmid/

View raw version
.TH DMID 1
.SH NAME
dmid \- MIDI to OPL3 converter using GENMIDI-type instrument banks
.SH SYNOPSIS
.B dmid
[
.B -2s
] [
.B -i
.I bank
] [
.I file
]
.SH DESCRIPTION
.I Dmid
decodes MIDI instructions either from
.I file
or from standard input,
and produces
.SM OPL3
instructions suitable for playback by
.IR opl3 (1).
To program instruments, an
.SM OPL2
instrument bank in the same format as
.SM GENMIDI
lumps from
.I doom
must be provided.
Since it is assumed that the bank is contained in a
.I doom WAD
file, its default location is
.BR /mnt/wad/genmidi .
This may be overridden with the
.B -i
command line option.
.PP
The
.B -s
flag enables streaming mode,
in which the input is a
.IR pipe (3)
streaming MIDI events.
It needn't provide any timing information such as MIDI timing clocks.
This is suitable for MIDI devices transmitting in real time.
.PP
In
.SM GENMIDI
lumps, two voices are defined per instrument.
For compatibility, the
.B -2
flag disables the second voice, reducing the number of
.SM OPL
channels needed.
It also disables
.SM OPL3
specific features and produces an IMF-format stream,
which can be used in other game engines.
.SH EXAMPLES
Play a MUS file from a
.I doom WAD
file:
.IP
.EX
% games/wadfs /sys/games/lib/doom/doom1.wad >[2]/dev/null
% games/mus /mnt/wad/d_e1m8 | games/dmid | games/opl3 >/dev/audio
.EE
.PP
Play a MIDI stream from a USB device (see
.IR usb (3)):
.IP
.EX
% games/wadfs /sys/games/lib/doom/doom1.wad >[2]/dev/null
% games/dmid -s /dev/usb/ep10.1/data | games/opl3 -s >/dev/audio
.EE
.SH SOURCE
.B /sys/src/games/midi/dmid.c
.SH "SEE ALSO"
.IR games (1) ,
.IR mus (1) ,
.IR opl3 (1) ,
.IR audio (3) ,
.IR pipe (3) ,
.IR usb (3) ,
.IR wadfs (4)
.SH HISTORY
.I Dmid
first appeared in 9front (July, 2018).