| 1 |
%% LyX 2.3.2 created this file. For more info, see http://www.lyx.org/. |
| 2 |
%% Do not edit unless you really know what you are doing. |
| 3 |
\documentclass[english]{scrartcl} |
| 4 |
\usepackage[osf]{libertineRoman} |
| 5 |
\usepackage[osf]{biolinum} |
| 6 |
\renewcommand{\ttdefault}{cmtt} |
| 7 |
\usepackage[libertine]{newtxmath} |
| 8 |
\usepackage[T1]{fontenc} |
| 9 |
\usepackage[latin9]{inputenc} |
| 10 |
\setcounter{tocdepth}{2} |
| 11 |
\usepackage{color} |
| 12 |
\usepackage{babel} |
| 13 |
\usepackage{booktabs} |
| 14 |
\usepackage{textcomp} |
| 15 |
\usepackage{url} |
| 16 |
\usepackage{microtype} |
| 17 |
\usepackage[unicode=true, |
| 18 |
bookmarks=true,bookmarksnumbered=false,bookmarksopen=false, |
| 19 |
breaklinks=false,pdfborder={0 0 0},pdfborderstyle={},backref=false,colorlinks=false] |
| 20 |
{hyperref} |
| 21 |
|
| 22 |
\makeatletter |
| 23 |
|
| 24 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands. |
| 25 |
\newcommand{\noun}[1]{\textsc{#1}} |
| 26 |
\newcommand*\LyXZeroWidthSpace{\hspace{0pt}} |
| 27 |
%% Because html converters don't know tabularnewline |
| 28 |
\providecommand{\tabularnewline}{\\} |
| 29 |
|
| 30 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands. |
| 31 |
\usepackage{chordbox} |
| 32 |
\usepackage{filecontents} |
| 33 |
|
| 34 |
\newcommand\TikZ{Ti\emph{k}Z} |
| 35 |
\newcommand\version{v1.0} |
| 36 |
\hypersetup{ |
| 37 |
pdftitle={Chordbox \version\ Documentation}, |
| 38 |
pdfauthor={Steven Franzen} |
| 39 |
} |
| 40 |
\setkomafont{descriptionlabel}{\ttfamily\color{red}} |
| 41 |
\makeatletter |
| 42 |
\newcommand\namedlabel[2]{\begingroup |
| 43 |
\def\@currentlabel{#2}% |
| 44 |
\label{#1}\endgroup |
| 45 |
} |
| 46 |
\makeatother |
| 47 |
\begin{filecontents}{chordbox.bib} |
| 48 |
@software{leadsheets, |
| 49 |
author = {Clemens Niederberger}, |
| 50 |
title = {leadsheets}, |
| 51 |
url = {https://ctan.org/pkg/leadsheets/}, |
| 52 |
version = {0.5b}, |
| 53 |
date = {2017-09-26}, |
| 54 |
} |
| 55 |
@software{guitarchordschemes, |
| 56 |
author = {Clemens Niederberger}, |
| 57 |
title = {guitarchordschemes}, |
| 58 |
url = {https://ctan.org/pkg/guitarchordschemes/}, |
| 59 |
version = {0.7}, |
| 60 |
date = {2016-08-16}, |
| 61 |
} |
| 62 |
@software{gchords, |
| 63 |
author = {Kasper Peeters}, |
| 64 |
title = {gchords}, |
| 65 |
url = {https://ctan.org/pkg/gchords/}, |
| 66 |
version = {1.20}, |
| 67 |
date = {2008-02-03}, |
| 68 |
} |
| 69 |
@software{xifthen, |
| 70 |
author = {Josselin Noirel}, |
| 71 |
title = {xifthen}, |
| 72 |
url = {https://ctan.org/pkg/xifthen/}, |
| 73 |
version = {1.4.0}, |
| 74 |
date = {2015-11-05}, |
| 75 |
} |
| 76 |
@software{xstring, |
| 77 |
author = {Christian Tellechea}, |
| 78 |
title = {xstring}, |
| 79 |
url = {https://ctan.org/pkg/xstring/}, |
| 80 |
version = {1.7c}, |
| 81 |
date = {2013-10-13}, |
| 82 |
} |
| 83 |
@manual{pgfmanual, |
| 84 |
author = {Till Tantau}, |
| 85 |
title = {The TikZ and PGF Packages}, |
| 86 |
subtitle = {Manual for version 3.0.1a}, |
| 87 |
url = {http://sourceforge.net/projects/pgf/}, |
| 88 |
date = {2015-08-29}, |
| 89 |
} |
| 90 |
\end{filecontents} |
| 91 |
|
| 92 |
\makeatother |
| 93 |
|
| 94 |
\usepackage[bibstyle=standard,citestyle=authortitle-comp]{biblatex} |
| 95 |
\addbibresource{chordbox.bib} |
| 96 |
\begin{document} |
| 97 |
\titlehead{\centering\chordbox[3]{G\sharp^{maj7}}{4,x,6,5,4,3}} |
| 98 |
\title{Chordbox} |
| 99 |
\subtitle{A \LaTeX{} package for drawing string instrument chord diagrams} |
| 100 |
\author{Steven Franzen} |
| 101 |
\date{\version\quad\today} |
| 102 |
\publishers{\url{https://github.com/sfranzen/chordbox}} |
| 103 |
|
| 104 |
\maketitle |
| 105 |
\tableofcontents{} |
| 106 |
|
| 107 |
\clearpage{} |
| 108 |
|
| 109 |
\section{Package introduction} |
| 110 |
|
| 111 |
This package is the result of a search similar to the one undertaken |
| 112 |
by Clemens Niederberger for his \texttt{leadsheets} \autocite{leadsheets} |
| 113 |
package: over the years I have collected many textual guitar tabs |
| 114 |
and chord sheets that I finally wanted to put together and typeset |
| 115 |
properly using \LaTeX , including guitar chord diagrams. The first |
| 116 |
part of my requirements is now more than fulfilled by \texttt{leadsheets}, |
| 117 |
which provides all the tools for putting together chords and lyrics. |
| 118 |
For the second part I found that there were only two relevant existing |
| 119 |
packages: \texttt{guitarchordschemes}\autocite{guitarchordschemes} |
| 120 |
and \texttt{gchords}\autocite{gchords}. Neither of these achieved |
| 121 |
exactly what I wanted, so this package is my own attempt at providing |
| 122 |
that tool. |
| 123 |
|
| 124 |
Note that I am far from a \TeX{} guru; I know a bit of \LaTeX{} and |
| 125 |
also have some familiarity with \TikZ{}, so I have gratefully used |
| 126 |
the higher level interfaces provided by said package as well as \texttt{xifthen}\autocite{xifthen} |
| 127 |
and \texttt{xstring}\autocite{xstring} for inspecting arguments. |
| 128 |
The \noun{pgf}/\TikZ{} packages provide a powerful and versatile |
| 129 |
framework for creating vector graphics using \LaTeX{} commands paired |
| 130 |
with a special drawing syntax. One advantage of this is that you can |
| 131 |
fully integrate graphics into your document that will always look |
| 132 |
great: they will use the document fonts and can be rendered at any |
| 133 |
size you desire, avoiding some issues associated with the use of external |
| 134 |
images. This does not come without a cost, however; although the syntax |
| 135 |
introduced by \TikZ{} is concise and easy to read, composing images |
| 136 |
will require some thought, multiple commands and adjustments and can |
| 137 |
be labour-intensive. Also, there is simply so much functionality that |
| 138 |
the official manual\autocite{pgfmanual} currently spans almost 1200 |
| 139 |
pages of dense, though amply illustrated information. |
| 140 |
|
| 141 |
The main aim of the present package is therefore to provide a way |
| 142 |
of typesetting chord diagrams using \TikZ{}, while sparing the user |
| 143 |
from the need to plough through its documentation to learn the required |
| 144 |
drawing syntax. It does this by defining two commands that require |
| 145 |
only a few arguments and encapsulate the necessary drawing instructions. |
| 146 |
Their basic usage is introduced in Section \ref{sec:Usage}, along |
| 147 |
with examples illustrating the various possibilities. Further information |
| 148 |
needed by the drawing algorithm is stored using \noun{pgf}/\TikZ{}' |
| 149 |
native key-value management system, which also makes it quite easy |
| 150 |
to expose settings for modification by the user, allowing you to influence |
| 151 |
the appearance of the resulting chord boxes. These are documented |
| 152 |
in Section \ref{sec:Settings}, with some examples of the commands |
| 153 |
you can use to change them. |
| 154 |
|
| 155 |
\subsection{Loading the package} |
| 156 |
|
| 157 |
\texttt{chordbox} currently does not support \LaTeX{} options, so it |
| 158 |
is loaded simply by putting |
| 159 |
|
| 160 |
\texttt{\textbackslash usepackage\{chordbox\}}\\ |
| 161 |
in your document's preamble. |
| 162 |
|
| 163 |
\subsection{License} |
| 164 |
|
| 165 |
This file is part of chordbox. Chordbox may be distributed and/or |
| 166 |
modified under the conditions of the \LaTeX{} Project Public License, |
| 167 |
either version 1.3 of this license or (at your option) any later version. |
| 168 |
The latest version of this license is in \url{http://www.latex-project.org/lppl.txt} |
| 169 |
and version 1.3 or later is part of all distributions of \LaTeX{} version |
| 170 |
2005/12/01 or later. |
| 171 |
|
| 172 |
Chordbox has the \noun{lppl} maintenance status `maintained'. The |
| 173 |
Current Maintainer of chordbox is Steven Franzen. |
| 174 |
|
| 175 |
\section{Usage\label{sec:Usage}} |
| 176 |
|
| 177 |
The package provides two similar commands, \texttt{\textbackslash chordbox} |
| 178 |
and \texttt{\textbackslash bchordbox}. The latter extends the former |
| 179 |
to draw barred chords. |
| 180 |
|
| 181 |
\subsection{The \texttt{\textbackslash chordbox} command} |
| 182 |
|
| 183 |
Syntax: \texttt{\textbackslash chordbox{[}}\textlangle \emph{base |
| 184 |
fret}\textrangle \texttt{{]}\{}\textlangle \emph{chord name}\textrangle\texttt{\}\{}\textlangle \emph{fret |
| 185 |
positions}\textrangle\texttt{\}} |
| 186 |
|
| 187 |
The simplest form of the command requires you to specify only the |
| 188 |
\textlangle \emph{chord name}\textrangle{} and \textlangle \emph{fret |
| 189 |
positions}\textrangle . The former can contain any text and math symbols |
| 190 |
(see below), the latter should be a comma-separated list of elements, |
| 191 |
one for each string, which may take the following values: |
| 192 |
\begin{itemize} |
| 193 |
\item \textlangle \emph{fret number}\textrangle {[}:\textlangle \emph{fingering |
| 194 |
text}\textrangle {]}\\ |
| 195 |
A (positive) \textlangle \emph{fret number}\textrangle{} marks the |
| 196 |
current string as fretted at that position. It may optionally be followed |
| 197 |
by a colon and a \textlangle \emph{fingering text}\textrangle{} that |
| 198 |
can be displayed on the fret symbol or below the chord box. |
| 199 |
\item \emph{0} (zero)\\ |
| 200 |
Marks the current string as open (unfretted). |
| 201 |
\item \emph{Anything else}\\ |
| 202 |
An empty element or one starting with anything other than a number |
| 203 |
marks the current string as muted (not played). |
| 204 |
\end{itemize} |
| 205 |
It draws a grid resembling vertical strings crossing horizontal frets, |
| 206 |
with a black bar at the top figuring as the instrument's nut. The |
| 207 |
number of strings drawn is determined by the number of \textlangle \emph{fret |
| 208 |
positions}\textrangle{} passed to the command, so generating chord |
| 209 |
diagrams for different instruments is no problem: |
| 210 |
\begin{center} |
| 211 |
\begin{tabular}{ccc} |
| 212 |
Ukulele & 5-string banjo & 6-string guitar\tabularnewline |
| 213 |
\texttt{\small{}\textbackslash chordbox\{Am\}\{2,0,0,0\}} & \texttt{\small{}\textbackslash chordbox\{Am\}\{x,2,2,1,2\}} & \texttt{\small{}\textbackslash chordbox\{Am\}\{x,0,2,2,1,0\}}\tabularnewline |
| 214 |
\chordbox{Am}{2,0,0,0} & \chordbox{Am}{x,2,2,1,2} & \chordbox{Am}{x,0,2,2,1,0}\tabularnewline |
| 215 |
\end{tabular} |
| 216 |
\par\end{center} |
| 217 |
|
| 218 |
The number of frets drawn is initially 4, but this can be changed |
| 219 |
through the configuration key \texttt{\ref{key:numfrets}}. |
| 220 |
|
| 221 |
As mentioned, you can optionally provide fingering information for |
| 222 |
a chord, which is particularly useful for writing chord charts and |
| 223 |
other training materials. Because text on the fret symbol has to be |
| 224 |
scaled to fit inside it and the default scale is small, \texttt{chordbox} |
| 225 |
is initially configured to put this text below the strings, where |
| 226 |
it can be rendered at a larger size. However, the other option may |
| 227 |
be more appealing for larger diagrams, so both options can be used, |
| 228 |
see \texttt{\ref{key:textbelow}} and \texttt{\ref{key:textonnode}}. |
| 229 |
They are illustrated below, where the letter T is used for the thumb |
| 230 |
and the digits for the other fingers, starting at 1 for the index |
| 231 |
finger. The larger chord box on the right has been given a scale of |
| 232 |
2.5 times the default. |
| 233 |
\begin{center} |
| 234 |
\begin{tabular}[t]{cc} |
| 235 |
\multicolumn{2}{c}{\texttt{\small{}\textbackslash chordbox\{F\}\{1:T,3:3,3:4,2:2,1:1,x\}}}\tabularnewline |
| 236 |
\chordbox{F}{1:T,3:3,3:4,2:2,1:1,x} & \pgfkeys{/chordbox/.cd,text on node=fingering,text below=none} |
| 237 |
\tikzset{chordbox/.append style={scale=2}} |
| 238 |
\chordbox{F}{1:T,3:3,3:4,2:2,1:1,x}\tabularnewline |
| 239 |
\end{tabular} |
| 240 |
\par\end{center} |
| 241 |
|
| 242 |
By default, the \textlangle \emph{chord name}\textrangle{} is processed |
| 243 |
by a command that typesets it in math mode and roman type (see \texttt{\nameref{key:name}}). |
| 244 |
This allows the use of math symbols like \texttt{\textbackslash flat} |
| 245 |
and \texttt{\textbackslash sharp} as well as the \textasciicircum{} |
| 246 |
(superscript) operator to typeset decorated chord names: |
| 247 |
\begin{center} |
| 248 |
\begin{tabular}{cc} |
| 249 |
\texttt{\small{}\textbackslash chordbox\{B\textbackslash flat m\}\{x,x,x,3,2,1\}} & \texttt{\small{}\textbackslash chordbox\{F\textbackslash sharp\textasciicircum\{maj7\}\}\{2,x,3,3,2,x\}}\tabularnewline |
| 250 |
\chordbox{B\flat m}{x,x,x,3,2,1} & \chordbox{F\sharp^{maj7}}{2,x,3,3,2,x}\tabularnewline |
| 251 |
\end{tabular} |
| 252 |
\par\end{center} |
| 253 |
|
| 254 |
For best results, make sure to select the same typeface for both text |
| 255 |
and math typesetting. Of course, if you are also using the \texttt{leadsheets} |
| 256 |
package, you could opt to use its \texttt{\textbackslash writechord} |
| 257 |
command for typesetting chord names, see also subsection \ref{subsec:Other-keys}. |
| 258 |
|
| 259 |
The \textlangle \emph{base fret}\textrangle{} is the number that, |
| 260 |
although formally an optional argument, must be provided for chords |
| 261 |
extending past the number of frets in the chord box. It is used to |
| 262 |
position the box and fretted notes relative to this fret, for example |
| 263 |
\texttt{\textbackslash chordbox{[}6{]}\{D\textbackslash sharp m\textasciicircum\{7\textbackslash flat |
| 264 |
5\}\}\{x,6,7,6,7,x\}}: |
| 265 |
|
| 266 |
\chordbox[6]{D\sharp m^{7\flat 5}}{x,6,7,6,7,x} |
| 267 |
|
| 268 |
As can be seen, the nut is not drawn in these cases. |
| 269 |
|
| 270 |
Finally, \texttt{chordbox} can also display the pitch of each note |
| 271 |
in a chord, although the default is not to. The pitches do not need |
| 272 |
to be specified manually, but are determined from the fret positions |
| 273 |
given to the command and the configured tuning (\texttt{\ref{key:tuning}}). |
| 274 |
Just like fingering information, you may choose to display it inside |
| 275 |
the symbols or underneath the chord box, or combine both types of |
| 276 |
information: |
| 277 |
\begin{center} |
| 278 |
\begin{tabular}{rccc} |
| 279 |
Command & \multicolumn{3}{c}{\texttt{\small{}\textbackslash chordbox\{D\}\{x,x,0,2:1,3:3,2:2\}}}\tabularnewline |
| 280 |
\midrule |
| 281 |
Scale & default & 2.5 $\times$ larger & 2.5 $\times$ larger\tabularnewline |
| 282 |
\texttt{text on node} & \texttt{none} & \texttt{pitch} & \texttt{fingering}\tabularnewline |
| 283 |
\texttt{text below} & \texttt{pitch} & \texttt{none} & \texttt{pitch}\tabularnewline |
| 284 |
\midrule |
| 285 |
Result & \pgfkeys{/chordbox/text below=pitch} |
| 286 |
\chordbox{D}{x,x,0,2,3,2} & \pgfkeys{/chordbox/text on node=pitch} |
| 287 |
\tikzset{chordbox/.append style={scale=2.5}} |
| 288 |
\chordbox{D}{x,x,0,2,3,2} & \pgfkeys{/chordbox/.cd,text on node=fingering,text below=pitch} |
| 289 |
\tikzset{chordbox/.append style={scale=2.5}} |
| 290 |
\chordbox{D}{x,x,0,2:1,3:3,2:2}\tabularnewline |
| 291 |
\bottomrule |
| 292 |
\end{tabular} |
| 293 |
\par\end{center} |
| 294 |
|
| 295 |
Chords may of course feature accidentals on some or all of their notes, |
| 296 |
depending on their associated musical key. Typesetting such pitches |
| 297 |
clearly in limited space is more challenging than just single characters, |
| 298 |
such as finger positions. With \TikZ{}, text is most conveniently |
| 299 |
positioned using so-called \emph{nodes}, which can also be scaled |
| 300 |
to display their contents at any size. This leads to the following |
| 301 |
two possible choices: |
| 302 |
\begin{enumerate} |
| 303 |
\item Scale the nodes to the chord box, so they are always as large as possible |
| 304 |
without overlapping; |
| 305 |
\item Do not scale the nodes, but choose a fixed font size for the text, |
| 306 |
small enough to avoid overlap at the chosen scale. |
| 307 |
\end{enumerate} |
| 308 |
The first option has the advantage that overlap is precluded entirely, |
| 309 |
but the node text is scaled as well and will therefore need to be |
| 310 |
changed to a size near that of the unscaled node. Additionally, the |
| 311 |
scaling operation is a purely graphical transformation, which yields |
| 312 |
worse results than selecting a similar font size in the first place. |
| 313 |
This is because a well-designed font has different (namely slightly |
| 314 |
thicker) glyphs for smaller sizes to maintain readability. The second |
| 315 |
option instead has the disadvantage that a font size must be chosen |
| 316 |
manually and calibrated to the size of the chord boxes one wishes |
| 317 |
to render. However, because documents will not usually contain chord |
| 318 |
boxes of many different sizes, I consider this to be a minor point |
| 319 |
and have, at least for now, chosen the second option. The font size |
| 320 |
initially configured specifically for pitch names below the strings |
| 321 |
is \texttt{\textbackslash tiny}, which should produce readable results |
| 322 |
even for the default chord box size. |
| 323 |
|
| 324 |
\subsection{The \texttt{\textbackslash bchordbox} command} |
| 325 |
|
| 326 |
Syntax: \texttt{\textbackslash bchordbox{[}}\textlangle \emph{base |
| 327 |
fret}\textrangle \texttt{{]}\{}\textlangle \emph{chord name}\textrangle\texttt{\}\{}\textlangle \emph{fret |
| 328 |
positions}\textrangle\texttt{\}\{}\textlangle \emph{barre frets}\textrangle\texttt{\}} |
| 329 |
|
| 330 |
As mentioned, this command is for drawing barre chords, for which |
| 331 |
it requires an additional comma-separated list of fret numbers. A |
| 332 |
thick line is drawn over the string symbols at these frets. The other |
| 333 |
arguments are identical to those of \texttt{\textbackslash chordbox}, |
| 334 |
see for example \texttt{\textbackslash bchordbox\{Bm\textasciicircum 7\}\{x,2,4,2,3,2\}\{2\}} |
| 335 |
and \texttt{\textbackslash bchordbox{[}3{]}\{C\}\{x,3,5,5,5,3\}\{3,5\}}: |
| 336 |
|
| 337 |
\bchordbox{Bm^7}{x,2,4,2,3,2}{2} \bchordbox[3]{C}{x,3,5,5,5,3}{3,5} |
| 338 |
|
| 339 |
\section{Settings\label{sec:Settings}} |
| 340 |
|
| 341 |
Because \texttt{chordbox} relies on \noun{pgf}/\TikZ{} for drawing, |
| 342 |
it makes sense to use the powerful \noun{pgf} key management system |
| 343 |
that comes with it. Therefore this package stores its code and style |
| 344 |
settings as keys, some of which may be modified to customise the output. |
| 345 |
This can be done in the preamble or in any part of the document by |
| 346 |
means of \texttt{\textbackslash tikzset} and the more generic \texttt{\textbackslash pgfkeys} |
| 347 |
command. Some examples of usage will be given below, but for more |
| 348 |
reading about \noun{pgf} keys and their handling please refer to Section |
| 349 |
82 of the \noun{pgf} manual\autocite{pgfmanual} where everything |
| 350 |
is documented in full detail. In any case, modifying a key stores |
| 351 |
its value for the \LaTeX{} group where the command is issued and its |
| 352 |
child groups, which can override it again, but it does not propagate |
| 353 |
up to parent groups. |
| 354 |
|
| 355 |
\subsection{\TikZ{} keys} |
| 356 |
|
| 357 |
The items described in this section are called \emph{styles} in \TikZ{} |
| 358 |
terminology and contain (lists of) keys and values that can be applied |
| 359 |
to various drawing commands. Most importantly, the \texttt{chordbox} |
| 360 |
style applies to the whole \texttt{\{tikzpicture\}} environment of |
| 361 |
every chord box produced. The default setting is to scale all coordinates |
| 362 |
by a quarter, because the drawing is done in \noun{pgf}'s ``natural'' |
| 363 |
units that, though convenient to use, result in an impractically large |
| 364 |
picture. Note that this scaling only influences the \TikZ{} coordinates; |
| 365 |
in particular, fonts are not affected by default\footnote{This is because text is put in nodes, which are scaled independently |
| 366 |
of the picture and require the \texttt{scale} and/or \texttt{transform |
| 367 |
shape} options to be supplied.}. |
| 368 |
|
| 369 |
Because these keys are all stored in the \texttt{/tikz} path, it is |
| 370 |
most convenient to change them using the \texttt{\textbackslash tikzset} |
| 371 |
command, for example \texttt{\textbackslash tikzset\{chordbox/.style=\{scale=0.4, |
| 372 |
thick\}\}}. Setting options like this through the \texttt{.style} |
| 373 |
\emph{key handler}, as it is called, replaces any previous contents. |
| 374 |
Other handlers, like \texttt{.prefix style} and \texttt{.append style}, |
| 375 |
can be used to insert additional keys before or after the existing |
| 376 |
style, respectively. For example, calling \texttt{\textbackslash tikzset\{chordbox/.append |
| 377 |
style=\{scale=2\}\}} results in an effective \texttt{chordbox} style |
| 378 |
of \texttt{\{baseline, scale=0.5\}}, because the \texttt{scale} factor |
| 379 |
was set twice. These are special in that multiple values are multiplied |
| 380 |
together, whereas for most other keys only the last occurrence applies. |
| 381 |
\begin{description} |
| 382 |
\item [{/tikz/chordbox}] \hfill{}(style, initially \texttt{\{baseline, |
| 383 |
scale=0.25\}})\\ |
| 384 |
This style is applied to every \texttt{\{tikzpicture\}} environment |
| 385 |
produced by this package. The \texttt{baseline} key sets the base |
| 386 |
line of the picture at a height of 0 pt, which is the top of the grid |
| 387 |
and the bottom of the nut (if drawn). It ensures that multiple chord |
| 388 |
boxes in a row align properly. |
| 389 |
\item [{/tikz/fret~node~text}] \hfill{}(style, initially \texttt{\{font=\textbackslash Large\textbackslash bfseries,text=white\}})\\ |
| 390 |
This style is applied to text drawn on fretted or open string nodes, |
| 391 |
with the colour switched to black for the latter. It aims to make |
| 392 |
the text as clear and as big as possible without increasing the node |
| 393 |
size, which will occur if the text is too tall or wide. |
| 394 |
\item [{/tikz/pitch~text~below}] \hfill{}(style, initially \texttt{\{font=\textbackslash tiny\}})\\ |
| 395 |
This affects only pitch names typeset below the chord box. The initial |
| 396 |
setting is \texttt{\textbackslash tiny} to keep neighbouring notes |
| 397 |
with accidentals from overlapping each other at the default scale. |
| 398 |
\end{description} |
| 399 |
The rest of the styles define the three symbol shapes used for the |
| 400 |
fretted (\tikz[chordbox,above]\coordinate[string=fretted];), open |
| 401 |
(\tikz[chordbox]\coordinate[string=open];) and muted (\tikz[chordbox]\coordinate[string=muted];) |
| 402 |
string positions. |
| 403 |
\begin{description} |
| 404 |
\item [{/tikz/string/base}] \hfill{}(style, initially \texttt{\{circle, |
| 405 |
draw, inner sep=0, minimum size=20, transform shape\}})\\ |
| 406 |
Common options for all three symbols. The \texttt{transform shape} |
| 407 |
option is required to correctly scale the symbols, which are implemented |
| 408 |
as \TikZ{} nodes, with the rest of the picture. |
| 409 |
\item [{/tikz/string/fretted}] \hfill{}(style, initially \texttt{\{string/base, |
| 410 |
fill\}}) |
| 411 |
\item [{/tikz/string/open}] \hfill{}(style, initially \texttt{\{string/base, |
| 412 |
above\}}) |
| 413 |
\item [{/tikz/string/muted}] \hfill{}(style, initially \texttt{\{string/open, |
| 414 |
cross out, minimum size=19\}}) |
| 415 |
\end{description} |
| 416 |
|
| 417 |
\subsection{Other keys\label{subsec:Other-keys}} |
| 418 |
|
| 419 |
The following keys are not passed directly to \TikZ{} commands, but |
| 420 |
used to store various other settings and code. They are all in the |
| 421 |
\texttt{/chordbox} path and should be set using the \texttt{\textbackslash pgfkeys} |
| 422 |
command, for example \texttt{\textbackslash pgfkeys\{/chordbox/name/.code=\textbackslash writechord\{\#1\}\}}. |
| 423 |
Keys that execute code, like this example, produce output with occurrences |
| 424 |
of \texttt{\#1} replaced by the relevant value. If you want to change |
| 425 |
more than one of these settings at once, it is shorter to issue a |
| 426 |
command like the following: \texttt{\textbackslash pgfkeys\{/chordbox/.cd, |
| 427 |
numfrets=5, fingering text=on node\}}. |
| 428 |
\begin{description} |
| 429 |
\item [{/chordbox/numfrets\texttt{\textcolor{black}{\small{}=\textlangle }}\texttt{\textcolor{black}{\emph{\small{}number}}}\texttt{\textcolor{black}{\small{}\textrangle }}\namedlabel{key:numfrets}{/chordbox/numfrets}}] \hfill{}(initially |
| 430 |
\texttt{4}) \\ |
| 431 |
The number of frets drawn in each chord box. |
| 432 |
\item [{/chordbox/base~fret}] \hfill{}(initially \texttt{\{fr\textbackslash raisebox\{.5ex\}\{\textbackslash scriptsize\#1\}})\\ |
| 433 |
This key stores the code used to typeset the base fret position of |
| 434 |
a chord box, if provided and greater than 1. |
| 435 |
\item [{/chordbox/name\label{key:name}}] \hfill{}(initially \texttt{\textbackslash ensuremath\{\textbackslash mathrm\{\#1\}\}})\\ |
| 436 |
The code that is used to typeset the name of the chord. |
| 437 |
\end{description} |
| 438 |
The next two keys govern the placement of extra information in the |
| 439 |
chord box. In both cases, the \texttt{fingering} text is only displayed |
| 440 |
if actually present in the input. |
| 441 |
\begin{description} |
| 442 |
\item [{/chordbox/text~below\texttt{\textcolor{black}{\small{}=none|fingering|pitch}}\namedlabel{key:textbelow}{/chordbox/text below}}] \hfill{}(initially |
| 443 |
\texttt{fingering})\\ |
| 444 |
Selects what to display below each string. |
| 445 |
\item [{/chordbox/text~on~node\texttt{\textcolor{black}{\small{}=none|fingering|pitch}}\namedlabel{key:textonnode}{/chordbox/text on node}}] \hfill{}(initially |
| 446 |
\texttt{none})\\ |
| 447 |
Selects what to display inside the string symbols. |
| 448 |
\end{description} |
| 449 |
The remaining keys determine how pitch information is calculated and |
| 450 |
displayed. Pitches should be given enclosed in quotation marks and |
| 451 |
accidentals should be specified as \texttt{b} (flat) or \texttt{\textbackslash\#} |
| 452 |
(sharp); these will be replaced by their respective symbols. |
| 453 |
\begin{description} |
| 454 |
\item [{/chordbox/flat~symbol\texttt{\textcolor{black}{\small{}=\textlangle }}\texttt{\textcolor{black}{\emph{\small{}symbol}}}\texttt{\textcolor{black}{\small{}\textrangle{}}}}] \hfill{}(initially |
| 455 |
\texttt{\textbackslash flat}) |
| 456 |
\item [{/chordbox/sharp~symbol\texttt{\textcolor{black}{\small{}=\textlangle }}\texttt{\textcolor{black}{\emph{\small{}symbol}}}\texttt{\textcolor{black}{\small{}\textrangle{}}}}] \hfill{}(initially |
| 457 |
\texttt{\textbackslash sharp}) |
| 458 |
\item [{/chordbox/pitch~names\texttt{\textcolor{black}{\small{}=\textlangle }}\texttt{\textcolor{black}{\emph{\small{}list~of~pitches}}}\texttt{\textcolor{black}{\small{}\textrangle{}}}}] \hfill{}(initially |
| 459 |
\texttt{\{\textquotedbl A\textquotedbl ,\textquotedbl A\textbackslash\#\textquotedbl ,\textquotedbl B\textquotedbl ,\textquotedbl C\textquotedbl ,\textquotedbl C\textbackslash\#\textquotedbl ,\LyXZeroWidthSpace\textquotedbl D\textquotedbl ,\textquotedbl D\textbackslash\#\textquotedbl ,\textquotedbl E\textquotedbl ,\textquotedbl F\textquotedbl ,\textquotedbl F\textbackslash\#\textquotedbl ,\textquotedbl G\textquotedbl ,\textquotedbl G\textbackslash\#\textquotedbl\}})\\ |
| 460 |
The names of the pitches to be used for display. The list need not |
| 461 |
start at A, but it must contain twelve sequential semitones. |
| 462 |
\item [{/chordbox/tuning\texttt{\textcolor{black}{\small{}=\textlangle }}\texttt{\textcolor{black}{\emph{\small{}list~of~pitches}}}\texttt{\textcolor{black}{\small{}\textrangle }}\namedlabel{key:tuning}{/chordbox/tuning}}] \hfill{}(initially |
| 463 |
\texttt{\{"E","A","D","G","B","E"\}})\\ |
| 464 |
The tuning of the instrument for which chord boxes are to be drawn. |
| 465 |
It is used to determine the pitches of the chord and must consist |
| 466 |
of elements present in \texttt{pitch names}. |
| 467 |
\end{description} |
| 468 |
|
| 469 |
\appendix |
| 470 |
\printbibliography[heading=bibintoc] |
| 471 |
|
| 472 |
\end{document} |