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