Debian Codegraph @

texmf-dist/doc/latex/recorder-fingering/recorder-fingering.tex

raw
1 % !TEX TS-program = LuaLaTeXmk
2
3 \documentclass[11pt]{article}
4 \usepackage{calc}
5 \usepackage{fontspec}
6 \usepackage[lmargin=.75in,rmargin=.75in,tmargin=1in,bmargin=1in]{geometry}
7 \usepackage{titling}
8 \usepackage{array, booktabs,tabularx}
9 \usepackage{enumitem}
10 \usepackage{fancyvrb}
11 \usepackage{listings}
12 \usepackage{url}
13 \usepackage[sf,small]{titlesec}
14 \usepackage[section]{placeins}
15 \setmonofont{Inconsolatazi4}
16 \usepackage{recorder-fingering}
17 \usepackage{parskip}
18 \usepackage{musixtex}
19 \input musixlyr
20 % musixtex and biblatex clash
21 \let\mxaddspace\addspace
22 \let\addspace\relax
23 \AtBeginEnvironment{music}{\let\addspace\mxaddspace}
24 \usepackage[style=authoryear]{biblatex}
25 \addbibresource{recorder-fingering.bib}
26 \usetikzlibrary{tikzmark}
27 \usetikzlibrary{positioning}
28 \usepackage[colorlinks=true,citecolor=black]{hyperref}
29
30 \NewDocumentCommand{\addf}{m}{\tikz[remember picture]{\node[overlay,above=of pic cs:#1]{\Soprano{#1}};}}
31 \DefineShortVerb{\|}
32 \title{The \texttt{recorder-fingering} package}
33 \author{Alan Munn\\[email protected]}
34 \date{Version 1.5\\November 9, 2025}
35
36 \lstset{%
37 basicstyle=\ttfamily\small,
38 commentstyle=\itshape\ttfamily\small,
39 showspaces=false,
40 showstringspaces=false,
41 breaklines=true,
42 breakautoindent=true,
43 language=TeX,
44 frame=tl,
45 }
46
47 \newcommand*{\pkg}[1]{\texttt{#1}}
48 \newcolumntype{t}[1]{>{\ttfamily}#1}
49 \newcolumntype{T}{>{\ttfamily}c}
50 \newcommand*{\bs}{\textbackslash}
51 \setlength{\droptitle}{-1in}
52 \renewcommand{\abstractname}{\sffamily Abstract}
53
54
55 \begin{document}
56 \maketitle
57 \thispagestyle{empty}
58 \begin{abstract}{\noindent
59 The |recorder-fingering| package provides support for generating fingering diagrams for baroque fingering recorders and the tin whistle. Standard fingerings are provided for recorders in both C and F, and the tin whistle in D, along with methods to create and display alternate fingerings for trills, etc.
60 }
61 \end{abstract}
62
63
64 \section{Display commands}
65 This package provides five recorder commands (|\Sopranino|, |\Soprano|, |\Alto|, |\Tenor|, and |\Bass|) and one tin whistle command (|\Whistle|).\footnote{Because \pkg{musixtex} defines commands \pkg{\bs alto} and \pkg{\bs bass} the fingering display commands are capitalized.} which will produce a fingering diagram for any note in the playable range of that recorder. Additionally, a set of trill fingering commands are provided to make producing trill fingerings simpler. At present, there are no differences between the three F recorders (sopranino, alto, and bass) and the two C recorders (soprano and tenor), so the different command names are simply there for convenience. A set of dedicated trill fingering display commands is also provided. These are described in section \ref{trill-fingerings}.
66
67
68 \begin{table}[htpb]
69 \centering
70 \begin{tabularx}{.8\textwidth}{t{r}X}
71 \toprule
72 \bs Sopranino [<parameters>]\{<note>\} & Display a fingering diagram for note in F\\
73 \bs Soprano [<parameters>]\{<note>\} & Display a fingering diagram for note in C\\
74 \bs Alto [<parameters>]\{<note>\} & Display a fingering diagram for note in F\\
75 \bs Tenor [<parameters>]\{<note>\} & Display a fingering diagram for note in C\\
76 \bs Bass [<parameters>]\{<note>\} & Display a fingering diagram for note in F\\
77 \bs Whistle [<parameters>]\{<note>\} & Display a tin whistle diagram (in D) \\
78 \bottomrule
79 \end{tabularx}
80 \caption{Display commands}
81 \end{table}
82 \subsection{Note ranges and notation\label{Notes}}
83 The notes range from C–Eb for recorders in C (|\Soprano| and |\Tenor|) or F–Ab for recorders in F (|\Sopranino| and |\Alto|), and D-d' for the tin whistle.
84
85 Notes are noted as C-B (first octave) c-b (second octave) and c'–eb' (third octave) with an equivalent scheme starting at F for the recorders in F, and starting at D for the tin whistle.
86
87 Enharmonic notes are available for any of the flat/sharp notes (i.e., Db and C\#, etc. are both defined by default.)
88 \subsection{Display parameters}
89 Fingering diagrams are customizable either globally using |\fingeringSetup{}| or locally as an optional argument passed to any individual command.
90
91 \begin{table}[htpb]
92 \centering
93 \begin{tabularx}{.9\textwidth}{t{l}X}
94 \toprule
95 thumboffset = <true/false> & Display the thumb hole offset or not (default = \pkg{true})\\
96 width = <length> & Width of the diagram (default = \pkg{20pt}). Height adjusts proportionally\\
97 LHRHdivider = <true/false> & Display a line separating the left and right hand holes (default = \pkg{true})\\
98 LHRHspace = <length> & Space between the left hand and right hand holds (default = \pkg{10pt})\\
99 trilldir = <L/R/LR> & trill arrows uniformly to the Left or Right, or top 3 holes L, bottom 4 holes R\\
100 Lpointer = <left trill pointer> & changes the left pointer for trills\\
101 Rpointer = <right trill pointer> & changes the right pointer for trills\\
102 trill = \{<list of holes>\} & add a trill marker at each hole position in the list (local use only)\\
103 revdouble & reverse the orientation of the double holes to show a player’s perspective\\
104 \bottomrule
105 \end{tabularx}
106 \caption{Display options}
107 \end{table}
108
109 The |width| parameter sets the width of the diagram; it defaults to |20pt| for the default thumb offset diagrams. If you set |thumboffset=false| you will probably want to choose a smaller value e.g. |10pt|. Since the tin whistle has no thumb position, I recommend setting the |width| parameter for tin whistle diagrams to |7pt|.
110
111 The |trill| parameter sets an arrow pointing to a hole (numbered 1-7 from the top hole). This parameter is only in effect when using the display commands. It will place an arrow on the side specified by |trilldir| at a single hole or comma separated list of holes. e.g. |trill=3| sets an arrow at hole 3, |trill={6,7}| sets arrows at holes 6 and 7.
112
113 The trill arrow direction can be specified using the |trilldir| parameter. Setting it to |L| places all arrows on the left, setting it to |R| places all arrows on the right. Setting it to |LR| places arrows to the left on holes 1-3 and on the right on holes 4-7.
114
115 The |Lpointer| and |Rpointer| parameters set the left and right trill pointers. The default values are |Lpointer={$\rightarrow$}| and |Rpointer={$\leftarrow$}|.
116
117 The |revdouble| parameter reverses the orientation of the double holes to make them appear from a player’s perspective rather than looking at the recorder from the front (the default). This parameter really only makes sense to be used globally, although it can also be used locally if needed.
118
119 You can set the parameters individually for any particular display command, but most likely you'll want global settings. To set the parameters globally use the command |\fingeringSetup|
120
121 e.g. |\fingeringSetup{width=12pt,thumboffset=false}| makes all diagrams use an inline thumb hole and 12pt width.
122 \begin{table}[htpb]
123 \centering
124 \begin{tabular}{TTTT}
125 \bs Alto\{c\} & \bs Soprano[width=10pt,thumboffset=false]\{f\} & \bs Alto[trill=3]\{C\} & \bs Alto[revdouble]{G}\\
126 \\
127 \Alto{c} & \Soprano[width=10pt,thumboffset=false]{f} & \Alto[trill=3]{C} & \Alto[revdouble]{G}
128 \end{tabular}
129 \caption{Example fingering commands}
130 \end{table}
131 \section{Producing new fingerings}
132
133 There are four commands to add new fingerings to the predefined list, or in fact, to change the existing defaults.
134 \subsection{Note names}
135 Although the basic predefined fingerings use the note naming schema outlined in section \ref{Notes}, the note names themselves are arbitrary. This allows you to add trill fingerings or alternate fingerings with meaningful names, e.g. |ftrill| or |altF| are possible names for new fingerings.
136 \subsection{Fingering vectors\label{fingering-vectors}}
137 Fingerings are specified using an 8 (and possibly 9) element comma separated list (7 for the tin whistle\footnote{Since I don’t play the tin whistle, I don’t know if there are any esoteric fingerings similar to those in the recorder that use the knee to close the bell hole. But in case they do exist, it’s possible to specify a 7th hole for D fingerings.}). For the recorders, each position in the list denotes a hole starting from the thumb (position 0) to the bell (position 8). For the tin whistle, each position in the list denotes a hole. Each hole position is indicated by a hole state according to the following scheme:
138
139 \begin{table}[htpb]
140 \centering
141 \begin{tabularx}{.8\textwidth}{t{r}X}
142 \toprule
143 0 & open hole\\
144 1 & closed hole (positions 0-5); or single closed hole (recorder positions 6,7)\\
145 2 & double closed hole (recorder positions 6,7 only)\\
146 t & half hole (thumb)\\
147 h & half hole (positions 1-5)\\
148 o & optionally closed (positions 0-5) represented as an open hole with a dot\\
149 \bottomrule
150 \end{tabularx}
151 \caption{Hole states}
152 \end{table}
153
154 \subsection{New fingering commands}
155
156 Three commands |\NewFfingering|, |\NewCfingering|, and |\NewDfingering| are designed to add a single fingering. They check whether the name for the fingering is already used and produce an error if so. To overwrite an existing fingering, use |\NewFfingering*|, |\NewCfingering*| or |\NewDfingering*|.
157
158 The fourth command is designed to enter a set of new fingerings at once. It will override any existing note names. It takes two arguments, a key, (F, C, or D) and a key value list consisting of note names plus fingering vectors.
159
160 \begin{table}[htpb]
161 \centering
162 \begin{tabularx}{.8\textwidth}{X}
163 \toprule
164 \texttt{\bs NewFfingering\{<notename>\}\{<fingering vector>\}} \\\rule{3em}{0pt}Add a new note and fingering to the F recorder set\\
165 \texttt{\bs NewCfingering\{<notename>\}\{<fingering vector>\}} \\\rule{3em}{0pt} Add a new note and fingering to the C recorder set\\
166 \texttt{\bs NewDfingering\{<notename>\}\{<fingering vector>\}} \\\rule{3em}{0pt} Add a new note and fingering to the tin whistle set\\
167 \texttt{\bs AddFingerings\{<key>\}\{<note = \{<fingering vector>\}>\}} \\\rule{3em}{0pt} Add a set of new fingerings to the F, C or D instrument set\\
168 \bottomrule
169 \end{tabularx}
170 \caption{Commands for adding new fingerings}
171 \end{table}
172
173 \section{Trill fingerings}
174 Because trill fingerings are likely to be displayed with, rather than without, their trill annotations, a separate set of trill fingering macros is provided so that trill fingerings can be stored along with their trill annotations and produced without needing to add the trill annotation manually.
175
176 \begin{table}[htpb]
177 \centering
178 \begin{tabularx}{.8\textwidth}{X}
179 \toprule
180 \texttt{\bs NewFtrill\{<notename>\}\{<fingering vector>\}\{<trill vector>\}} \\\rule{3em}{0pt}Add a new trill and fingering to the F recorder set\\
181 \texttt{\bs NewCtrill\{<notename>\}\{<fingering vector>\}\{<trill vector>\}} \\\rule{3em}{0pt} Add a new trill and fingering to the C recorder set\\
182 \texttt{\bs NewDtrill\{<notename>\}\{<fingering vector>\}\{<trill vector>\}} \\\rule{3em}{0pt} Add a new trill and fingering to the tin whistle set\\
183 \texttt{\bs AddTrills\{<key>\}\{<note = \{\{<fingering vector>\}\},\{<trill vector>\}\}>\}} \\\rule{3em}{0pt} Add a set of new trills to the F, C or D instrument set\\
184 \bottomrule
185 \end{tabularx}
186 \caption{Commands for adding new trill fingerings}
187 \end{table}
188
189 The three commands |\NewFtrill|, |\NewCtrill|, and |\NewDtrill| take two arguments: a fingering vector, and a trill vector. The fingering vector is the same as described in section \ref{fingering-vectors}. The trill vector indicates which holes will be annotated with trill arrows when displayed using one of the dedicated trill display macros.
190
191 The fourth command takes two arguments: a key (F,C, or D) and a key value set of ordered pairs of vectors, a fingering vector and a trill vector.
192
193 \subsection{Displaying trill fingerings\label{trill-fingerings}}
194 Fingerings that are created using the trill fingering macros can be displayed along with their associated trill annotations using the commands |\Ftrill|, |\Ctrill|, and |\Dtrill|.
195
196 \begin{table}[htpb]
197 \centering
198 \begin{tabularx}{.8\textwidth}{t{r}X}
199 \toprule
200 \bs Ftrill [<parameters>]\{<note>\} & Display a trill diagram for note in F\\
201 \bs Ctrill [<parameters>]\{<note>\} & Display a trill diagram for note in C\\
202 \bs Dtrill [<parameters>]\{<note>\} & Display a tin whistle trill diagram (in D) \\
203 \bottomrule
204 \end{tabularx}
205 \caption{Trill display commands}
206 \end{table}
207
208 Note that the package does not come with any pre-coded trill fingerings, so these commands will not work unless you have added trill fingerings yourself.
209
210 \clearpage
211 \section{New fingering examples}
212 Here are some examples of how to add new fingerings and trills.
213
214 \AddFingerings{F}{
215 altD = {1,0,1,1,1,1,0,0},
216 altE = {1,0,1,1,0,0,0,0},
217 altAb = {t,1,1,1,1,1,1,0},
218 altG# = {0,o,1,1,1,1,2,0}
219 }
220 \AddTrills{F}{
221 BbA = {{0,1,1,1,1,1,0,0},{5}},
222 C#D ={{1,1,1,0,1,1,1,0},{4,5}}
223 }
224 \NewCfingering{alte}{t,1,1,1,1,0,2,2}
225 \NewCtrill{ef#}{t,1,1,1,0,1,0,0}{4}
226 \NewCtrill{gab}{t,1,1,0,1,0,2,0}{6}
227
228 \begin{lstlisting}
229 \AddFingerings{F}{
230 altD = {1,0,1,1,1,1,0,0},
231 altE = {1,0,1,1,0,0,0,0},
232 altAb = {t,1,1,1,1,1,1,0},
233 altG# = {0,o,1,1,1,1,2,0}
234 }
235 \Alto{altD}\quad
236 \Alto{altE}\quad
237 \Alto{altAb}\quad
238 \Alto{altG#}
239 \end{lstlisting}
240
241 \Alto{altD}\quad
242 \Alto{altE}\quad
243 \Alto{altAb}\quad
244 \Alto{altG#}
245
246 \begin{lstlisting}
247 \AddTrills{F}{
248 BbA = {{0,1,1,1,1,1,0,0},{5}},
249 C#D ={{1,1,1,0,1,1,1,0},{4,5}}
250 }
251 \Ftrill{BbA}\quad
252 \Ftrill{C#D}\quad
253 \end{lstlisting}
254
255 \Ftrill{BbA}\quad
256 \Ftrill{C#D}\quad
257
258 \begin{lstlisting}
259 \NewCfingering{alte}{t,1,1,1,1,0,2,2}
260 \NewCtrill{ef#}{t,1,1,1,0,1,0,0}{4}
261 \NewCtrill{gab}{t,1,1,0,1,0,2,0}{6}
262 \Soprano{alte}\quad
263 \Ctrill{ef#}\quad
264 \Ctrill{gab}
265 \end{lstlisting}
266 \Soprano[revdouble]{alte}\quad
267 \Ctrill{ef#}\quad
268 \Ctrill{gab}
269 \clearpage
270
271 \section{Version History}
272 Version 0.5 of this package (the initial version) was in response to a \href{https://tex.stackexchange.com/q/674847/2693}{TeX.se question} and used a substantially different set of user commands. The current version (1.x) is more flexible and has a more useable user interface. Version 1.1 added support for trill annotation, and added a separation between the left and right hand holes. Version 1.2 added support for the tin whistle. Version 1.3 added dedicated trill fingering commands. Version 1.4 added a new hole state |o| to denote a closed if required hole (following the practice in the Moeck fingering charts). It also fixed some typos in the built-in fingerings, and bug with options for trill commands and added a parameter to change the orientation of the double holes. Version 1.5 changed the orientation of half holes on the body so that they match left and right hand orientations. Bug reports and feature requests are welcome at the \href{https://github.com/amunn/recorder-fingering/issues}{GitHub bug tracker}.
273 \section{Acknowledgements}
274 This is my first attempt to write a package using |expl3|. Thanks to Jonathan P. Spratte for suggesting how to split fingering vectors and the various LaTeX development team members (David Carlisle, Ulrike Fischer, Phelype Olenik and Joseph Wright) who have answered random |expl3| questions in the TeX.se chat. Thanks to Bob Tennent, whose suggestions resulted in version 1.1. Thanks also to all the TeX.se users who have both asked and answered questions on the site. Your questions encourage new packages like this one and your answers help make the code better. Thanks to Charles-Albert Lehalle for the suggestion to add the tin whistle. Thanks to GitHub user |voh9eepah| for the suggestions that led to version 1.4.
275
276
277 \section{Sources}
278 The core fingerings for recorders are taken from \textcite{Wollitz1981}. The core fingerings for the tin whistle are taken from \textcite{GreyLarsenWhistleFingerings}. The sample recorder trill fingerings are from \textcite{BlockisRecorderFingerings}.
279
280 \printbibliography[heading=none]
281 \clearpage
282 \section{Samples} The charts below shows all of the defaults fingerings for the C recorders and the tin whistle.\footnote{Since the top row of the table represents the input name, \pkg{b} and \pkg{\#} are used instead the proper symbols \flat\ and \sharp.}
283
284 \section*{Soprano recorder in C fingering chart}
285 \begin{tabular}{cccccccccccc}
286 \toprule
287 C & C\# & D & Eb & E & F & F\# & G & Ab & A & Bb & B\\
288 \midrule
289 \Soprano{C} &
290 \Soprano{C#} &
291 \Soprano{D} &
292 \Soprano{Eb} &
293 \Soprano{E} &
294 \Soprano{F} &
295 \Soprano{F#} &
296 \Soprano{G} &
297 \Soprano{Ab} &
298 \Soprano{A} &
299 \Soprano{Bb} &
300 \Soprano{B}\\
301 \bottomrule
302 \end{tabular}
303
304 \bigskip
305 \begin{tabular}{cccccccccccc}
306 \toprule
307 c & c\# & d & eb & e & f & f\# & g & ab & a & bb & b\\
308 \midrule
309 \Soprano{c} &
310 \Soprano{db} &
311 \Soprano{d} &
312 \Soprano{eb} &
313 \Soprano{e} &
314 \Soprano{f} &
315 \Soprano{gb} &
316 \Soprano{g} &
317 \Soprano{ab} &
318 \Soprano{a} &
319 \Soprano{bb} &
320 \Soprano{b}\\
321 \bottomrule
322 \end{tabular}
323
324 \bigskip
325 \begin{minipage}[t]{.66\linewidth}
326 \fingeringSetup{width=7pt}
327 \section*{Tin whistle in D fingering chart}
328 \begin{tabular}{*{12}c}
329 \toprule
330 D & D\# & E & F & F\# & G & G\# & A & A\# & B & C & C\#\\
331 \midrule
332 \Whistle{D} &
333 \Whistle{D#} &
334 \Whistle{E} &
335 \Whistle{F} &
336 \Whistle{F#} &
337 \Whistle{G} &
338 \Whistle{G#} &
339 \Whistle{A} &
340 \Whistle{A#} &
341 \Whistle{B} &
342 \Whistle{C} &
343 \Whistle{C#}\\
344 \bottomrule
345 \end{tabular}
346
347 \bigskip
348 \begin{tabular}{*{13}c}
349 \toprule
350 d & d\# & e & f & f\# & g & g\# & a & a\# & b & c & c\# & d' \\
351 \midrule
352 \Whistle{d} &
353 \Whistle{d#} &
354 \Whistle{e} &
355 \Whistle{f} &
356 \Whistle{f#} &
357 \Whistle{g} &
358 \Whistle{g#} &
359 \Whistle{a} &
360 \Whistle{a#} &
361 \Whistle{b} &
362 \Whistle{c} &
363 \Whistle{c#} &
364 \Whistle{d'} \\
365 \bottomrule
366 \end{tabular}
367 \end{minipage}
368 \fingeringSetup{width=10pt,thumboffset=false}
369 \hfill
370 \begin{minipage}[t]{.33\linewidth}
371 \section*{\raggedright Example diagrams with \texttt{thumboffset=false}}
372 \begin{tabular}{cccc}
373 \toprule
374 c' & c\#' & d' & eb'\\
375 \midrule
376 \Soprano{c'} &
377 \Soprano{db'} &
378 &
379 \Soprano{eb'}\\
380 \bottomrule
381 \end{tabular}
382 \end{minipage}
383 \clearpage
384 \section{Using in conjunction with \texttt{musixtex}}
385 \fingeringSetup{thumboffset=true,width=12pt}
386 It's simple to add fingerings on top of musical excerpts created with |musixtex| using the |tikzmark| library to place the fingerings. Here's a sample of what you can do, with the code below.
387
388 \subsection*{C Maj scale Soprano/Tenor recorder fingerings}
389 \vspace{\heightof{\Soprano{C}}+\baselineskip}
390 \begin{music}
391 \setlyrics{scale}{C D E F G A B C}
392 \lyrraise{1}{b-2ex}
393 \assignlyrics{1}{scale}
394 \startextract
395 \NOTEs
396 \tikzmark{C}\wh{c}\tikzmark{D}\wh{d}\tikzmark{E}\wh{e}\tikzmark{F}\wh{f}
397 \tikzmark{G}\wh{g}\tikzmark{A}\wh{h}\tikzmark{B}\wh{i}\tikzmark{c}\wh{j}
398 \en
399 \zendextract
400 \end{music}
401 \addf{C}\addf{D}\addf{E}\addf{E}\addf{F}\addf{G}\addf{A}\addf{B}\addf{c}
402 \begin{lstlisting}
403 %\usetikzlibrary{tikzmark} % in document premable
404 %\usetikzlibrary{positioning} % in document preamble
405 %\usepackage{calc} % in document preamble
406 % Helper command to place each fingering
407 \NewDocumentCommand{\addf}{m}{\tikz[remember picture]{\node[overlay,above=of pic cs:#1]{\Soprano{#1}};}}
408 % add vertical space for the height of the diagram
409 \vspace{\heightof{\Soprano{C}}+\baselineskip}
410 \begin{music}
411 \setlyrics{scale}{C D E F G A B C}
412 \lyrraise{1}{b-2ex}
413 \assignlyrics{1}{scale}
414 \startextract
415 \NOTEs
416 % add \tikzmark for before each note
417 \tikzmark{C}\wh{c}\tikzmark{D}\wh{d}\tikzmark{E}\wh{e}\tikzmark{F}\wh{f}
418 \tikzmark{G}\wh{g}\tikzmark{A}\wh{h}\tikzmark{B}\wh{i}\tikzmark{c}\wh{j}
419 \en
420 \zendextract
421 \end{music}
422 % use the helper function to add the fingerings (requires two compilations)
423 \addf{C}\addf{D}\addf{E}\addf{E}\addf{F}\addf{G}\addf{A}\addf{B}\addf{c}
424 \end{lstlisting}
425 \end{document}