Debian Codegraph @

texmf-dist/doc/latex/chordbars/chordbars_manual.tex

raw
1 %% file: chordbars_manual.tex
2 %% Copyright 2018-2024 M. Sebastien Kramm
3 %
4 % This work may be distributed and/or modified under the
5 % conditions of the LaTeX Project Public License, either version 1.3c
6 % of this license or (at your option) any later version.
7 % The latest version of this license is in
8 % http://www.latex-project.org/lppl.txt
9 % and version 1.3 or later is part of all distributions of LaTeX
10 % version 2005/12/01 or later.
11 %
12 % This work has the LPPL maintenance status `maintained'.
13 %
14 % The Current Maintainer of this work is M. Sebastien Kramm
15 %
16 % This work consists of the files chordbars.sty and chordbars_manual.tex
17
18 % Home page: https://github.com/skramm/chordbars
19
20 \documentclass[11pt]{article}
21 \usepackage[utf8]{inputenc}
22 \usepackage{hyperref}
23 \usepackage[left=2.00cm,vmargin=1cm]{geometry}
24 \usepackage{mathcomp} % for \textdiscount
25 \usepackage{listings}
26 \usepackage{mdframed}
27
28 \usepackage{enumitem}
29 \setlist{nosep}
30
31 \lstset{
32 frame=single
33 ,language=TeX
34 ,basicstyle=\ttfamily
35 % ,escapechar=\*
36 }
37 \usepackage{chordbars}
38
39 % Add an extra line between paragraphs.
40 \setlength{\parskip}{0.5\baselineskip}
41
42 % Remove the indent at the start of paragraphs.
43 \setlength{\parindent}{0pt}
44
45 % Bold + tt
46 \newcommand{\btt}{\bfseries \ttfamily }
47
48 % shorthand
49 \newcommand{\tbs}{\textbackslash{}}
50
51 %\usepackage{parskip}
52
53 \title{The chordbars package}
54 \author{S. Kramm}
55 \date{\today {} - release 1.3.2}
56 \begin{document}
57 \maketitle
58
59 \begin{abstract}
60 This Tikz-based musical notation related package is targeted at guitar / bass / piano / whatever players that are playing "popular music" accompaniment.
61 They usually need only the chords and the song structure.
62 This package produces rectangular song patterns with "1 square per bar", with the chord shown inside the square.
63 It also handles the song structure by showing the bar count, and the repetitions of the patterns.
64 \end{abstract}
65
66 Package home page: \url{https://github.com/skramm/chordbars}
67
68 \section{Motivation}
69
70 This type of accompaniment notation is used when you don't need the melody, but you do need the exact chord and bar count.
71 In that case, the full musical sheet is useless, although it can be used to print the chords.
72 So some people like to write down the requested song/chord structure in a graphical view (see below).
73 To produce these, some people use GUI software such as word processors, but this has a lot of drawbacks.
74 The aim of this package is to have a \LaTeX{} way of producing these, with minimal effort.
75
76
77 \section{Usage}
78 \subsection{Basic usage}
79 This package provides a single environnment, named {\ttfamily chordbar}, that has 2 mandatory arguments.
80 The first argument is the number of bars, and the second is the pattern name.
81 The latter one can be empty.
82 Inside this environment, you can use several commands, the most basic one is
83 \verb|\chordf| (for "Chord Full bar") that has as unique argument the chord name.
84 This argument will just be printed out "as is", usually something like Cm7, Db9, FMaj7, etc.
85
86 For example, the classical 12-bar blues progression will be written as:
87
88 \def\chordFontSize{\huge\bfseries}
89 \lstinputlisting{manual_lst/listing_blues.lst}
90
91
92 This will be rendered as:
93
94 \input{manual_lst/listing_blues.lst}
95
96 Each square stands for a 4-beat bar, and this is read left to right.
97 The special symbol you can see in bars 4, 6 and 8 means "play the same (harmonic) content on this bar as the previous bar".
98
99 As usual with \LaTeX{} source files, spaces and line-feeds are ignored.
100
101 The default behavior is to have 4-bars long lines, but you can change this anytime by giving a different value to {\btt \tbs NumberOfBarsPerLine}. For example, issuing the command
102
103
104 \begin{lstlisting}
105 \def\NumberOfBarsPerLine{3}
106 \end{lstlisting}
107
108 just before the above source code will print out the same 12-bars blues as above, but in a rather awkward view with 6 bars per line\footnote{Don't do this, of course!}.
109
110 \def\NumberOfBarsPerLine{6}
111 \input{manual_lst/listing_blues.lst}
112
113 \subsection{Handling song structure and bar count}
114
115 This package can also be used to print the song structure by showing the number of repetitions of each part and by counting the bars.
116 The number of repetitions of the part can be given as an optional argument to the environment.
117 To enable this, you need to activate this option, with this inserted after the \verb!\begin{document}! :
118
119 \begin{lstlisting}
120 \countbarsYes
121 \end{lstlisting}
122
123 Then, this:
124 \lstinputlisting{manual_lst/listingA.lst}
125
126 will give the following output, correctly printing out '13' as the initial bar number of the second part (part 1 is 4 bars long and is repeated 3 times).
127
128 \def\NumberOfBarsPerLine{4}
129 \resetchordbars
130 \countbarsYes
131 %\mbox{
132 \input{manual_lst/listingA.lst}
133 %}
134
135 \subsection{Two chords per bar}
136 The command \verb|\chordh| ("h" for "{\em half-chord}") enables printing two chords per bar, as this happens quite often.
137 Its two arguments are the two chords of the bar.
138 For example, the well-know tune "House of the Rising Sun"\footnote{The Animals} chord structure can be printed as this:
139
140 \lstinputlisting{manual_lst/listing_HOTRS.lst}
141
142 This will be rendered as:
143 \def\chordFontSize{\Large\bfseries}
144 \resetchordbars
145 \countbarsNo
146 \input{manual_lst/listing_HOTRS.lst}
147
148
149 \subsection{Starred environment version}
150
151 In some situations, the song structure will hold some repetitions of some parts, say first verse, second verse, chorus, third verse, chorus, ..., with every verse and every chorus having the same harmonic structure.
152 This can of course be represented by a new "chordbar" environment for every part, in which you just copy/paste the chords from previous section.
153 But this will quicky generate a sheet having more than one page, which can make it difficult to use live.
154 Personally, it if can fit on a single page, it's the best.
155
156 Thus, this package provides a "starred" environment version.
157 It is there just as a reminder that at this step, you just play "part xx", and the reader must check out above on the sheet the "part xx".
158 Its usage is similar to the regular version, unless you just keep it empty.
159 It will keep track of the measure count, and generates a unified view.
160
161 \lstinputlisting[float=*,caption=A demo of the starred environment version,label=lst:starred]{manual_lst/listing_starred.lst}
162
163 For example, the above song structure could be written as Listing \ref{lst:starred}, and it will be rendered as seen on Fig.~\ref{fig:starred}.
164 %This will be rendered as:
165 \def\chordFontSize{\Large\bfseries}
166 \resetchordbars
167 \countbarsYes
168 \begin{figure}
169 \begin{mdframed}
170 \input{manual_lst/listing_starred.lst}
171 \end{mdframed}
172 \caption{Rendering of Listing \ref{lst:starred}}
173 \label{fig:starred}
174 \end{figure}
175
176 \subsection{Chord notation}
177
178 \paragraph{Sharps and flats}
179
180 If you know \LaTeX, you may know that the {\btt \#} character is a "reserved character" and as such you should'nt be able to use it inside your source file.
181 However a special trick has been used here so you can directly type {\btt \tbs chordf\{C\#\}}.
182
183 Warning: this {\bf may} lead to some problems in "some" situations, that are not yet clearly identified\footnote{See \url{https://tex.stackexchange.com/a/467566/11083} for details.}.
184 If you encounter an issue, please report it on the home page of this package and post an MCVE\footnote{Minimal, Complete, and Verifiable Example}.
185
186 The alternate solution is either to escape the \# or to use the {\btt \tbs sharp} and {\btt \tbs flat} symbols, that have been "textified" so you don't need to enter math mode.
187 This has the advantage of being also a bit "prettier", although maybe less readable (?).
188 You can see below the compared renderings of the two alternatives.
189 Keep in mind that the goal is not to be "pretty" but rather to be able to read it while performing on stage, in a potential difficult lighting situation.
190 %in a dark environment such a gig stage.
191
192 \vspace{1em}
193
194 \noindent
195 \begin{minipage}{0.6\textwidth}
196 \lstinputlisting{manual_lst/listing_sharp_flat.lst}
197 \end{minipage}
198 %
199 \begin{minipage}{0.3\textwidth}
200 \def\chordFontSize{\Huge\bfseries}
201 \resetchordbars
202 \countbarsNo
203 \input{manual_lst/listing_sharp_flat.lst}
204 \end{minipage}
205
206 \paragraph{Other chords}
207 This isn't directly related with the package but it provides some shorthands to write chord names.
208
209 %For example in Europe the "m7b5" (VIIth degree of minor scale) is frequently noted \O{} and called "half-diminished" chord.
210 %This is rendered with the \LaTeX{} native symbol {\tt \textbackslash O}.
211 %The diminished chord, sometimes named "dim" (minor third, diminished fifth and minor seventh) is noted \dim.
212 %This is rendered with the command {\tt \textbackslash dim}
213 %(defined as an alias on symbol {\tt \textbackslash fullmoon} from package {\tt wasysym}.
214 \begin{itemize}
215 \item The "m7b5" (VIIth degree of minor scale) is frequently noted \O{} and called "half-diminished" chord.
216 This is rendered with the \LaTeX{} native symbol {\tt \textbackslash O}.
217 \item The diminished chord, sometimes named "dim" (minor third, diminished fifth and minor seventh) is noted \dim.
218 This is rendered with the command {\tt \textbackslash dim}
219 (defined as an alias on symbol {\tt \textbackslash fullmoon} from package {\tt wasysym}.
220 \item The Maj7 chord is sometimes noted $\Delta$
221 (\LaTeX{} math symbol {\tt \$\textbackslash Delta\$}).
222 A shorthand is provided with the symbol {\tt \textbackslash MajS}.
223
224 \item the "sus4" (chord without a third and with an added 4th) and the "add9" (chord without a 7th and with an added 9th) can be noted with
225 {\tt \textbackslash susF} and {\tt \textbackslash addN}.
226 \end{itemize}
227
228 See below a comparison of these notations:
229
230 \def\chordFontSize{\normalsize\bfseries}
231 \noindent
232 \begin{minipage}{0.40\textwidth}
233 \lstinputlisting{manual_lst/listing_notation.lst}
234 \end{minipage}
235 %
236 \begin{minipage}{0.60\textwidth}
237 \def\NumberOfBarsPerLine{5}
238 \def\barsize{2.3}
239 \input{manual_lst/listing_notation.lst}
240 \end{minipage}
241
242
243 \subsection{Long parts on same chord}
244 In some songs, you often have several bars on the same chord, say as an introduction or a bridge between two parts.
245 Instead of filling a whole chordbars environment, a command is provided that will simply render the desired number of bars with the initial chord noted in first bar.
246
247 For example, if you need a 8 bar intro on Gm7 chord, you can do this:
248 \begin{lstlisting}
249 \chordline{C#m7}{8}{Intro}
250 \end{lstlisting}
251
252 that will be rendered as this:
253
254 \chordline{C#m7}{8}{Intro}
255
256 Of course, the part and bar count will take this into account.
257 Please note that this will always be a single line, so it is limited to standard situations (4 or 8 bars), it should not be used for longer parts.
258
259 \subsection{Half bars}
260
261 In some tunes, there can be a "special" bar inserted at one point that only has 2 beats instead of the regular 4-beat bars.
262 This is handled with the special command {\btt \tbs addHalfBar} thats needs to be inserted in last position in a {\btt chordbar} environment.
263
264 See for example this chord progression and its rendering:
265
266 \lstinputlisting{manual_lst/listing_halfbar.lst}
267
268 \resetchordbars
269 \countbarsYes
270 \input{manual_lst/listing_halfbar.lst}
271
272 Parts 2 and 3 have an extra 2-beats bar added at the end, and the bar count is adjusted to take this into account, even in the case of part repetitions.
273
274 \subsection{Song title}
275
276 The package provides a {\btt \tbs songtitle} command that will format nicely the data given in the preamble with the classical
277 {\btt \tbs title} and {\btt \tbs author} commands.
278
279
280 \section{Configuration}
281 \label{sec:config}
282
283 Several commands allow to customize the way the grids are printed out.
284
285 \subsection{Grid size}
286
287 The size of the grids can be adjusted with the internal variable
288 {\btt \tbs barsize}.
289 The default value is 1.6cm, but you can adjust it anytime inside your document, for example with:\\
290 {\btt \tbs def\tbs barsize\{1.8\}}
291
292 The default behavior is to have a ratio of 0.8 between the vertical size and the horizontal size of the grid.
293 This can be adjusted any time in the document with, say: \\
294 {\btt \tbs def\tbs ycoeff\{0.6\}} \\
295 (A value of 1 will produce squares).
296
297 \subsection{Font}
298
299 The font used for the chords can be adjusted by redefining the variable {\btt \tbs chordFontSize} with classical \LaTeX{} font specifications.
300 The default value is {\btt \tbs normalsize \tbs bfseries}.
301 If you need better readability when extending grid size, you can add for example this anywhere in your document:
302
303 {\btt \tbs def\tbs chordFontSize\{\tbs huge\tbs bfseries\}}
304
305 To see an example of relative sizes, check the provided file \href{https://github.com/skramm/chordbars/raw/master/size_demo.pdf}{size\_demo.pdf}.
306
307 \subsection{Bar count}
308
309 The command {\btt \tbs countbarsYes} enables counting the bars of the song:
310 each grid will have printed on the left side the number of the first bar of the grid.
311 It also enables printing the number of repetitions of this part on the right side of the grid.
312
313 This command is useful in the sense that this package can be used in two ways:
314 it can provide the whole structure of a song.
315 In that case, it is useful to have for each part the number of repetitions and the bar count, so that when the band leader says "lets start again at bar 75", everybody can find it easily.
316
317 On the other side, this package can be used also to provide a quick way to show the harmony of the different parts, without any structure or bar count.
318 In this situation, printing the bar number is useless.
319
320 To stop this behaviour (anytime), the command is {\btt \tbs countbarsNo}.
321
322 Additionaly, if the bar counting is enabled, then the package can compute the total number of bars and the duration of the song.
323 This is done by issuing the command {\btt \tbs printNbBars} at the end of the file.
324 The duration of the song depends on both the {\em tempo} of the song, expressed in BPM, and the number of beats per bar.
325 The latter can be given with the command {\btt \tbs bpm}, for example:
326 {\btt \tbs bpm\{120\}}.
327
328 The number of beats per bar is limited at present at two values, 3 or 4, with the two commands
329 {\btt \tbs bpbfour} or {\btt \tbs bpbthree}.
330 The default value is 4 beats per bar.
331
332 The command {\ttfamily \textbackslash resetchordbars} will reset the bar and part counters, useful if you want to print two songs in the same document.
333
334 \subsection{Repeating bars}
335
336 As you have seen above, the command {\btt \tbs repeatBar} will be rendered as "./."
337 %$\textdiscount${}
338 and means "repeat last bar".
339 In some situations, it can be useful to show a repetition spanning two bars.
340 For this you can use {\btt \tbs repeatBarPair}.
341 For example, see the source below showing a classical II-V-I pattern played 4 times and its rendering:
342
343 \def\NumberOfBarsPerLine{8}
344
345 \vspace{1em}
346 \noindent
347 %\begin{minipage}{0.45\textwidth}
348 \lstinputlisting{manual_lst/listing_RBP.lst}
349 %\end{minipage}
350 %
351 %\begin{minipage}{0.42\textwidth}
352 \countbarsNo
353 \input{manual_lst/listing_RBP.lst}
354 %\end{minipage}
355
356
357 \section{Reference}
358
359 This section is useful for those who want to contribute or expand this package.
360
361 Internal counters:
362
363 \begin{itemize}
364 \item {\btt NumMesure}
365 \item {\btt NumPart}
366 \item {\btt CurrentBarInLine}
367 \item {\btt CurrentBar}
368 \item {\btt CurrentLine}
369 \end{itemize}
370
371 \section{Troubleshooting}
372
373 The relative sizes of the grid and the chord printing are not automatically adjusted.
374 Thus, in some case, the chord name will be too large for the grid.
375 In that case, you just need to enlarge the grid size and/or adjust the font size (see section \ref {sec:config}).
376
377 \section{Release history}
378
379 \begin{itemize}
380 \item 2018-12-28: First release (v1.0) and upload to CTAN
381
382 \item 2018-12-29: Release 1.1, added commands {\btt \tbs chordline} and {\btt \tbs addHalfBar}, added font commands, fixed manual, bugfixes
383
384 \item 2020-05-29: release 1.2.2
385 \begin{itemize}
386 \item fixed symbol ("times") for nb of repetitions
387 \item added some chords shorthands (dim, MajS, sus4, add9)
388 \item fixed horizontal position of number of repetitions (WIP !!!)
389 \item added starred version of environment chordbar
390 \item bugfixes
391 \end{itemize}
392
393 \item 2024-03-02: release 1.3.2 (bugfix, added Makefile)
394
395 \end{itemize}
396
397
398
399
400 \end{document}