1.\" $NetBSD: midi.4,v 1.12 1999/11/15 18:55:28 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 eap?" 45.Cd "midi* at mpu?" 46.Cd "midi* at opl?" 47.Cd "midi* at pcppi?" 48.Cd "midi* at sb?" 49.\" .Cd "midi* at wss?" 50.Cd "pseudo-device sequencer" 51.Pp 52.Fd #include <sys/types.h> 53.Fd #include <sys/midiio.h> 54.Sh DESCRIPTION 55The 56.Nm 57driver provides support for various MIDI peripherals. 58It provides a uniform programming interface layer above different 59underlying MIDI hardware drivers. The MIDI hardware can be of many 60different kinds, e.g., an external synthesizer on a MIDI port (or a serial port), 61the PC speaker, an internal 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. Data written is sent 70to the physical device as fast as possible and is uninterpreted. 71Reading from the device returns data as soon as it becomes available. 72A moderate amount of buffering is available both for reading and writing. 73The raw MIDI devices are mostly useful for non realtime operations, such as 74downloading patches to a device, since it is hard to get the accurate timing 75needed for quality music from a user program. But the devices can act as 76a simple patchboard for MIDI devices. For example, a MIDI keyboard could 77be connected to a synthesizer by the command 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/rmidiN 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 audio 4 , 100.Xr ioctl 2 , 101.Xr midiplay 1 , 102.Xr mpu 4 , 103.Xr opl 4 , 104.Xr ossaudio 3 . 105.br 106For ports using the ISA bus: 107.Xr mpu 4 , 108.Xr pcppi 4 , 109.Xr sb 4 110.Sh HISTORY 111The 112.Nm 113driver first appeared in 114.Nx 1.4 . 115.Sh BUGS 116This man page is very incomplete. 117.Pp 118