1.\" $NetBSD: midi.4,v 1.15 2000/08/01 08:19:39 augustss 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 cms?" 45.Cd "midi* at clcs?" 46.Cd "midi* at eap?" 47.Cd "midi* at mpu?" 48.Cd "midi* at opl?" 49.Cd "midi* at pcppi?" 50.Cd "midi* at sb?" 51.\" .Cd "midi* at wss?" 52.Cd "pseudo-device sequencer" 53.Pp 54.Fd #include <sys/types.h> 55.Fd #include <sys/midiio.h> 56.Sh DESCRIPTION 57The 58.Nm 59driver provides support for various MIDI peripherals. 60It provides a uniform programming interface layer above different 61underlying MIDI hardware drivers. The MIDI hardware can be of many 62different kinds, e.g., an external synthesizer on a MIDI port (or a serial port), 63the PC speaker, an internal FM synth, or a wavetable synth. 64.Pp 65There are two device file types available for MIDI operation: 66.Pa /dev/rmidiN , 67and 68.Pa /dev/music . 69The 70.Pa /dev/rmidiN 71devices provides raw access to a MIDI device. Data written is sent 72to the physical device as fast as possible and is uninterpreted. 73Reading from the device returns data as soon as it becomes available. 74A moderate amount of buffering is available both for reading and writing. 75The raw MIDI devices are mostly useful for non realtime operations, such as 76downloading patches to a device, since it is hard to get the accurate timing 77needed for quality music from a user program. But the devices can act as 78a simple patchboard for MIDI devices. For example, a MIDI keyboard could 79be connected to a synthesizer by the command 80.Cd "cat -u /dev/rmidi1 >/dev/rmidi2" 81.Pp 82The 83.Pa /dev/music 84device is a MIDI sequencer device. Data sent to and from this device 85not only contains the information sent to the MIDI device, but also 86timing information. The kernel will make sure that data is sent 87to the physical device at the indicated time. The sequencer device 88uses the 89.Pa /dev/rmidiN 90devices internally and they are unavailable when used by the sequencer. 91.Pp 92The API for the sequencer device is binary compatible with the OSS sequencer 93interface. 94.Sh FILES 95.Bl -tag -width /dev/sequencer -compact 96.It Pa /dev/rmidiN 97.It Pa /dev/music 98.It Pa /dev/sequencer 99.El 100.Sh SEE ALSO 101.Xr audio 4 , 102.Xr ioctl 2 , 103.Xr midiplay 1 , 104.Xr mpu 4 , 105.Xr opl 4 , 106.Xr ossaudio 3 . 107.br 108For ports using the ISA bus: 109.Xr cms 4 , 110.Xr pcppi 4 , 111.Xr sb 4 112.br 113For ports using the PCI bus: 114.Xr clcs 4 , 115.Xr eap 4 116.Sh HISTORY 117The 118.Nm 119driver first appeared in 120.Nx 1.4 . 121.Sh BUGS 122This man page is very incomplete. 123.Pp 124