1.\" $NetBSD: midi.4,v 1.5 1999/03/16 01:19:16 garbled Exp $ 2.\" Copyright (c) 1997 The NetBSD Foundation, Inc. 3.\" All rights reserved. 4.\" 5 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 3. All advertising materials mentioning features or use of this software 15.\" must display the following acknowledgement: 16.\" This product includes software developed by the NetBSD 17.\" Foundation, Inc. and its contributors. 18.\" 4. Neither the name of The NetBSD Foundation nor the names of its 19.\" contributors may be used to endorse or promote products derived 20.\" from this software without specific prior written permission. 21.\" 22.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 23.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 24.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 25.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 26.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 29.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 30.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 31.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32.\" POSSIBILITY OF SUCH DAMAGE. 33.\" 34.Dd August 6, 1998 35.Dt MIDI 4 36.Os 37.Sh NAME 38.Nm midi 39.Nd device-independent MIDI driver layer 40.Sh SYNOPSIS 41.Cd "midi* at opl?" 42.Cd "midi* at pcppi?" 43.Cd "midi* at sb?" 44.Cd "midi* at wss?" 45.Cd "pseudo-device sequencer" 46.Pp 47.Fd #include <sys/types.h> 48.Fd #include <sys/midiio.h> 49.Sh DESCRIPTION 50The 51.Nm 52driver provides support for various MIDI peripherals. 53It provides a uniform programming interface layer above different 54underlying MIDI hardware drivers. The MIDI hardware can be of many 55different kinds, e.g., an external synthesizer on a MIDI port (or a serial port), 56the PC speaker, an internal FM synth, or a wavetable synth. 57.Pp 58There are two device file types available for MIDI operation: 59.Pa /dev/rmidiN , 60and 61.Pa /dev/music . 62The 63.Pa /dev/rmidiN 64devices provides raw access to a MIDI device. Data written is sent 65to the physical device as fast as possible and is uninterpreted. 66Reading from the device returns data as soon as it becomes available. 67A moderate amount of buffering is available both for reading and writing. 68The raw MIDI devices are mostly useful for non realtime operations, such as 69downloading patches to a device, since it is hard to get the accurate timing 70needed for quality music from a user program. But the devices can act as 71a simple patchboard for MIDI devices. For example, a MIDI keyboard could 72be connected to a synthesizer by the command 73.Cd "cat -u /dev/rmidi1 >/dev/rmidi2" 74.Pp 75The 76.Pa /dev/music 77device is a MIDI sequencer device. Data sent to and from this device 78not only contains the information sent to the MIDI device, but also 79timing information. The kernel will make sure that data is sent 80to the physical device at the indicated time. The sequencer device 81uses the 82.Pa /dev/midiN 83devices internally and they are unavailable when used by the sequencer. 84.Pp 85The API for the sequencer device is binary compatible with the OSS sequencer 86interface. 87.Sh FILES 88.Bl -tag -width /dev/sequencer -compact 89.It Pa /dev/rmidiN 90.It Pa /dev/music 91.It Pa /dev/sequencer 92.El 93.Sh SEE ALSO 94.Xr audio 4 , 95.Xr ioctl 2 , 96.Xr midiplay 1 , 97.Xr opl 4 , 98.Xr ossaudio 3 . 99.br 100For ports using the ISA bus: 101.Xr pcppi 4 , 102.Xr sb 4 , 103.Xr wss 4 . 104.Sh HISTORY 105The 106.Nm 107driver first appeared in 108.Nx 1.4 . 109.Sh BUGS 110This man page is very incomplete. 111.Pp 112