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