xref: /netbsd-src/usr.bin/midirecord/midirecord.1 (revision cef8759bd76c1b621f8eab8faa6f208faabc2e15)
1.\"	$NetBSD: midirecord.1,v 1.8 2020/03/14 09:01:11 wiz Exp $
2.\"
3.\" Copyright (c) 1998, 1999, 2001, 2002, 2010, 2014, 2015, 2020 Matthew R. Green
4.\" All rights reserved.
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.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
20.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
22.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25.\" SUCH DAMAGE.
26.\"
27.Dd March 13, 2020
28.Dt MIDIRECORD 1
29.Os
30.Sh NAME
31.Nm midirecord
32.Nd record midi files
33.Sh SYNOPSIS
34.Nm
35.Op Fl aDfhoqV
36.Op Fl B Ar buffersize
37.Op Fl c Ar channels
38.Op Fl d Ar devices
39.Op Fl f Ar sequencerdev
40.Op Fl n Ar notesperbeat
41.Op Fl R Ar roundbeats
42.Op Fl r Ar raw_output
43.Op Fl T Ar tempo
44.Op Fl t Ar time
45.Ar file
46.Sh DESCRIPTION
47The
48.Nm
49program converts the sequencer events read on
50.Ar sequencerdev
51to the named MIDI SMF output.
52If the file name is \-, output will go to the standard output.
53By default, timing for events begins with the first event.
54The
55.Fl o
56flag may be used to start timing events at the process start up.
57.Sh OPTIONS
58The following options are available:
59.Bl -tag -width XnXnotesperbeatX
60.It Fl a
61Append to the specified file, rather than overwriting.
62.It Fl B Ar buffersize
63Set the sequencer device read buffer size to
64.Ar buffersize .
65The default value is 32768 bytes.
66.It Fl c Ar channels
67Sets the filter list of channels to
68.Ar channels ,
69which is a comma separated list of channels to filter in.
70.It Fl D
71Enable debug log.
72.It Fl d Ar devices
73Sets the filter list of devices to
74.Ar devices ,
75which is a comma separated list of devices to filter in.
76.It Fl f Ar sequencerdev
77Sets the sequencer device to use to
78.Ar sequencerdev .
79The default is
80.Pa /dev/music .
81.It Fl h
82Print a help message.
83.It Fl n Ar notesperbeat
84Sets the MIDI notes (clocks) per beat to
85.Ar notesperbeat .
86.It Fl o
87Start the relative timer at process start up instead of at
88the first event.
89.It Fl q
90Be quiet.
91.It Fl R Ar roundbeats
92Round timings to
93.Ar roundbeats
94of a note.
95Output will always be aligned to this many beats.
96.It Fl r Ar raw_output
97Create the raw output of the sequencer device in
98.Ar raw_output .
99.It Fl T Ar tempo
100Set the tempo for the recording to
101.Ar tempo .
102.It Fl t Ar time
103Sets the maximum amount of time to record.
104Format is [hh:]mm:ss[.dddddd].
105.It Fl V
106Be verbose.
107.El
108.Sh ENVIRONMENT
109.Bl -tag -width MIDIDEVICE
110.It Ev MIDIDEVICE
111the midi device to be used.
112.El
113.Sh EXAMPLES
114You can use
115.Nm
116to observe activity on a MIDI bus using the
117.Fl D
118and
119.Fl V
120options and learn about device-specific MIDI messages.
121.Pp
122For instance, to determine the MIDI messages needed to switch to ARP mode
123on a Korg minilogue XD synthesizer, which does not document any control
124change or non-registered parameter numbers for this function but does
125document that ARP is part of the
126.Dq VOICE TYPE MODE ,
127parameter these messages were seen:
128.Pp
129.Dl midi_event_chn_common_to_output:444: MIDI_CTL_CHANGE: channel 0 ctrl 62 val 10
130.Dl midi_event_chn_common_to_output:444: MIDI_CTL_CHANGE: channel 0 ctrl 6 val 1
131.Pp
132which shows that CC#62 (hexadecimal) was set to value 10 (also
133hexadecimal), and that CC#6 was set to value 1.
134As CC#62 is also the least significant byte of the non-registered
135parameter number, we can guess that NRPN 0,62 controls the
136.Dq VOICE MODE TYPE
137parameter documented in the synthesizer manual, and that the value 1
138set to CC#6 (Control Data Entry MSB) turns on ARP mode.
139For completeness, setting both CC#62 and CC#63 for the parameter
140number, as well as CC#6 and CC#26 (Control Data Entry MSB) to 0
141provides a complete NRPN control message.
142.Sh SEE ALSO
143.Xr midiplay 1 ,
144.Xr midi 4 ,
145.Xr sequencer 4
146.Sh HISTORY
147The
148.Nm
149program was first seen in
150.Nx 7 .
151.Sh AUTHORS
152The
153.Nm
154program was written by
155.An Matthew R. Green Aq Mt mrg@eterna.com.au .
156.Sh BUGS
157SYSEX, LOCAL and FULLSIZE messages are not currently handled, but the
158.Nx
159.Xr sequencer 4
160device does not generate them.
161.Pp
162.Nm
163will hang after the timeout waiting for the very next message before
164it will exit and finish writing the file.
165