xref: /netbsd/share/man/man4/midi.4 (revision bf9ec67e)
1.\" $NetBSD: midi.4,v 1.22 2002/02/13 08:17:41 ross Exp $
2.\"
3.\" Copyright (c) 1999 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Lennart Augustsson.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\" 3. All advertising materials mentioning features or use of this software
18.\"    must display the following acknowledgement:
19.\"        This product includes software developed by the NetBSD
20.\"        Foundation, Inc. and its contributors.
21.\" 4. Neither the name of The NetBSD Foundation nor the names of its
22.\"    contributors may be used to endorse or promote products derived
23.\"    from this software without specific prior written permission.
24.\"
25.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
26.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
29.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35.\" POSSIBILITY OF SUCH DAMAGE.
36.\"
37.Dd August 6, 1998
38.Dt MIDI 4
39.Os
40.Sh NAME
41.Nm midi
42.Nd device-independent MIDI driver layer
43.Sh SYNOPSIS
44.Cd "midi* at autri?"
45.Cd "midi* at cms?"
46.Cd "midi* at clcs?"
47.\" .Cd "midi* at clct?"
48.Cd "midi* at eap?"
49.Cd "midi* at mpu?"
50.Cd "midi* at opl?"
51.Cd "midi* at pcppi?"
52.Cd "midi* at sb?"
53.Cd "midi* at umidi?"
54.\" .Cd "midi* at wss?"
55.Cd "pseudo-device sequencer"
56.Pp
57.Fd #include \*[Lt]sys/types.h\*[Gt]
58.Fd #include \*[Lt]sys/midiio.h\*[Gt]
59.Sh DESCRIPTION
60The
61.Nm
62driver provides support for various MIDI peripherals.
63It provides a uniform programming interface layer above different
64underlying MIDI hardware drivers.  The MIDI hardware can be of many
65different kinds, e.g., an external synthesizer on a MIDI port (or a serial port),
66the PC speaker, an internal FM synth, or a wavetable synth.
67.Pp
68There are two device file types available for MIDI operation:
69.Pa /dev/rmidiN ,
70and
71.Pa /dev/music .
72The
73.Pa /dev/rmidiN
74devices provides raw access to a MIDI device.  Data written is sent
75to the physical device as fast as possible and is uninterpreted.
76Reading from the device returns data as soon as it becomes available.
77A moderate amount of buffering is available both for reading and writing.
78The raw MIDI devices are mostly useful for non realtime operations, such as
79downloading patches to a device, since it is hard to get the accurate timing
80needed for quality music from a user program.  But the devices can act as
81a simple patchboard for MIDI devices.  For example, a MIDI keyboard could
82be connected to a synthesizer by the command
83.Cd "cat -u /dev/rmidi1 \*[Gt]/dev/rmidi2"
84.Pp
85The
86.Pa /dev/music
87device is a MIDI sequencer device.  Data sent to and from this device
88not only contains the information sent to the MIDI device, but also
89timing information.  The kernel will make sure that data is sent
90to the physical device at the indicated time.  The sequencer device
91uses the
92.Pa /dev/rmidiN
93devices internally and they are unavailable when used by the sequencer.
94.Pp
95The API for the sequencer device is binary compatible with the OSS sequencer
96interface.
97.Sh FILES
98.Bl -tag -width /dev/sequencer -compact
99.It Pa /dev/rmidiN
100.It Pa /dev/music
101.It Pa /dev/sequencer
102.El
103.Sh SEE ALSO
104.Xr midiplay 1 ,
105.Xr ioctl 2 ,
106.Xr ossaudio 3 ,
107.Xr audio 4 ,
108.Xr mpu 4 ,
109.Xr opl 4 ,
110.Xr umidi 4
111.br
112For ports using the ISA bus:
113.Xr cms 4 ,
114.Xr pcppi 4 ,
115.Xr sb 4
116.br
117For ports using the PCI bus:
118.Xr autri 4 ,
119.Xr clcs 4 ,
120.Xr eap 4
121.Sh HISTORY
122The
123.Nm
124driver first appeared in
125.Nx 1.4 .
126.Sh BUGS
127This man page is very incomplete.
128