-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathleadsheets_en.tex
2256 lines (2032 loc) · 86.5 KB
/
leadsheets_en.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
% arara: pdflatex: { shell: on , interaction: nonstopmode }
% arara: biber
% arara: pdflatex: { interaction: nonstopmode }
% arara: pdflatex: { interaction: nonstopmode }
% --------------------------------------------------------------------------
% the LEADSHEETS package
%
% typesetting leadsheets and songbooks
%
% --------------------------------------------------------------------------
% Clemens Niederberger
% E-Mail: [email protected]
% --------------------------------------------------------------------------
% Copyright 2014--2022 Clemens Niederberger
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is Clemens Niederberger.
% --------------------------------------------------------------------------
\documentclass[load-preamble+]{cnltx-doc}
\usepackage{leadsheets,bookmark,csquotes}
\setcnltx{
package = leadsheets ,
info = Typesetting leadsheets and songbooks ,
authors = Clemens Niederberger ,
email = [email protected] ,
url = https://github.com/cgnieder/leadsheets/ ,
add-cmds = {
choir , chord , chordname ,
definesongtitletemplate ,
defineversetypetemplate ,
expandcode ,
ifallsongproperties ,
ifanysongproperty ,
ifobeylines ,
ifsongmeasuring ,
ifsongpropertiesequal ,
ifsongproperty ,
ifversenamed ,
ifversenumbered ,
ifversestarred ,
includeleadsheet ,
instruction ,
leadsheetstranslate ,
lsenparen ,
mkchoir ,
mkinstruction ,
mklsenparen ,
mklsenparens ,
newversetype ,
printsongpropertylist ,
setchords ,
setleadsheets ,
songproperty ,
useleadsheetslibraries ,
useleadsheetslibrary ,
verseafterlabel ,
verselabel ,
verselabelformat ,
versename ,
versenumber ,
writechord
} ,
add-silent-cmds = {
@itemdepth ,
arraybackslash ,
endmdframed ,
mdframed ,
newfontfamily ,
newrobustcmd ,
musejazz
} ,
add-envs = {
bridge ,
chorus , chorus* ,
flushleft ,
flushright ,
info ,
interlude ,
intro , intro* ,
outro , outro * ,
prechorus , prechorus* ,
solo , solo* ,
song ,
verse
} ,
index-setup = { othercode=\footnotesize, level=\section , noclearpage } ,
makeindex-setup = { columns=3, columnsep=1em }
}
\defbibheading{bibliography}{\section{References}}
\addbibresource{\jobname.bib}
\begin{filecontents}[overwrite]{\jobname.bib}
@book{book:realbook,
author = {Various} ,
title = {The Real Book} ,
volume = {I} ,
subtitle = {C Edition} ,
publisher = {Hal Leonard Publishing Corporation} ,
isbn = {978-0634060380} ,
date = {2000-01-01} ,
edition = {6th edition}
}
@book{book:newrealbook,
author = {Various} ,
title = {The New Real Book} ,
volume = {I} ,
subtitle = {C Edition} ,
publisher = {Ama Verlag} ,
isbn = {978-0961470142} ,
date = {2009-02-12} ,
edition = {1st edition}
}
\end{filecontents}
\usepackage{booktabs}
\newidxcmd\library{\code{#1}}[ (library)]
\AtEndPreamble{%
\pdfstringdefDisableCommands{%
\def\library*#1{``#1''}%
}%
}
\newrobustcmd*\musicsymbols{\library{musicsymbols}}
\newrobustcmd*\chords{\library{chords}}
\newrobustcmd*\musejazz{\library{musejazz}}
\setchords{format=\libertineLF}
\makeatletter
\colorlet{property}{cnltxgreen}
\newenvironment{properties}
{%
\def\prop{\@cnltx@option@item\propval}%
\cnltxlist
}
{\endcnltxlist}
\newrobustcmd*\propval{\@ifstar{\cnltx@prop@star}{\cnltx@prop@nostar}}
\newrobustcmd*\cnltx@prop@star{%
\cnltx@ifdash
{\cnltx@prop@aux*\meta}
{\cnltx@prop@aux*\marg}%
}
\newrobustcmd*\cnltx@prop@nostar{%
\cnltx@ifdash
{\cnltx@prop@aux{}\meta}
{\cnltx@prop@aux{}\marg}%
}
\newcommand*\cnltx@prop@aux[4]{%
\code{\property#1{#3}\cnltx@isvalue#2{#4}}%
}
\makeatother
\newidxcmd\property{\code{\textcolor{property}{#1}}}
\newrobustcmd*\symarg[1]{\textcolor{argument}{\code{#1}}}
\newidxcmd\titletemplate{\textit{\sffamily#1}}[\ (songtitle template)]
\newidxcmd\versetemplate{\textit{\sffamily#1}}[\ (verse-type template)]
\newidxcmd\shortcut{\code{#1}}[ (shortcut)]
\newidxcmd\pkgopt{\code{#1}}[ (package option)]
\newnote*\packageoption[1]{Package option: \pkgopt{#1}}
\newrobustcmd*\barsymbol{|}
\AfterPackage{hyperref}{%
\pdfstringdefDisableCommands{%
\def\property#1{#1}%
}}
\renewcommand*\dictumauthorformat[1]{#1}
\renewcommand*\raggeddictumtext{}
\begin{document}
\part{About the Package}
\dictum[Tom Waits]{%
I like beautiful melodies telling me terrible things.%
}
\section{License and Requirements}
\license
\leadsheets{} requires the bundles \bnd{l3kernel}~\cite{bnd:l3kernel} and
\bnd{l3packages}~\cite{bnd:l3packages} to be available. It also needs the
package \pkg{translations}~\cite{pkg:translations}.
\section{Background}
Over the years I repeatedly wanted to typeset simple leadsheets of songs, \ie,
song lyrics and the corresponding chords\footnote{I also have had the need (or
let's say: wish) to typeset leadsheets in the style of the
\citetitle{book:realbook} -- but this is a task where other software than
\LaTeX{} usually is far easier.}. This is not too hard with standard
\LaTeX{} commands and environments but it is not very convenient\ldots{} so
looking for existing packages is the logical next step and I found two very
promising packages: \pkg{songs}~\cite{pkg:songs} and
\pkg{songbook}~\cite{pkg:songbook}. However, both were note \emph{quite} what
I wanted. Just a bit too inflexible in the wrong places, needing tweaking
here and there, and so on. On the other hand I had quite some code lying on
my hard drive with various attempts of typesetting leadsheets. This package
is now the attempt to have a clean, documented and customizable version of my
code\footnote{Plus new things!}.
\section{The Structure of the Package}
\leadsheets{} is a modular package and consists of several
libraries\footnote{This did seem like a good idea for maintenance when I first
came up with it. Now I'm not so sure any more but I am way too lazy to
change it back. So here we are\ldots}. If you just say
\begin{sourcecode}
\usepackage{leadsheets}
\end{sourcecode}
then the \library{songs} library is loaded\footnote{Which currently means that
\emph{all} libraries are loaded as the \library{songs} library needs them.}.
If you want to ensure that \emph{every} library is loaded\packageoption{full}
so you don't have to think about it any more you can use
\begin{sourcecode}
\usepackage[full]{leadsheets}
\end{sourcecode}
This actually loads every library except the \library{musejazz} library.
If you instead use\packageoption{minimal}
\begin{sourcecode}
\usepackage[minimal]{leadsheets}
\end{sourcecode}
then \emph{no} libraries are loaded. In this case you have to load the
libraries yourself in order to use the package.
\begin{commands}
\command{useleadsheetslibraries}[\marg{comma list of libraries}]
With this command one or several of \leadsheets' libraries can be loaded.
\command{useleadsheetslibrary}[\marg{library}]
With this command one of \leadsheets' libraries can be loaded.
\end{commands}
The libraries are divided into two parts: libraries to be loaded by users and
auxiliary libraries loaded by other libraries but not to be loaded directly by
users.
The user-libraries are the following ones:
\begin{description}
\item[\library{musicsymbols}] \packageoption{musicsymbols}This library makes
the music symbol font provided by MusiX\TeX{} available as text font. It
is described in part~\ref{part:musicsymbols-library}.
\item[\library{chords}] \packageoption{chords}This library defines a
few macros for typesetting of chord symbols. It is described in
part~\ref{part:chords-library}. It also loads the
\library{musicsymbols}library.
\item[\library{musejazz}] \packageoption{musejazz}extends the \chords\
library to use MuseScore's \enquote{MuseJazz Text} font, see
section~\ref{sec:musejazz-libr}. It loads the \library{chords}
library.
\item[\library{songs}] \packageoption{songs}This is the \emph{main
library}. It defines everything necessary for the typesetting of the
leadsheets. It currently loads \emph{all other libraries}, \ie, user
libraries \emph{and} internal libraries, except for the \library{musejazz}
library. This library is described in part~\ref{part:leadsheets-songs-library}.
\item[\library{external}] \packageoption{external}enables to include
external leadsheet documents using the \cls{leadsheets} class into a main
document, see part~\ref{part:external-leadsheet} for details.
\end{description}
Those libraries can also be loaded as a package option. If you say
\begin{sourcecode}
\usepackage[musicsymbols]{leadsheets}
\end{sourcecode}
then \emph{only} the \library{musicsymbols} library is loaded. Saying
\begin{sourcecode}
\usepackage[songs]{leadsheets}
\end{sourcecode}
is the same as using the package \emph{without} any options. ``Without any''
also means that neither \library{musicsymbols}, \library{chords} nor
\library{songs} has been given as class option!
There is also a number of auxiliary libraries which are all needed by
the \library{songs} library. The libraries are usually not described in
sections of their own but as part of the \library{songs} library. However,
the following list gives hints to where some of the concepts are explained:
\begin{description}
\item[\library{properties}] This is an auxiliary library not meant to be
loaded directly by users. It defines the necessary macros for song
properties. See section~\ref{sec:song-properties} for more details on the
concept.
\item[\library{shorthands}] This is an auxiliary library not meant to be
loaded directly by users. It provides means for defining shorthand
characters.
\item[\library{transposing}] This is an auxiliary library not meant to be
loaded directly by users. It defines a transposing mechanism for chord
symbols. See section~\ref{sec:transposing} for further details.
\item[\library{chordnames}] This is an auxiliary library not meant to be
loaded directly by users. It defines the necessary macros for printing
chords.
\item[\library{templates}] This is an auxiliary library not meant to be
loaded directly by users. It defines the necessary macros for
\leadsheets' template mechanism. See section~\ref{sec:templates} for
details on the concept.
\item[\library{translations}] This is an auxiliary library not meant to be
loaded directly by users. It provides a few translations for a number of
printed strings. See section~\ref{sec:internationalization} for more
information.
\end{description}
\part{The \library*{musicsymbols} Library}\label{part:musicsymbols-library}
\dictum[Victor Hugo]{%
Music expresses that which cannot be said and on which it is impossible to
be silent.%
}
\vspace*{\baselineskip}\csname @afterheading\endcsname
The \musicsymbols{} library is a very small library that makes the music
symbol font provided by MusiX\TeX{} available as text font and then uses it to
define a number of symbols. This redefines the macros \cs{sharp}, \cs{flat}
and \cs{natural}. All defined symbols are listed in
table~\ref{tab:musicsymbols}.
If you want to use the library standalone then you can say:
\begin{sourcecode}
\usepackage[minimal]{leadsheets}
\useleadsheetslibraries{musicsymbols}
\end{sourcecode}
\musicsymbols{} defines three further commands, namely \cs{musix},
\cs{textmusix} -- a font switch and a text font command -- and
\cs{musicsymbol}. Those commands are meant for internal use only which is why
they're not explained here.
\begin{table}[htbp]
\centering
\newcommand*\showsymbol[1]{\cs{#1}&\csuse{#1}}
\caption{Symbols defined by \musicsymbols.}
\begin{tabular}{llll}
\toprule
\bfseries Command & \bfseries Symbol &
\bfseries Command & \bfseries Symbol \\
\midrule
\showsymbol{sharp} & \showsymbol{flat} \\
\showsymbol{doublesharp} & \showsymbol{doubleflat} \\
\showsymbol{natural} \\
\midrule
\showsymbol{trebleclef} & \showsymbol{bassclef} \\
\showsymbol{altoclef} \\
\midrule
\showsymbol{allabreve} & \showsymbol{meterC} \\
\midrule
\showsymbol{wholerest} & \showsymbol{halfrest} \\
\showsymbol{quarterrest} & \showsymbol{eighthrest} \\
\showsymbol{sixteenthrest} \\
\midrule
\showsymbol{Break} \\
\bottomrule
\end{tabular}
\label{tab:musicsymbols}
\end{table}
\musicsymbols{} also defines a number of macros for denoting bars. Those
macros are listed in table~\ref{tab:bar-symbols}.
\begin{table}[htbp]
\centering
\newcommand*\showsymbol[1]{\cs{#1}&\csuse{#1}}
\caption{Bar symbols.}
\begin{tabular}{llll}
\toprule
\bfseries Macro & \bfseries Symbol &
\bfseries Macro & \bfseries Symbol \\
\midrule
\showsymbol{normalbar} & \showsymbol{leftrepeat} \\
\showsymbol{rightrepeat} & \showsymbol{leftrightrepeat} \\
\showsymbol{doublebar} & \showsymbol{stopbar} \\
\bottomrule
\end{tabular}
\label{tab:bar-symbols}
\end{table}
There are three macros that can be redefined to adjust the appearance of those
bars:
\begin{commands}
\command{normalbarwidth}\Default{.02em}
The thickness of a bar rule as used in \cs{normalbar}.
\command{thickbarwidth}\Default{.15em}
The thickness of the thick bar rules as used for example in
\cs{leftrepeat} or \cs{stopbar}.
\command{interbarwidth}\Default{.1em}
The distance between two bar rules as in \cs{doublebar} or \cs{stopbar}.
\end{commands}
Finally \musicsymbols{} provides a macro for adding an arbitrary meter:
\begin{commands}
\command{meter}[\marg{numerator}\marg{denominator}]
\sinceversion{0.5}For example \verbcode+\meter{6}{8}+: \meter{6}{8}
\end{commands}
\clearpage
\part{The \library*{chords} Library (and the \library*{musejazz}
Library)}\label{part:chords-library}
\dictum[Wes Montgomery]{%
I never practice my guitar -- from time to time I just open the case and
throw in a piece of raw meat.%
}
\begin{figure}
\centering
\includegraphics[scale=.5,trim=0 22cm 10cm 2cm,clip]{ring-of-fire.pdf}
\caption{One possible layout for \leadsheets{} mimicking the typewriter
style.}
\label{fig:leadsheet}
\end{figure}
\section{The \cs*{writechord} Command}
\chords{} provides the command \cs{writechord}\marg{chord} for convenient
typesetting of chords:
\begin{example}[side-by-side]
\writechord{Bb7(#9)} \writechord{Bbb6}
\writechord{C#7(b9)} \writechord{C##13}
\end{example}
\begin{commands}
\command{chordname}[\marg{chord}]
Typesetting chords. Inside the argument every \code{\#} will be replaced
by $\sharp$ and every \code{b} is replaced with $\flat$. Numerals and
parentheses are typeset as superscripts. Everything between parentheses
is always a superscript: \verbcode+\writechord{F#7(#11)}+
\writechord{F#7(#11)}.
\command{writechord}[\marg{chord}]
This command can and actually \emph{should} be used for placing chords
inline. It transforms the chords according to the options knows the
options \option{input-notation} and \option{output-notation}. This
command also transforms the chord according to the options inside of the
\env{song} environment \option{transpose} and \option{enharmonic} before
printing it, see also page~\pageref{cs:writechord}.
\end{commands}
There are several token lists that are treated specially inside \cs{writechord}:
\begin{labeling}[--]{xxxxx}
\item[\code{\^{}}] This token is replaced by \cs*{textsuperscript}.
\item[\code{ma}] The symbol for major chords. Per default this is
empty. \verbcode+\writechord{Gma}+ \writechord{Gma}.
\item[\code{mi}] The symbol for minor chords. Per default this is
\code{m}. \verbcode+\writechord{Gmi}+ \writechord{Gmi}.
\item[\code{o}] The symbol for diminished chords. Per default this is
\code{\cs*{textsuperscript}\Marg{o}}. \verbcode+\writechord{Go}+
\writechord{Go}.
\item[\code{+}] The symbol for augmented chords. Per default this is
\code{\cs*{textsuperscript}\Marg{+}}. \verbcode!\writechord{G+}!
\writechord{G+}.
\item[\code{/o}] The symbol for half diminished chords. Per default
this is \code{\cs*{textsuperscript}\Marg{\cs*{o}\Marg{}}}.
\verbcode+\writechord{G/o}+ \writechord{G/o}.
\item[\code{\#}] The \enquote{sharp} symbol. Per default this is
\cs{sharp}. \verbcode+\writechord{F#}+ \writechord{F#}.
\item[\code{\#\#}] The \enquote{double sharp} symbol. Per default this is
\cs{doublesharp}. \verbcode+\writechord{F##}+ \writechord{F##}.
\item[\code{b}] The \enquote{flat} symbol. Per default this is
\cs{flat}. \verbcode+\writechord{Eb}+ \writechord{Eb}.
\item[\code{bb}] The \enquote{double flat} symbol. Per default this is
\cs{doubleflat}. \verbcode+\writechord{Ebb}+ \writechord{Ebb}.
\item[\code{b\#}] Cancelling flat/sharp combination: this is removed.
\item[\code{\#b}] Cancelling sharp/flat combination: this is removed.
\item[\code{add}] This is superscripted: \verbcode+\writechord{Gadd9}+
\writechord{Gadd9}.
\item[\code{sus}] This is superscripted: \verbcode+\writechord{Gsus4}+
\writechord{Gsus4}.
\item[\code{dim}] This is superscripted: \verbcode+\writechord{Gdim5}+
\writechord{Gdim5}.
\item[\code{maj7}] This is superscripted: \verbcode+\writechord{Gmaj7}+
\writechord{Gmaj7}.
\item[\code{maj9}] This is superscripted: \verbcode+\writechord{Gmaj9}+
\writechord{Gmaj9}.
\end{labeling}
How these token lists are treated depends on optional settings:
\begin{example}
\setchords{
major-seven = $\Delta$ ,
major-nine = $\Delta$\textsuperscript{9}
}
\writechord{Gmaj7} \writechord{Gmaj9}
\writechord{G^6} \writechord{G6}
\writechord{G7^#5}
\end{example}
If you want to use the library standalone then you can say:
\begin{sourcecode}
\usepackage[minimal]{leadsheets}
\useleadsheetslibraries{chords}
\end{sourcecode}
This also loads the \musicsymbols{} library.
\section{Options}
Options are set with the command
\begin{commands}
\command{setchords}[\marg{options}]
where \meta{options} is a comma separated list of keyval options.
\end{commands}
Actually there's a second possibility: options can also be set with the
command \cs{setleadsheets} (see section~\ref{sec:options}) if they're preceded
by \code{chords/} (including the slash).
The options allow detailed customization of how chords are printed. It
doesn't change the input syntax.
\begin{options}
\keyval{format}{code}\Default
Code inserted before a chord within the same group. Can be used for
special formatting of the chords, with \cs*{sffamily}, say.
\keyval{sharp}{code}\Default{\cs{sharp}}
The sharp symbol.
\keyval{flat}{code}\Default{\cs{flat}}
The flat symbol.
\keyval{double-sharp}{code}\Default{\cs{doublesharp}}
The double sharp symbol.
\keyval{double-flat}{code}\Default{\cs{doubleflat}}
The double flat symbol.
\keyval{aug}{code}\Default{+}
The augmented symbol.
\keyval{half-dim}{code}\Default{\cs*{o}\Marg{}}
The half-diminished symbol.
\keyval{full-dim}{code}\Default{o}
The diminished symbol.
\keyval{dim}{code}\Default{\cs*{textsuperscript}\Marg{dim}}
The token list \code{dim}.
\keyval{add}{code}\Default{\cs*{textsuperscript}\Marg{add}}
The token list \code{add}.
\keyval{sus}{code}\Default{\cs*{textsuperscript}\Marg{sus}}
The token list \code{sus}.
\keyval{major}{code}\Default
The token list \code{ma}.
\keyval{minor}{code}\Default{m}
The token list \code{mi}. This option knows a special value. If you set
\keyis{minor}{lowercase} then minor chords are converted to lowercase
letters. This means an input \code{Dmi} becomes \code{d}.
\keyval{major-seven}{code}\Default{\cs*{textsuperscript}\Marg{maj7}}
The token list \code{maj7}.
\keyval{major-nine}{code}\Default{\cs*{textsuperscript}\Marg{maj9}}
The token list \code{maj9}.
\end{options}
There are further options which concern the different notations of the pitches
\writechord{B} and \writechord{Bb} in German (and a few other European
countries) and English.
\begin{options}
\keychoice{input-notation}{german,english}\Default{english}
If\changedversion{0.2} set to \code{german} B should be input as \code{H}
and B~flat as \code{B}. If set to \code{english} B should be input as
\code{B} and B~flat as \code{Bb}.
\keychoice{output-notation}{german,english}\Default{english}
\setchords{output-notation=german}If\changedversion{0.2} set to
\code{german} B is output as \writechord{B} and B-flat as \writechord{Bb}.
\keyval{german-B}{code}\Default{B}
Customize\sinceversion{0.2} the output of B~flat when
\keyis{output-notation}{german}.
\keyval{german-H}{code}\Default{H}
Customize\sinceversion{0.2} the output of B when
\keyis{output-notation}{german}.
\end{options}
Let's see a few examples for the \option{input-notation} and
\option{output-notation} options.
\begin{example}
input and output English:\par
\writechord{Bb} \writechord{B} \writechord{B#}\par
\writechord{B} \writechord{H} \writechord{H#}\par
\medskip
\setchords{input-notation=german}
input German and output English:\par
\writechord{Bb} \writechord{B} \writechord{B#}\par
\writechord{B} \writechord{H} \writechord{H#}\par
\medskip
\setchords{output-notation=german}
input and output German:\par
\writechord{Bb} \writechord{B} \writechord{B#}\par
\writechord{B} \writechord{H} \writechord{H#}\par
\medskip
\setchords{input-notation=english}
input English and output German:\par
\writechord{Bb} \writechord{B} \writechord{B#}\par
\writechord{B} \writechord{H} \writechord{H#}
\end{example}
\section{The \library*{musejazz} Library}\label{sec:musejazz-libr}
The \musejazz\ library extends the \chords\ library to use
MuseScore's\footnote{\url{http://musescore.com/}} font \enquote{MuseJazz Text}
for the chord symbols. The library contains the two lines which explains why
it requires \LuaLaTeX\ or \XeLaTeX. Well, and the font, obviously.
\begin{sourcecode}
\RequirePackage{fontspec}
\newfontfamily\musejazz{MuseJazz Text}
\end{sourcecode}
Here is a small example of it's usage and the outcome:
\begin{example}[compile,program=xelatex,max-pages=1,add-frame=false]
% compile with LuaLaTeX or XeLaTeX
\documentclass[margin=4mm]{standalone}
\usepackage{leadsheets}
\useleadsheetslibrary{musejazz}
\begin{document}
\Huge\writechord{Bb7(#9)}\space\writechord{F##9}
\end{document}
\end{example}
\clearpage
\part{The \library*{songs} Library}\label{part:leadsheets-songs-library}
\dictum[Jeff Beck]{%
I don't care about the rules. If I don't break the rules at least ten
times every song then I'm not doing my job.%
}
\section{Background}
The \leadsheets{} package allows for easy creation of leadsheets but it also
can be used to create complete songbooks. The basic idea is that songs are
typeset in the \env{song} environment. Each song gets a number of properties
(see section~\ref{sec:song-properties}) that determine how the title of the
song is typeset. For the typesetting of the titles a template mechanism is
used (see section~\ref{sec:title-templates}). Songs can also be tagged. The
tags then allow to typeset only songs matching a list of tags that is
specified via an option.
\begin{figure}
\centering
\includegraphics[width=.9\linewidth]{liederbuechlein.jpg}
\caption{Even before officially publishing this bundle I used it for
typesetting a small songbook!}
\label{fig:liederbuch}
\end{figure}
\section{The \env*{song} Environment}
\begin{environments}
\environment{song}[\oarg{options}\marg{properties}]
The main environment used to typeset songs. It has a mandatory argument
where the song's properties are set
(\cf\ section~\ref{sec:song-properties}). It also has an optional
argument for setting options specific to the song.
\end{environments}
\subsection{A First Example}
First let's take a look at an example:
\begin{example}[
compile,
graphics={trim={2cm 18cm 2cm 2cm},clip},
add-sourcecode-options={literate=}]
\documentclass{article}
\usepackage{leadsheets}
\begin{document}
\begin{song}{title={Mary Had A Little Lamb}, music={Stevie Ray Vaughan},
lyrics={traditional}, tags={srv,blues}}
\begin{verse}
Mary had a little lamb \\
Its fleece was white as snow, yea \\
Everywhere the child went \\
The little lamb was sure to go, yea
\end{verse}
\begin{verse}
He followed her to school one day \\
And broke the teacher's rule \\
What a time did they have \\
That day at school
\end{verse}
\end{song}
\end{document}
\end{example}
Per default the songtitle simply is a \cs{section}\sarg{} without any other
additions. This is the songtitle template \titletemplate{minimal}, see
section~\ref{sec:title-templates} for more details on those templates and how
to create your own.
\subsection{Using the \env*{song} Environment}
Inside the \env{song} environment a number of additional environments are used
to specify the different parts of a song. They all are basically the same
kind of environment, namely an \env*{itemize} environment internally where the
only \cs*{item} has the name of the environment as option. The \env{verse}
environment is a little bit different since verses can be numbered. If they
are then each usage of \env{verse} inside \env{song} will step a verse number
and print it (as option to the internal \cs*{item}).
\begin{environments}
\environment{verse}[\oarg{options}]
An environment for specifying the verses of a song.
\environment{chorus}[\oarg{options}]
An environment for specifying the chorus of a song.\\
This is the same as \beginenv*\Marg{verse}\Oarg{type=chorus,\meta{options}}.
\environment{intro}[\oarg{options}]
An environment for specifying the intro of a song.\\
This is the same as \beginenv*\Marg{verse}\Oarg{type=intro,\meta{options}}.
\environment{interlude}[\oarg{options}]
An environment for specifying an interlude of a song.\\
This is the same as \beginenv*\Marg{verse}\Oarg{type=interlude,\meta{options}}.
\environment{bridge}[\oarg{bridge}]
An environment for specifying a bridge of a song.\\
This is the same as \beginenv*\Marg{verse}\Oarg{type=bridge,\meta{options}}.
\end{environments}
These environments and their options are described in more detail in
sections~\ref{sec:envverse-environment} and~\ref{sec:other-envverse-like}.
\subsection{Options}\label{sec:options}
The options to the \env{song} environment are the same as the general options
of \leadsheets. This means you can set the following options either local to
a song or global for the whole document with this command:
\begin{commands}
\command{setleadsheets}[\marg{options}]
Setup command for \leadsheets.
\end{commands}
Although I used the word \enquote{global} above \emph{all options are local to
the current scope}!
\begin{options}
\keyval{title-template}{template name}\Default{minimal}
The songtitle template, see section~\ref{sec:title-templates} for
details.
\keyval{chord-cs}{cs}\Default{\cs*{chordname}}
The command that is used to parse the chords. See
section~\ref{sec:placing-chords} for details. \meta{cs} needs to be a
command that takes a mandatory argument.
\keyval{song-format}{code}\Default
\meta{code} is inserted \emph{before} the song title at the
beginning of the \env{song} environment.
\keyval{text-format}{code}\Default
\meta{code} is inserted \emph{after} the song title at the
beginning of the \env{song} environment.
\keyval{before-song}{code}\Default
\meta{code}\sinceversion{0.3} is inserted at the beginning of a song
\emph{before} the title!
\keyval{after-song}{code}\Default
\meta{code}\sinceversion{0.3} is inserted after the whole song.
\keyval{after-title}{code}\Default
\meta{code}\sinceversion{0.3} is inserted after the title of the song but
before the body of the environment.
% \keybool{numbered}\Default{false}
% Determines wether verses are numbered or not.
\keyval{print-tags}{list of tags}
A comma separated list of tags. When specified a song will only be printed
if it is tagged with at least one of the tags in \meta{list of tags}.
\keyval{add-to-reset}{list of counters}
A\sinceversion{0.3} comma separated list of counters which should be
reset for each song.
\keybool{obey-lines}\Default{false}
An experimental option. Use at your own risk! If set to \code{true} then
inside the \env{verse} like environments end-of-lines will be obeyed and
start a new line. This comes with a price when using chords, see
section~\ref{sec:placing-chords:caveat}.
\keybool{bar-shortcuts}\Default{false}
Makes the characters \shortcut{:} and \shortcut{\barsymbol} active inside
the \env{song} environment. See sections~\ref{sec:special-characters}
and~\ref{sec:typesetting-bars} for more details.
\keybool{disable-measuring}\Default{false}
\sinceversion{0.4}This option turns off the song height measuring. This
makes song title template definitions easier (see section~\ref{sec:title-templates} for
details). \emph{The song property \property{height} will be set to 0pt then!}
\end{options}
\subsection{Song Properties}\label{sec:song-properties}
Songs can have a number of properties which basically are used in songtitle
templates (see section~\ref{sec:title-templates}). One specific property,
\property{tags}, plays a different role, though.
\begin{properties}
\prop{title}{title}
This is the main title of the song.
\prop{subtitle}{subtitle}
A subtitle.
\prop{short-title}{short song title}
A short title (may be useful in a template that writes the titles in
\cs*{section}s for a version to be used in the table of contents).
\prop{sort-title}{song title}
If not set explicitly this property holds the same value as
\property{title}.
\prop{sort-short-title}{short song title}
If not set explicitly this property holds the same value as
\property{short-title}.
\prop{composer}{composer}
The composer of the song. As of now this accepts an arbitrary entry but
maybe this will not be supported any more when indexing will be
implemented. No promises.
\prop{sort-composer}{composer}
If not set explicitly this property holds the same value as
\property{composer}.
\prop{lyrics}{writer}
Whoever wrote the lyrics if different from the composer. As of now this
accepts an arbitrary entry but maybe this will not be supported any more
when indexing will be implemented. No promises.
\prop{sort-lyrics}{writer}
If not set explicitly this property holds the same value as
\property{writer}.
\prop{arr}{arranger}
Whoever arranged the song. As of now this accepts an arbitrary entry but
maybe this will not be supported any more when indexing will be
implemented. No promises.
\prop{sort-arr}{arranger}
If not set explicitly this property holds the same value as
\property{arr}.
\prop{band}{band}
The band who plays or played the song.
\prop{sort-band}{band}
If not set explicitly this property holds the same value as
\property{band}.
\prop{interpret}{interpret}
The interpret of the song. As of now this accepts an arbitrary entry but
maybe this will not be supported any more when indexing will be
implemented. No promises.
\prop{sort-interpret}{interpret}
If not set explicitly this property holds the same value as
\property{interpret}.
\prop{genre}{genre}
The genre of the song.
\prop{key}{key}
The key of the song. This property is used for transposing and must have
a specific format then, see section~\ref{sec:transposing}.
\prop{capo}{fret}
This property is used for transposing and for the \cs{capo} macro, see
sections~\ref{sec:capo-information} and~\ref{sec:transposing} .
\prop{tempo}{tempo}
The tempo of the song.
\prop{tags}{tags}
A comma separated list of tags. Those tags play a role for the option
\option{print-tags}. When that option is used a song is only printed if
it has at least one of the tags specified in the option.
\end{properties}
There are three more properties, \property{counter}, \property{ID} and
\property{height} that cannot be set but are set automatically for each song.
The \property{counter} simply holds the number of the current song starting
from \code{1} for the first song. The \property{ID} currently always is
\code{song\meta{counter}} where \meta{counter} is the current
\property{counter} value. The property \property{height} holds the height of
the typeset song in pt. The height is determined by placing the body of the
respective \env{song} environment in a vertical box and measuring the height
and depth of the box. This is done in a measuring phase that can and should
be tested in a songtitle template definition, see
section~\ref{sec:title-templates} for details. \emph{This is important since
the property \property{height} is not available in the measuring phase but
only afterwards!} If the option \option{disable-measuring} has been set the
property \property{height} will have the value~0pt!
In principle all properties can get list of entries where items are separated
with \code{\visualizespaces{ and }}. Of course this doesn't make sense for
each property -- a song does only have one title. But a song can very well
have more than one composer: think of the Beatles where most songs were
written by Paul McCartney and John Lennon\footnote{This is not quite true:
most songs were mostly written either by Paul or John but legally usually
both are the composers.}.
It is possibly to define further such properties. For details see
section~\ref{sec:own-templates}.
\subsection{Special Characters}\label{sec:special-characters}
Inside the \env{song} environment several characters don't have their usual
catecory codes:
\begin{labeling}[--]{xxxxx}
\item[\shortcut{\textasciicircum}] category code 13 (active). It is a
shortcut for the \cs{chord} command.
\item[\shortcut{\_}] category code 13 (active). It is a shortcut for the
\cs{writechord} command.
\item[\shortcut{\barsymbol}] category code 13 (active). Used for
typesetting bars.
\item[\shortcut{:}] category code 13 (active). Used for typesetting bars.
\item[\code{\#}] category code 12 (other). Used for chord names.
\end{labeling}
Actually the characters \shortcut{\barsymbol} and \shortcut{:} are \emph{not}
changed per default. In order to do that you have to use the option
\option{bar-shortcuts}.
For details on the usage of the characters \shortcut{\barsymbol} and
\shortcut{:} see section~\ref{sec:typesetting-bars}. The usage of chords is
explained in section~\ref{sec:placing-chords}.
\subsection{Capo Information}\label{sec:capo-information}
When you set the \property{capo} property the macro \cs{capo} writes
\begin{center}
\GetTranslation{leadsheets/capo}: IV.~\GetTranslation{leadsheets/fret}
\end{center}
What it writes \emph{exactly} depends on a few settings: the \property{capo}
property obviously, which determines the number that is printed. The
translations for the \enquote{capo} and \enquote{fret} strings (see
section~\ref{sec:internationalization} for details) and the setting of the
following option:
\begin{options}
\keychoice{capo-nr-format}{arabic,roman,Roman}\Default{Roman}
The format of the number printed by the \cs{capo} macro.
\keyval{capo-nr}{code}\Default{\#1.}
The code to print the number. In the code refer to the number with
\code{\#1}.
\end{options}
\section{The \env*{verse} Environment}\label{sec:envverse-environment}
\begin{environments}
\environment{verse}[\oarg{options}]
An environment for specifying the verses of a song.
\environment{verse*}[\oarg{options}]
The same as the \env{verse} environment but will always be unnumbered
regardless of any option settings.
\end{environments}
\begin{example}[
compile,
graphics={trim={2cm 18cm 2cm 2cm},clip},
add-sourcecode-options={literate=}]
\documentclass{article}
\usepackage{leadsheets}
\setleadsheets{verse/numbered=true}
\begin{document}
\begin{song}{title=Foo}
\begin{verse}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr,\\
sed diam nonumy eirmod tempor invidunt ut labore et dolore\\
magna aliquyam erat, sed diam voluptua.
\end{verse}
\begin{verse*}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr,\\
sed diam nonumy eirmod tempor invidunt ut labore et dolore\\
magna aliquyam erat, sed diam voluptua.
\end{verse*}
\begin{verse}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr,\\
sed diam nonumy eirmod tempor invidunt ut labore et dolore\\
magna aliquyam erat, sed diam voluptua.
\end{verse}
\end{song}
\end{document}
\end{example}
\subsection{Options}\label{sec:verses-options}
The \env{verse} environment and all related environments have the following
options:
\begin{options}
\keyval{format}{code}\Default
\meta{code} is inserted at the beginning of the environment and can thus
be used to add formatting, \eg, \keyis{format}{\cs*{itshape}}.
\keyval{label-format}{code}\Default
The same for the environment labels. The last command may take the label
as an argument so you can also use \cs*{textbf} for example.
\keyval{class}{class-name}\Default{default}
The\sinceversion{0.2} \env{verse} environment and all related environments
all belong to a class, the default class is called \code{default}. This
is of interest when using the \option{remember-chords} and
\option{recall-chords} options.\label{option:class}
\end{options}
This can be used either locally, \ie, as option to the corresponding
environment, or for all environments of the same type using the setup command
using the following syntax:
\begin{center}
\cs{setleadsheets}\Marg{\meta{env name}/format = \meta{code}}
\end{center}
\begin{example}
\begin{verse}[format=\itshape]
Lorem ipsum dolor sit amet, consetetur sadipscing elitr,\\
sed diam nonumy eirmod tempor invidunt ut labore et dolore\\
magna aliquyam erat, sed diam voluptua.
\end{verse}
\end{example}
It is also possible so set the formatting for all related environments at
once:
\begin{options}
\keyval{verses-format}{code}\Default
Sets the format for all \env{verse} like environments.
\keyval{verses-label-format}{code}\Default
Sets the label format for all \env{verse} like environments.
\end{options}
Both options are overwritten if the options for a specific environment are