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