1.\" $NetBSD: midiplay.1,v 1.21 2018/05/03 05:13:20 wiz Exp $ 2.\" 3.\" Copyright (c) 1998 The NetBSD Foundation, Inc. 4.\" All rights reserved. 5.\" 6.\" Author: Lennart Augustsson 7.\" 8.\" Redistribution and use in source and binary forms, with or without 9.\" modification, are permitted provided that the following conditions 10.\" are met: 11.\" 1. Redistributions of source code must retain the above copyright 12.\" notice, this list of conditions and the following disclaimer. 13.\" 2. Redistributions in binary form must reproduce the above copyright 14.\" notice, this list of conditions and the following disclaimer in the 15.\" documentation and/or other materials provided with the distribution. 16.\" 17.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 18.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 19.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 21.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27.\" POSSIBILITY OF SUCH DAMAGE. 28.\" 29.Dd May 2, 2018 30.Dt MIDIPLAY 1 31.Os 32.Sh NAME 33.Nm midiplay 34.Nd play MIDI and RMID files 35.Sh SYNOPSIS 36.Nm 37.Op Fl lmqsvx 38.Op Fl d Ar devno 39.Op Fl f Ar file 40.Op Fl p Ar pgm 41.Op Fl t Ar tempo 42.Op Ar file ... 43.Sh DESCRIPTION 44The 45.Nm 46command plays MIDI and RMID files using the sequencer device. 47If no file name is given it will play from standard input, otherwise 48it will play the named files. 49.Pp 50RMID files are Standard MIDI Files embedded in a RIFF container and 51can usually be found with the 52.Sq rmi 53extension. 54They contain some 55additional information in other chunks which are not parsed by 56.Nm 57yet. 58.Pp 59The program accepts the following options: 60.Bl -tag -width Fl 61.It Fl d Ar devno 62specifies the number of the MIDI device used for output (as listed 63by the 64.Fl l 65flag). 66There is no way at present to have 67.Nm 68map playback to more than one device. 69The default is device is given by environment variable 70.Ev MIDIUNIT . 71.It Fl f Ar file 72specifies the name of the sequencer device. 73.It Fl l 74list the possible devices without playing anything. 75.It Fl m 76show MIDI file meta events (copyright, lyrics, etc). 77.It Fl p Ar pgm 78force all channels to play with the single specified 79program (or instrument patch, range 1-128). 80Program change events in the file will be suppressed. 81There is no way at present to have 82.Nm 83selectively map channels or instruments. 84.It Fl q 85specifies that the MIDI file should not be played, just parsed. 86.It Fl s 87send an 88.Dq ALL SOUNDS OFF 89MIDI event. 90Useful if an interrupted MIDI file left notes playing. 91.It Fl t Ar tempo-adjust 92specifies an adjustment (in percent) to the tempi recorded in the file. 93The default of 100 plays as specified in the file, 50 halves every tempo, 94and so on. 95.It Fl v 96be verbose. 97If the flag is repeated the verbosity increases. 98.It Fl x 99play a small sample sound instead of a file. 100.El 101.Pp 102A file containing no tempo indication will be played as if it specified 103150 beats per minute. 104You have been warned. 105.Sh ENVIRONMENT 106.Bl -tag -width MIDIUNIT 107.It Ev MIDIUNIT 108the default number of the MIDI device used for output. 109The default is 0. 110.El 111.Sh FILES 112.Bl -tag -width /dev/music 113.It Pa /dev/music 114MIDI sequencer device 115.El 116.Sh SEE ALSO 117.Xr midi 4 118.Sh HISTORY 119The 120.Nm 121command first appeared in 122.Nx 1.4 . 123.Sh BUGS 124It may take a long while before playing stops when 125.Nm 126is interrupted, as the data already buffered in the sequencer will contain 127timing events. 128Use 129.Nm 130with the 131.Fl s 132option to silence any sounds left after an interrupted call. 133