xref: /openbsd-src/share/man/man4/midi.4 (revision 3a3fbb3f2e2521ab7c4a56b7ff7462ebd9095ec5)
1.\" $OpenBSD: midi.4,v 1.9 2001/11/26 16:51:48 mickey 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.
59The MIDI hardware can be of many different kinds, e.g., an external
60synthesizer on a MIDI port (or a serial port), the PC speaker, an
61internal FM synth, or a wavetable synth.
62.Pp
63There are two device file types available for MIDI operation:
64.Pa /dev/rmidiN ,
65and
66.Pa /dev/music .
67The
68.Pa /dev/rmidiN
69devices provides raw access to a MIDI device.
70Data written is sent to the physical device as fast as possible and
71is uninterpreted.
72Reading from the device returns data as soon as it becomes available.
73A moderate amount of buffering is available both for reading and writing.
74The raw MIDI devices are mostly useful for non realtime operations, such as
75downloading patches to a device, since it is hard to get the accurate timing
76needed for quality music from a user program.
77But the devices can act as a simple patchboard for MIDI devices.
78For example, a MIDI keyboard could be connected to a synthesizer by
79the command
80.Pp
81.Cd "cat -u /dev/rmidi1 >/dev/rmidi2"
82.Pp
83The
84.Pa /dev/music
85device is a MIDI sequencer device.
86Data sent to and from this device not only contains the information sent to the
87MIDI device, but also timing information.
88The kernel will make sure that data is sent to the physical device at the
89indicated time.
90The sequencer device uses the
91.Pa /dev/midiN
92devices internally and they are unavailable when used by the sequencer.
93.Pp
94The API for the sequencer device is binary compatible with the OSS sequencer
95interface.
96.Sh FILES
97.Bl -tag -width /dev/sequencer -compact
98.It Pa /dev/rmidiN
99.It Pa /dev/music
100.It Pa /dev/sequencer
101.El
102.Sh SEE ALSO
103.Xr midiplay 1 ,
104.Xr ioctl 2 ,
105.Xr ossaudio 3 ,
106.Xr audio 4 ,
107.Xr autri 4 ,
108.Xr opl 4 ,
109.Xr pcppi 4 ,
110.Xr sb 4 ,
111.Xr wss 4
112.Sh HISTORY
113The
114.Nm
115driver first appeared in
116.Nx 1.4 .
117