| 1 |
=head1 NAME |
| 2 |
|
| 3 |
ChordPro - A lyrics and chords formatting program |
| 4 |
|
| 5 |
=head1 SYNOPSIS |
| 6 |
|
| 7 |
perl -MChordpro -e run -- [ options ] [ file ... ] |
| 8 |
|
| 9 |
When the associated B<chordpro> program has been installed correctly: |
| 10 |
|
| 11 |
chordpro [ options ] [ file ... ] |
| 12 |
|
| 13 |
=head1 DESCRIPTION |
| 14 |
|
| 15 |
B<chordpro> will read one or more text files containing the lyrics of |
| 16 |
one or many songs plus chord information. B<chordpro> will then |
| 17 |
generate a photo-ready, professional looking, impress-your-friends |
| 18 |
sheet-music suitable for printing on your nearest printer. |
| 19 |
|
| 20 |
Typical ChordPro input: |
| 21 |
|
| 22 |
{title: Swing Low Sweet Chariot} |
| 23 |
{subtitle: Traditional} |
| 24 |
|
| 25 |
{start_of_chorus} |
| 26 |
Swing [D]low, sweet [G]chari[D]ot, |
| 27 |
Comin' for to carry me [A7]home. |
| 28 |
Swing [D7]low, sweet [G]chari[D]ot, |
| 29 |
Comin' for to [A7]carry me [D]home. |
| 30 |
{end_of_chorus} |
| 31 |
|
| 32 |
# Verse |
| 33 |
I [D]looked over Jordan, and [G]what did I [D]see, |
| 34 |
Comin' for to carry me [A7]home. |
| 35 |
A [D]band of angels [G]comin' after [D]me, |
| 36 |
Comin' for to [A7]carry me [D]home. |
| 37 |
|
| 38 |
{c: Chorus} |
| 39 |
|
| 40 |
B<chordpro> is a rewrite of the Chordii program. |
| 41 |
|
| 42 |
For more information about the ChordPro file format, see |
| 43 |
L<https://www.chordpro.org>. |
| 44 |
|
| 45 |
=head1 COMMAND LINE OPTIONS |
| 46 |
|
| 47 |
=over 4 |
| 48 |
|
| 49 |
=item B<--about> (short: B<-A>) |
| 50 |
|
| 51 |
Prints version information about the ChordPro program. No other |
| 52 |
processing will be done. |
| 53 |
|
| 54 |
=item B<--back-matter=>I<FILE> |
| 55 |
|
| 56 |
Appends the contents of the named PDF document to the output. This can |
| 57 |
be used to produce documents with back matter pages. |
| 58 |
|
| 59 |
=item B<--config=>I<JSON> (shorter: B<--cfg>) |
| 60 |
|
| 61 |
A JSON file that defines the behaviour of the program and the layout |
| 62 |
of the output. See L<ChordPro::Config> for details. |
| 63 |
|
| 64 |
This option may be specified more than once. Each additional config |
| 65 |
file overrides the corresponding definitions that are currently |
| 66 |
active. |
| 67 |
|
| 68 |
=item B<--cover=>I<FILE> |
| 69 |
|
| 70 |
Prepends the contents of the named PDF document to the output. This can |
| 71 |
be used to add cover pages. |
| 72 |
|
| 73 |
See also B<--title>. |
| 74 |
|
| 75 |
=item B<--csv> |
| 76 |
|
| 77 |
When generating PDF output, also write a CSV file with titles and page |
| 78 |
numbers. Some tools, e.g., MobileSheets, can use the CSV to process |
| 79 |
the PDF as a collection of independent songs. |
| 80 |
|
| 81 |
The CSV has the same name as the PDF, with extension C<.pdf> replaced |
| 82 |
by C<.csv>. |
| 83 |
|
| 84 |
=item B<--decapo> |
| 85 |
|
| 86 |
Eliminate capo settings by transposing the song. |
| 87 |
|
| 88 |
=item B<--diagrams=>I<WHICH> |
| 89 |
|
| 90 |
Prints diagrams of chords used in a song. |
| 91 |
|
| 92 |
I<WHICH> can be C<all> to print all chords used, C<user> to only print |
| 93 |
the user-defined chords, and C<none> to suppress printing of chord |
| 94 |
diagrams. |
| 95 |
|
| 96 |
=item B<--encoding=>I<ENC> |
| 97 |
|
| 98 |
Specify the encoding for input files. Default is UTF-8. |
| 99 |
ISO-8859.1 (Latin-1) encoding is automatically sensed. |
| 100 |
|
| 101 |
=item B<--filelist=>I<FILE> |
| 102 |
|
| 103 |
Read the names of the files to be processed from the named file. |
| 104 |
|
| 105 |
This option may be specified multiple times. |
| 106 |
|
| 107 |
Song file names listed on the command line are processed I<after> the |
| 108 |
files from the filelist arguments. |
| 109 |
|
| 110 |
=item B<--front-matter=>I<FILE> |
| 111 |
|
| 112 |
Prepends the contents of the named PDF document to the output. This can |
| 113 |
be used to produce documents with front matter pages. |
| 114 |
|
| 115 |
=item B<--lyrics-only> (short: B<-l>) |
| 116 |
|
| 117 |
Only prints lyrics. All chords are suppressed. |
| 118 |
|
| 119 |
Useful to make prints for singers and other musicians that do not |
| 120 |
require chords. |
| 121 |
|
| 122 |
=item B<--no-csv> |
| 123 |
|
| 124 |
Suppresses generating the CSV file. See B<--toc>. |
| 125 |
|
| 126 |
=item B<--no-strict> |
| 127 |
|
| 128 |
Enables liberal interpretation of the input with regard to the |
| 129 |
ChordPro standard. Most notably, unknown directives will not |
| 130 |
not flagged as warnings but silently ignored. |
| 131 |
|
| 132 |
This makes it more convenient to process ChordPro files have custom |
| 133 |
directives. |
| 134 |
|
| 135 |
=item B<--no-toc> |
| 136 |
|
| 137 |
Suppresses the table of contents. See B<--toc>. |
| 138 |
|
| 139 |
=item B<--output=>I<FILE> (short: B<-o>) |
| 140 |
|
| 141 |
Designates the name of the output file where the results are written |
| 142 |
to. |
| 143 |
|
| 144 |
The filename extension determines the type of the output. It should |
| 145 |
correspond to one of the backends that are currently supported: |
| 146 |
|
| 147 |
=over 6 |
| 148 |
|
| 149 |
=item pdf |
| 150 |
|
| 151 |
Portable document format (PDF). |
| 152 |
|
| 153 |
=item txt |
| 154 |
|
| 155 |
A textual representation of the input, mostly for visual inspection. |
| 156 |
|
| 157 |
=item cho |
| 158 |
|
| 159 |
A functional equivalent version of the ChordPro input. |
| 160 |
|
| 161 |
=back |
| 162 |
|
| 163 |
=item B<--start-page-number=>I<N> (short: B<-p>) |
| 164 |
|
| 165 |
Sets the starting page number for the output. |
| 166 |
|
| 167 |
=item B<--strict> |
| 168 |
|
| 169 |
Requires the input to be strictly compliant to the ChordPro standard. |
| 170 |
|
| 171 |
This is enabled by default. See also B<--nostrict>. |
| 172 |
|
| 173 |
=item B<--subtitle=>I<XXX> |
| 174 |
|
| 175 |
Subtitle (for songbooks). |
| 176 |
|
| 177 |
=item B<--title=>I<XXX> |
| 178 |
|
| 179 |
Title (for songbooks). |
| 180 |
|
| 181 |
If specified and a table of contents is requested, a nice coverpage |
| 182 |
will be added. |
| 183 |
|
| 184 |
Note that B<--title> overrides B<--cover>. |
| 185 |
|
| 186 |
=item B<--toc> (short: B<-i>) |
| 187 |
|
| 188 |
Includes a table of contents. |
| 189 |
|
| 190 |
By default a table of contents is included in the PDF output when |
| 191 |
it contains more than one song. |
| 192 |
|
| 193 |
=item B<--transpose=>I<XX> (short: -x) |
| 194 |
|
| 195 |
I<XX> must be a number in the range -24 .. +24, optionally followed by |
| 196 |
one of C<s>, or C<f>. |
| 197 |
|
| 198 |
Transposes all songs by the given number of semi-tones. |
| 199 |
A positive number transposes up, a negative number transposes down. |
| 200 |
|
| 201 |
If the resultant key requires accidentals the postfix controls whether |
| 202 |
sharps or flats are used. See the docs. |
| 203 |
|
| 204 |
=item B<--version> (short: B<-V>) |
| 205 |
|
| 206 |
Prints the program version and exits. |
| 207 |
|
| 208 |
=back |
| 209 |
|
| 210 |
=head2 Chordii compatibility options |
| 211 |
|
| 212 |
The following Chordii command line options are recognized. Note that |
| 213 |
not all of them actually do something. |
| 214 |
|
| 215 |
Options marked with * are better specified in the config file. |
| 216 |
|
| 217 |
B<Note:> Chordii used the term _grid_ for chord diagrams. It |
| 218 |
should not be confused with ChordPro grids. |
| 219 |
|
| 220 |
=over 4 |
| 221 |
|
| 222 |
=item B<--text-font=>I<FONT> (short: B<-T>) * |
| 223 |
|
| 224 |
Sets the font used to print lyrics and comments. |
| 225 |
|
| 226 |
I<FONT> can be either a full path name to a TrueType font file, or the |
| 227 |
name of one of the standard fonts. See section L</FONTS> for more |
| 228 |
details. |
| 229 |
|
| 230 |
=item B<--text-size=>I<N> (short: B<-t>) * |
| 231 |
|
| 232 |
Sets the font size for lyrics and comments. |
| 233 |
|
| 234 |
=item B<--chord-font=>I<FONT> (short: B<-C>) * |
| 235 |
|
| 236 |
Sets the font used to print the chord names. |
| 237 |
|
| 238 |
I<FONT> can be either a full path name to a TrueType font file, or the |
| 239 |
name of one of the standard fonts. See section L</FONTS> for more |
| 240 |
details. |
| 241 |
|
| 242 |
=item B<--chord-size=>I<N> (short: B<-c>) * |
| 243 |
|
| 244 |
Sets the font size for the chord names. |
| 245 |
|
| 246 |
=item B<--chord-grid-size=>I<N> (short: B<-s>) * |
| 247 |
|
| 248 |
Sets the total width of a chord diagram. |
| 249 |
|
| 250 |
=item B<--chord-grids> |
| 251 |
|
| 252 |
Prints chord diagrams of all chords used in a song. |
| 253 |
|
| 254 |
=item B<--no-chord-grids> (short: B<-G>) * |
| 255 |
|
| 256 |
Disables printing of chord diagrams of the chords used in a song. |
| 257 |
|
| 258 |
=item B<--easy-chord-grids> |
| 259 |
|
| 260 |
Not supported. |
| 261 |
|
| 262 |
=item B<--no-easy-chord-grids> (short: B<-g>) |
| 263 |
|
| 264 |
Not supported. |
| 265 |
|
| 266 |
=item B<--chord-grids-sorted> (short: B<-S>) * |
| 267 |
|
| 268 |
Prints chord diagrams of the chords used in a song, ordered by key and |
| 269 |
type. |
| 270 |
|
| 271 |
=item B<--no-chord-grids-sorted> * |
| 272 |
|
| 273 |
Prints chord diagrams in the order they appear in the song. |
| 274 |
|
| 275 |
=item B<--user-chord-grids> * |
| 276 |
|
| 277 |
Prints chord diagrams of all user defined chords used in a song. |
| 278 |
|
| 279 |
=item B<--even-pages-number-left> (short B<-L>) |
| 280 |
|
| 281 |
Not supported. Use C<pdf.even-odd-pages> in the config instead. |
| 282 |
|
| 283 |
=item B<--odd-pages-number-left> |
| 284 |
|
| 285 |
Not supported. Use C<pdf.even-odd-pages> in the config instead. |
| 286 |
|
| 287 |
=item B<--page-size=>I<FMT> (short: B<-P>) * |
| 288 |
|
| 289 |
Specifies the page size for the PDF output, e.g. C<a4> (default), C<letter>. |
| 290 |
|
| 291 |
=item B<--single-space> (short B<-a>)) * |
| 292 |
|
| 293 |
When a lyrics line has no chords associated, suppresses the vertical |
| 294 |
space normally occupied by the chords. |
| 295 |
|
| 296 |
=item B<--vertical-space=>I<N> (short: B<-w>) * |
| 297 |
|
| 298 |
Adds some extra vertical space between the lines. |
| 299 |
|
| 300 |
=item B<--2-up> (short: B<-2>) |
| 301 |
|
| 302 |
Not supported. |
| 303 |
|
| 304 |
=item B<--4-up> (short: B<-4>) |
| 305 |
|
| 306 |
Not supported. |
| 307 |
|
| 308 |
=item B<--page-number-logical> (short: B<-n>) |
| 309 |
|
| 310 |
Not supported. |
| 311 |
|
| 312 |
=item B<--dump-chords> (short: B<-D>) |
| 313 |
|
| 314 |
Dumps a list of built-in chords in a form dependent of the backend used. |
| 315 |
The PDF backend will produce neat pages of chord diagrams. |
| 316 |
The ChordPro backend will produce a list of C<define> directives. |
| 317 |
|
| 318 |
=item B<--dump-chords-text> (short: B<-d>) |
| 319 |
|
| 320 |
Dumps a list of built-in chords in the form of C<define> directives, |
| 321 |
and exits. |
| 322 |
|
| 323 |
=back |
| 324 |
|
| 325 |
=head2 Configuration options |
| 326 |
|
| 327 |
See L<ChordPro::Config> for details about the configuration |
| 328 |
files. |
| 329 |
|
| 330 |
Note that missing default configuration files are silently ignored. |
| 331 |
Also, B<chordpro> will never create nor write configuration files. |
| 332 |
|
| 333 |
=over |
| 334 |
|
| 335 |
=item B<--nosongconfig> |
| 336 |
|
| 337 |
Don't use song specific config files, even if they exist. |
| 338 |
|
| 339 |
=item B<--sysconfig=>I<CFG> |
| 340 |
|
| 341 |
Designates a system specific config file. |
| 342 |
|
| 343 |
The default system config file depends on the operating system and user |
| 344 |
environment. A common value is C</etc/chordpro.json> on Linux systems. |
| 345 |
|
| 346 |
This is the place where the system manager can put settings like the |
| 347 |
paper size, assuming that all printers use the same size. |
| 348 |
|
| 349 |
=item B<--nosysconfig> |
| 350 |
|
| 351 |
Don't use the system specific config file, even if it exists. |
| 352 |
|
| 353 |
=item B<--userconfig=>I<CFG> |
| 354 |
|
| 355 |
Designates the config file for the user. |
| 356 |
|
| 357 |
The default user config file depends on the operating system and user |
| 358 |
environment. Common values are C<$HOME/.config/chordpro/chordpro.json> |
| 359 |
and C<$HOME/.chordpro/chordpro.json>, where C<$HOME> indicates the |
| 360 |
user home directory. |
| 361 |
|
| 362 |
Here you can put settings for your preferred fonts and other layout |
| 363 |
parameters that you want to apply to all B<chordpro> runs. |
| 364 |
|
| 365 |
=item B<--nouserconfig> |
| 366 |
|
| 367 |
Don't use the user specific config file, even if it exists. |
| 368 |
|
| 369 |
=item B<--config=>I<CFG> (shorter: B<--cfg>) |
| 370 |
|
| 371 |
Designates the config file specific for this run. |
| 372 |
|
| 373 |
Default is a file named C<chordpro.json> in the current directory. |
| 374 |
|
| 375 |
Here you can put settings that apply to the files in this |
| 376 |
directory only. |
| 377 |
|
| 378 |
You can specify multiple config files. The settings are accumulated. |
| 379 |
|
| 380 |
=item B<--noconfig> |
| 381 |
|
| 382 |
Don't use the specific config file, even if it exists. |
| 383 |
|
| 384 |
=item B<--define=>I<item> |
| 385 |
|
| 386 |
Sets a configuration item. I<item> must be in the format of |
| 387 |
colon-separated configuration keys, an equal sign, and the value. For |
| 388 |
example, the equivalent of B<--diagrams=none> is |
| 389 |
B<--define=diagrams.show=0>. |
| 390 |
|
| 391 |
B<--define> may be used multiple times to set multiple items. |
| 392 |
|
| 393 |
=item B<--no-default-configs> (short: B<-X>) |
| 394 |
|
| 395 |
Do not use any config files except the ones mentioned explicitly on |
| 396 |
the command line. |
| 397 |
|
| 398 |
This guarantees that the program is running with the default |
| 399 |
configuration. |
| 400 |
|
| 401 |
=item B<--print-template-config> |
| 402 |
|
| 403 |
Prints a simplified template configuration to standard output, and |
| 404 |
exits. The configuration is commented to explain its contents. |
| 405 |
|
| 406 |
The config contains most of the ChordPro configuration items, all |
| 407 |
commented out. It is easy to get started with configuring ChordPro |
| 408 |
by enabling and modifyng just a few items at a time. |
| 409 |
|
| 410 |
=item B<--print-default-config> |
| 411 |
|
| 412 |
If used once, behaves like `--print-template-config`. This is to avoid |
| 413 |
confusing novice users. |
| 414 |
|
| 415 |
To get the full default configuration, repeat this option. |
| 416 |
|
| 417 |
=item B<--print-final-config> |
| 418 |
|
| 419 |
Prints the final configuration (after processing all system, user and |
| 420 |
other config files) to standard output, and exits. |
| 421 |
|
| 422 |
=item B<--convert-config=>I<file> |
| 423 |
|
| 424 |
This option requires a single file name argument. |
| 425 |
|
| 426 |
The specified config file is loaded and immedeately written out in |
| 427 |
standard format, including schema comments. After this, the program |
| 428 |
exits. B<No songs are processed.> |
| 429 |
|
| 430 |
Output goes to standard output unless `--output` is used to specify an |
| 431 |
alternative. |
| 432 |
|
| 433 |
All other options are ignored. |
| 434 |
|
| 435 |
=back |
| 436 |
|
| 437 |
=head2 Miscellaneous options |
| 438 |
|
| 439 |
=over |
| 440 |
|
| 441 |
=item B<--help> (short: -h) |
| 442 |
|
| 443 |
Prints a help message. No other output is produced. |
| 444 |
|
| 445 |
=item B<--manual> |
| 446 |
|
| 447 |
Prints the manual page. No other output is produced. |
| 448 |
|
| 449 |
=item B<--ident> |
| 450 |
|
| 451 |
Shows the program name and version. |
| 452 |
|
| 453 |
=item B<--verbose> |
| 454 |
|
| 455 |
Provides more verbose information of what is going on. |
| 456 |
|
| 457 |
=back |
| 458 |
|
| 459 |
=head1 FONTS |
| 460 |
|
| 461 |
There are two ways to specify fonts: with a font filename, and a |
| 462 |
built-in font name. |
| 463 |
|
| 464 |
A font filename must be either and absolute filename, or a relative |
| 465 |
filename which is interpreted relative to the I<font path>, which |
| 466 |
consists of configuration setting C<fontdir>, the C<fonts> resource |
| 467 |
dir, and the contents of environment variable C<FONTDIR>. In any case, |
| 468 |
the filename should point to a valid TrueType (C<.ttf>) or OpenType |
| 469 |
(C<.otf>) font. |
| 470 |
|
| 471 |
If it is not a filename, it must be the name one of the built-in PDF core fonts: |
| 472 |
|
| 473 |
Courier Symbol |
| 474 |
Courier-Bold Times-Bold |
| 475 |
Courier-BoldOblique Times-BoldItalic |
| 476 |
Courier-Oblique Times-Italic |
| 477 |
Helvetica Times-Roman |
| 478 |
Helvetica-Bold ZapfDingbats |
| 479 |
Helvetica-BoldOblique |
| 480 |
Helvetica-Oblique |
| 481 |
|
| 482 |
=head1 MOTIVATION |
| 483 |
|
| 484 |
Why a rewrite of Chordii? |
| 485 |
|
| 486 |
Chordii is the de facto reference implementation of the ChordPro file |
| 487 |
format standard. It implements ChordPro version 4. |
| 488 |
|
| 489 |
ChordPro version 5 adds a number of new features, and this was pushing |
| 490 |
the limits of the very old program. Unicode support would have been |
| 491 |
very hard to add, and the whole program centered around PostScript |
| 492 |
generation, while nowadays PDF would be a much better alternative. |
| 493 |
|
| 494 |
So I decided to create a new reference implementation from the ground |
| 495 |
up. I chose a programming language that is flexible and very good at |
| 496 |
handling Unicode data. And that is fun to program in. |
| 497 |
|
| 498 |
=head1 CURRENT STATUS |
| 499 |
|
| 500 |
This program implements ChordPro version 5. It |
| 501 |
supports most of the features of Chordii, and a lot more: |
| 502 |
|
| 503 |
* Native PDF generation |
| 504 |
|
| 505 |
* Unicode support (all input is UTF8) |
| 506 |
|
| 507 |
* User defined chords and tuning, not limited to 6 strings. |
| 508 |
|
| 509 |
* Support for Nashville Numbering and Roman Numbering. |
| 510 |
|
| 511 |
* Support for external TrueType and OpenType fonts |
| 512 |
|
| 513 |
* Font kerning (with external TrueType fonts) |
| 514 |
|
| 515 |
* Fully customizable layout, fonts and sizes |
| 516 |
|
| 517 |
* Customizable backends for PDF, ChordPro, LilyPond*, LaTeX* and HTML*. |
| 518 |
|
| 519 |
(* = under development) |
| 520 |
|
| 521 |
=head1 AUTHOR |
| 522 |
|
| 523 |
Johan Vromans C<< <jv at CPAN dot org > >> |
| 524 |
|
| 525 |
=head1 SUPPORT |
| 526 |
|
| 527 |
ChordPro (the program) development is hosted on GitHub, repository |
| 528 |
L<https://github.com/ChordPro/chordpro>. |
| 529 |
|
| 530 |
Please report any bugs or feature requests to the GitHub issue tracker, |
| 531 |
L<https://github.com/ChordPro/chordpro/issues>. |
| 532 |
|
| 533 |
A user community discussing ChordPro can be found at |
| 534 |
L<https://groups.google.com/forum/#!forum/chordpro>. |
| 535 |
|
| 536 |
=head1 LICENSE |
| 537 |
|
| 538 |
Copyright (C) 2010,2018 Johan Vromans, |
| 539 |
|
| 540 |
This program is free software; you can redistribute it and/or modify it |
| 541 |
under the same terms as Perl itself. |
| 542 |
|