xref: /openbsd-src/share/man/man4/midi.4 (revision 8500990981f885cbe5e6a4958549cacc238b5ae6)
1.\" $OpenBSD: midi.4,v 1.16 2003/11/08 19:19:58 jmc 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.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\" 3. All advertising materials mentioning features or use of this software
16.\"    must display the following acknowledgement:
17.\"        This product includes software developed by the NetBSD
18.\"        Foundation, Inc. and its contributors.
19.\" 4. Neither the name of The NetBSD Foundation nor the names of its
20.\"    contributors may be used to endorse or promote products derived
21.\"    from this software without specific prior written permission.
22.\"
23.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
24.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
25.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
26.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
27.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33.\" POSSIBILITY OF SUCH DAMAGE.
34.\"
35.Dd August 6, 1998
36.Dt MIDI 4
37.Os
38.Sh NAME
39.Nm midi
40.Nd device-independent MIDI driver layer
41.Sh SYNOPSIS
42.Cd "midi* at autri?"
43.Cd "midi* at mpu?"
44.Cd "midi* at opl?"
45.Cd "midi* at pcppi?"
46.Cd "midi* at sb?"
47.Cd "midi* at wss?"
48.Pp
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.Dl $ 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 mpu 4 ,
109.Xr opl 4 ,
110.Xr pcppi 4 ,
111.Xr sb 4 ,
112.Xr wss 4 ,
113.Xr ym 4
114.Sh HISTORY
115The
116.Nm
117driver first appeared in
118.Nx 1.4 .
119