| 1 |
.TH MIDI2ABC 1 "20 January 2025" |
| 2 |
.SH NAME |
| 3 |
\fBmidi2abc\fP \- program to convert MIDI format files to abc notation |
| 4 |
.SH SYNOPSIS |
| 5 |
midi2abc \-f \fIinfile\fP [\-xa] [\-ga] |
| 6 |
[\-a \fIacbeats\fP] [\-m \fItime signature\fP] |
| 7 |
[\-ppu \fiparts per unit\fP] [\-aul \fidenominator of unit length\fP] |
| 8 |
[\-gu] [\-b \fIbars\fP] [\-Q \fItempo\fP] [\-u \fipulses\fP] |
| 9 |
[\-k \fIkey\fP] [\-c \fIchannel\fP] [\-obpl] [\-bpl \fibars\fP] [\-bps \fPbars\fP] |
| 10 |
[\-o \fIfilename\fP] [\-s] [\-sr \fiunits\fP] [\-sum] [\-nb] [\-nt] |
| 11 |
[\-splitvoices] [\-midigram] [\-mftext] [-mftextpulses] [\-nogr] [\-title \fistring\fP] |
| 12 |
[\-origin \fistring\fP][\-midinotes] |
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
.SH DESCRIPTION |
| 18 |
\fImidi2abc\fP takes a MIDI format file and converts it to something as close |
| 19 |
as possible to abc text format. The user then has to add text fields not |
| 20 |
present in the MIDI header and possibly tidy up the abc note output. |
| 21 |
.PP |
| 22 |
The output of midi2abc is printed to the screen. To save it to a file, use |
| 23 |
the redirection operator, (e.g. \fImidi2abc \-f file.mid > file.abc\fP) or |
| 24 |
specify the output file using the \-o option. |
| 25 |
.PP |
| 26 |
Use only one or none of the options \-u \-gu, \-b and \-Q. Midi2abc normally |
| 27 |
converts the MIDI time units into quantum units normally corresponding to the |
| 28 |
abc 1/16th note or 1/32nd note. If none of these is present, the |
| 29 |
program will use the PPQN information in the MIDI header to compute the suitable |
| 30 |
conversion factor. For most MIDI files on the web, it is recommended to rely on |
| 31 |
the MIDI header information and not use any of the options other than |
| 32 |
the formatting options. |
| 33 |
.PP |
| 34 |
The program will extract the time signature information from the MIDI file |
| 35 |
if it is present. Otherwise it will assume 4/4 or you could specify it with |
| 36 |
\-m. option. |
| 37 |
.PP |
| 38 |
If the tune has an anacrusis, you can use either the \-ga or \-xa option to estimate the its length. Alternatively, you can specify its value using the \-a |
| 39 |
option. The anacrusis is specified in half unit lengths, where the unit |
| 40 |
length is defined by the L: field. For example if L: 1/8, then a |
| 41 |
quarter note would be indicated by the value 4, (4 1/16 units). |
| 42 |
.SS OPTIONS |
| 43 |
.TP |
| 44 |
.B -a \fIacbeats\fP |
| 45 |
where acbeats specifies the anacrusis in half unit lengths. |
| 46 |
.TP |
| 47 |
.B -xa |
| 48 |
extract the anacrusis from file by finding the first strong note |
| 49 |
.TP |
| 50 |
.B -ga |
| 51 |
guess the anacrusis by minimizing the number of ties across bars |
| 52 |
.TP |
| 53 |
.B -m \fItime signature\fP |
| 54 |
time signature |
| 55 |
.TP |
| 56 |
.B -b \fIbars\fP |
| 57 |
number of bars wanted in output |
| 58 |
.TP |
| 59 |
.B -Q \fItempo\fP |
| 60 |
tempo in quarter\-notes per minute |
| 61 |
.TP |
| 62 |
.B -u \fipulses\fP |
| 63 |
Allows you to specify directly the number of midi pulses per |
| 64 |
abc time unit. |
| 65 |
.TP |
| 66 |
.B -ppu \fiparts per abc unit length\fP |
| 67 |
Normally, the smallest note unit that midi2abc can extract |
| 68 |
is half the L: unit length.This is called the quantum unit. |
| 69 |
Thus for L: 1/8, midi2abc can extract 1/16 notes but not 1/32 notes. |
| 70 |
You can change this by specifying \-ppu 4 for example. The number of parts |
| 71 |
should be a power of 2. |
| 72 |
.TP |
| 73 |
.B -aul \fidenominator of abc unit length\fP |
| 74 |
Normally midi2abc chooses a unit length of 1/8 or 1/16 |
| 75 |
depending upon the time signature. For time signatures |
| 76 |
smaller than 3/4 the L: 1/16 is used and for larger time |
| 77 |
signatures L: 1/8 is used. You can specify the unit length |
| 78 |
to be used using this parameter. Thus \-aul 32 will cause |
| 79 |
midi2abc to use a unit length of 1/32 nd note. |
| 80 |
.TP |
| 81 |
.B -gu |
| 82 |
Tells midi2abc to estimate the number of midi pulses per abc |
| 83 |
time unit from the note duration or spacing in the MIDI file. |
| 84 |
.TP |
| 85 |
.B -gk |
| 86 |
Tells midi2abc to guess the key signature by minimizing |
| 87 |
the number of accidentals even if the key signature is |
| 88 |
already specified in the MIDI file. By default the key |
| 89 |
signature is the one specified in the MIDI file. |
| 90 |
If it is not specified, then the program guesses the |
| 91 |
key signature by minimizing accidentals. |
| 92 |
.TP |
| 93 |
.B -k \fIkey\fP |
| 94 |
key signature: \-6 to 6 sharps. |
| 95 |
.TP |
| 96 |
.B -c \fIchannel\fP |
| 97 |
select only this midi channel. |
| 98 |
.TP |
| 99 |
.B -f \fIinfile\fP |
| 100 |
input file in midi format |
| 101 |
.TP |
| 102 |
.B -o \fIoutput file\fP |
| 103 |
specifies the output abc file name. |
| 104 |
.TP |
| 105 |
.B -s |
| 106 |
do not discard very short notes. |
| 107 |
.TP |
| 108 |
.B -sr \fIquantum units\fP |
| 109 |
do not notate a short rest smaller than the specified size after a note. If the |
| 110 |
size (in quantum units) is zero, nothing is done. For larger values, the rest |
| 111 |
is absorbed into the preceding note. In other words, the preceding note |
| 112 |
is lengthened to include that rest. |
| 113 |
.TP |
| 114 |
.B -sum |
| 115 |
print a short summary of the input midi file. |
| 116 |
.TP |
| 117 |
.B -nb |
| 118 |
do not look for broken rhythms |
| 119 |
.TP |
| 120 |
.B -nt |
| 121 |
do not look for triplets |
| 122 |
.TP |
| 123 |
.B -obpl |
| 124 |
Print only one bar per line instead of 4. For complex music this |
| 125 |
improves the readability and avoids some problems with some abc |
| 126 |
to postscript converters. This option is deprecated. |
| 127 |
.TP |
| 128 |
.B -nogr |
| 129 |
(No note grouping.) Inserts a space between all notes. It makes |
| 130 |
a less pretty postscript file but it is easier to edit. |
| 131 |
.TP |
| 132 |
.B -bpl \finbars\fP |
| 133 |
Print nbars of music on every line followed by a backslash. |
| 134 |
.TP |
| 135 |
.B -bps \finbars\fP |
| 136 |
When nbars have been printed (including those lines joined by |
| 137 |
a backslash continuation) go to a new line (with no backslash). |
| 138 |
.TP |
| 139 |
.B -splitvoices |
| 140 |
This parameter handles polyphonic chords by |
| 141 |
splitting an entire voice into multiple voices. (A polyphonic |
| 142 |
chord is a chord composed of notes that do not start |
| 143 |
or end at the same time.) Normally, midi2abc joins the |
| 144 |
longer notes to the notes in the following chord using ties. |
| 145 |
Here is an example: [Bd-]d [Bd-]d|. This should |
| 146 |
be separated into two voices ideally Bz Bz and d2 d2. However, |
| 147 |
the separation is not unique. Bz d2 and d2 Bz are also ok. |
| 148 |
.TP |
| 149 |
.B -midigram |
| 150 |
When this option appears, all other options are ignored and |
| 151 |
no abc file is produced. Instead a list of all notes in the |
| 152 |
MIDI file are printed in a fixed format. Each line represents |
| 153 |
a pair of MIDI note on/off event. The line contains the |
| 154 |
on/off time of the note, its track number, channel number, |
| 155 |
midi pitch and midi velocity. The last record indicates |
| 156 |
the duration of the MIDI file in MIDI pulse units. The |
| 157 |
output is designed to go into a graphical user interface |
| 158 |
which will produce a graphical representation (piano roll). |
| 159 |
.TP |
| 160 |
.B -mftext |
| 161 |
When this option appears, all other options are ignored and |
| 162 |
no abc file is produced. Instead a list of all the MIDI |
| 163 |
commands are printed. The output is designed to go into |
| 164 |
a graphical user interface provided by runabc.tcl. |
| 165 |
.TP |
| 166 |
.B -mftextpulses |
| 167 |
Same as -mftext except the time units is in midi pulses. |
| 168 |
.TP |
| 169 |
.B -title \fistring\fP |
| 170 |
Replaces the default title field following T: with |
| 171 |
the given string. |
| 172 |
.TP |
| 173 |
.B -origin \fistring\fP |
| 174 |
Adds an O: field with the given string. |
| 175 |
.TP |
| 176 |
.B -midinotes |
| 177 |
Like -mftext, this option outputs the midi pitches present in the |
| 178 |
midi file, where middle C is 60, the deviation of the note from |
| 179 |
the equal tempered scale in units of cents, and the pitch value |
| 180 |
in cents of the note relative to C. If the pitchbend is used, |
| 181 |
then its value follows cents in parentheses. There are 100 cents in |
| 182 |
the semitone interval. Thus a pitch half way between C and C# would |
| 183 |
have a cent value of 50. There are 1200 cents in an octave, |
| 184 |
so the pitch value of D natural would be 200. The pitch value of |
| 185 |
B natural is 1100. These values are useful for verifying the |
| 186 |
pitch values in an equaltempered scale divided into more than |
| 187 |
12 tones. The pitch values are determined from the |
| 188 |
pitchbend value in the midi file, which is normally 8192. |
| 189 |
However, for some midi players the pitch can also be altered |
| 190 |
using sysex (System Exclusive) messages. In particular, Jef |
| 191 |
Moine's abc2svg uses the latter rather than pitchbends which act |
| 192 |
on all the notes in a channel. |
| 193 |
|
| 194 |
|
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
.SS FEATURES |
| 200 |
* The key is chosen so as to minimize the number of accidentals. |
| 201 |
Alternatively, the user can specify the key numerically (a positive number |
| 202 |
is the number of sharps, a negative number is minus the number of flats). |
| 203 |
.PP |
| 204 |
* Note length can be set by specifying the total number of bars or the |
| 205 |
tempo of the piece. Alternatively the note length can be read from the file. |
| 206 |
However, by default it is deduced in a heuristic manner from the inter-note |
| 207 |
distances. This means that you do not have to use the MIDI clock as a |
| 208 |
metronome when playing in a tune from a keyboard. |
| 209 |
.PP |
| 210 |
* Barlines are automatically inserted. The user specifies the number of |
| 211 |
measures in the anacrusis before the first barline and the time signature. |
| 212 |
.PP |
| 213 |
* The program can guess how the length of the anacrusis, |
| 214 |
either by looking for the first strong note or minimizing the number of |
| 215 |
notes split by a tie across a barline. |
| 216 |
.PP |
| 217 |
* Where a note extends beyond a bar break, it is split into two tied notes. |
| 218 |
.PP |
| 219 |
* The output has 4 bars per line. |
| 220 |
.PP |
| 221 |
* Enough accidental signs are put in the music to ensure that no pitch |
| 222 |
errors occur if a barline is added or deleted. |
| 223 |
.PP |
| 224 |
* The program attempts to group notes sensibly in each bar. |
| 225 |
.PP |
| 226 |
* Triplets and broken rhythm (a>b) are supported. |
| 227 |
.PP |
| 228 |
* Chords are identified. |
| 229 |
.PP |
| 230 |
* Text information from the original MIDI file is included as comments. |
| 231 |
.PP |
| 232 |
* The \-c option can be used to select only 1 MIDI channel. Events on |
| 233 |
other channels are ignored. |
| 234 |
.SS LIMITATIONS |
| 235 |
midi2abc does not ... |
| 236 |
.PP |
| 237 |
* Supply tune title, composer or any other field apart from X: , K:, Q:, M: |
| 238 |
and L: - these must be added by hand afterwards, though they may have been |
| 239 |
included in the text of the MIDI file. |
| 240 |
.PP |
| 241 |
* Support duplets, quadruplets, other esoteric features. |
| 242 |
.PP |
| 243 |
* Support mid-tune key or time signature changes. |
| 244 |
.PP |
| 245 |
* Deduce repeats. The output is just the notes in the input file. |
| 246 |
.PP |
| 247 |
* Recover an abc tune as supplied to abc2midi. However, if you want to |
| 248 |
do this, "midi2abc \-xa \-f file.mid" comes close. |
| 249 |
.SH "SEE ALSO" |
| 250 |
abc2ps(1), abc2midi(1), abc2abc(1) |
| 251 |
.SH AUTHOR |
| 252 |
James Allwright <[email protected]> |
| 253 |
.SH SUPPORTED |
| 254 |
Seymour Shlien <[email protected]> |
| 255 |
.SH VERSION |
| 256 |
This man page describes midi2abc version 2.91 from March 09 2008. |
| 257 |
.SH COPYRIGHT |
| 258 |
Copyright 1999 James Allwright |
| 259 |
.PP |
| 260 |
midi2abc does not work correctly if lyrics are embedded in |
| 261 |
the same track as the notes. If you are producing the MIDI |
| 262 |
file using abc2midi, use the \-STFW option to ensure that the |
| 263 |
lyrics are put in a separate track. |
| 264 |
.PP |
| 265 |
midi2abc is supplied "as is" without any warranty. It |
| 266 |
is free software and can be used, copied, modified and |
| 267 |
distributed without fee under the terms of the GNU General |
| 268 |
Public License. |
| 269 |
|