Debian Codegraph @

texmf-dist/doc/latex/ddphonism/ddphonism.tex

raw
1 \documentclass{article}
2
3 \usepackage{hyperref}
4 \usepackage{multicol}
5 \usepackage{listings}
6 \usepackage{ddphonism}
7
8 \title{The \textsf{ddphonism} package\footnote{This
9 document corresponds to \textsf{ddphonism} v0.3, dated 2025/05/13.}}
10 \author{Celia Rubio Madrigal\footnote{Email: rubiomadrigalcelia (at) gmail (dot) com}}
11 \date{May 13, 2025}
12
13 \usepackage{pagecolor}
14 \begin{document}
15
16 \maketitle
17
18 \begin{abstract}
19 This music-related package focuses on notation from the Twelve-Tone System, also called Dodecaphonism. It provides \LaTeX{} algorithms to generate common dodecaphonic diagrams based off a musical series, or row sequence, of arbitrary length.\footnote{The code is also hosted at \url{https://github.com/celrm/ddphonism}.}
20
21 \begin{center}
22 \textbf{Keywords}
23 \end{center}
24
25 \textit{twelve tone system, dodecaphonism, music, mathematics, matrix, row, series, permutation, diagram, clock diagram, notation, algorithm, schoenberg, contemporary music, 20th century}
26 \end{abstract}
27
28 \tableofcontents
29
30 \clearpage
31
32 \section{Introduction}
33 There are hundreds of music tools and software available online that can produce various types of music notation. However, I have not yet seen a \LaTeX{} tool that does the same for twelve-tone music. This package is not only about notation, but it also performs the mathematical calculations behind how the notation should work.
34
35 It is said that a twelve-tone matrix is the only thing a twelve-tone composer needs, because it provides the full serial spectrum they can work with. I wanted \LaTeX{} users to be able to generate these automatically.
36
37 But I also think that a twelve-tone matrix is not enough, that there are other notations that can help composers better understand their series and their potential. These are the kinds of diagrams this package can produce:
38
39 \subsection{Examples}
40
41 {\footnotesize\begin{verbatim}
42 \dmatrix{4,3,2,1,0} \ddiagram[arrow shift = 4]{4,5,7,1,6,3,8,2,11,0,9,10}
43
44 \ddihedral{4,5,7,1,6,3,8,2,11,0,9,10} \darrows{4,5,7,1,6,3,8,2,11,0,9,10}
45
46 \drow{4,3,2,1,0}
47 \end{verbatim}}
48
49 \begin{multicols}{2}
50 \dmatrix{4,3,2,1,0}
51
52 \ddihedral{4,5,7,1,6,3,8,2,11,0,9,10}
53
54 \ddiagram[arrow shift = 4]{4,5,7,1,6,3,8,2,11,0,9,10}
55
56 \darrows{4,5,7,1,6,3,8,2,11,0,9,10}
57
58 \bigskip
59 \drow{4,3,2,1,0}
60 \end{multicols}
61
62 \section{Using the \textsf{ddphonism} package}
63 These are the commands provided by \textsf{ddphonism}, along with their options and examples of usage. The main parameter for every command is the main (original) row sequence. It is a comma-separated list of integers. An optional parameter can be added to include other Tikz options, such as \textsf{scale} or \textsf{rotate}.
64
65 \newcommand{\I}[1]{\item[\texttt{$\backslash$#1}]\quad}
66 \newcommand{\Ii}[1]{\item[\textsf{#1}]\quad}
67
68 \subsection{\textbackslash dmatrix}
69 \begin{itemize}
70 \I{dmatrix} produces a twelve-tone matrix of arbitrary length (as seen \href{https://celrm.github.io/matrices/}{here}).
71
72 \item[Options:]
73 \begin{itemize}
74 \Ii{sep} adjusts general spacing.
75 \Ii{vsep} adjusts vertical spacing.
76 \Ii{hsep} adjusts horizontal spacing.
77 \Ii{lines} draws all lines surrounding rows and columns.
78 \Ii{outside lines} draws only the outer box.
79 \Ii{inside lines} draws only the internal grid.
80 \Ii{vlines} draws only vertical lines.
81 \Ii{hlines} draws only horizontal lines.
82 \Ii{no tikz} disables automatic TikZ environment, letting the user type it:
83 \begin{verbatim}
84 \begin{tikzpicture}
85 \dmatrix[no tikz]{0,2,1,4,3,6,5}
86 \end{tikzpicture}
87 \end{verbatim} produces the same as \verb|\dmatrix{0,2,1,4,3,6,5}|.
88 \end{itemize}
89
90 \item[Example:] \verb|\dmatrix{0,2,1,4,3,6,5}|
91
92 \dmatrix{0,2,1,4,3,6,5}
93
94 \item[Example:] \verb|\dmatrix[lines,sep=0.75]{0,2,1,4,3,6,5}|
95
96 \dmatrix[lines,sep=0.75]{0,2,1,4,3,6,5}
97
98 \end{itemize}
99
100 \subsection{\textbackslash ddiagram}
101 \begin{itemize}
102 \I{ddiagram} produces a twelve-tone clock diagram of arbitrary length, (as seen \href{https://celrm.github.io/diagramas/}{here}).
103
104 \item[Options:]
105 \begin{itemize}
106 \Ii{up} specifies the number at the top (default is the first in the row).
107 \Ii{arrow shift} adjusts arrow position on the line (default is 2.5, range 0-10).
108 \Ii{name} adds a label at the center.
109 \Ii{no numbers} hides the surrounding numbers.
110 \Ii{no arrow} hides the arrow.
111 \Ii{no tikz} disables automatic TikZ environment, letting the user type it. It is recommended to pass \textsf{ddiagram} to the user's TikZ environment:
112 \begin{verbatim}
113 \begin{tikzpicture}[ddiagram]
114 \ddiagram[no tikz]{0,2,1,4,3,6,5}
115 \end{tikzpicture}
116 \end{verbatim} produces the same as \verb|\ddiagram{0,2,1,4,3,6,5}|.
117 \end{itemize}
118
119 \item[Example:] \verb|\ddiagram{0,2,1,4,3,6,5}|
120
121 \ddiagram{0,2,1,4,3,6,5}
122
123 \item[Example:] \verb|\ddiagram[name=P, up=5, arrow shift=5]{0,2,1,4,3,6,5}|
124
125 \ddiagram[name=P, up=5, arrow shift=5]{0,2,1,4,3,6,5}
126
127 \end{itemize}
128
129 \subsection{\textbackslash ddihedral}
130 \begin{itemize}
131 \I{ddihedral} produces a ``dihedral" representation of a series of arbitrary length (introduced in \href{https://divulgamat.net/divulgamat15/index.php?view=article&catid=67:ma-y-matemcas&id=18227:101-octubre-19-serialismo-y-matematicas-ii}{this article} to illustrate the transformations' group structure).
132
133 \item[Options:]
134 \begin{itemize}
135 \Ii{t} applies the transformation \textit{transposition}.
136 \Ii{s} applies the transformation \textit{inversion}.
137 \Ii{c} applies the transformation \textit{cyclic shift}.
138 \Ii{v} applies the transformation \textit{retrograde}.
139
140 These transformations are applied in this exact order: \texttt{t}, \texttt{s}, \texttt{c}, \texttt{v}.
141
142 \Ii{new t, new s, new c, new v} rename respective transformations on the label.
143 \Ii{no tikz} disables automatic TikZ environment, letting the user type it. It is recommended to pass \textsf{ddihedral} to the user's TikZ environment:
144 \begin{verbatim}
145 \begin{tikzpicture}[ddihedral]
146 \ddihedral[no tikz]{0,2,1,4,3,6,5}
147 \end{tikzpicture}
148 \end{verbatim} produces the same as \verb|\ddihedral{0,2,1,4,3,6,5}|.
149 \end{itemize}
150
151 \item[Example:] \verb|\ddihedral{0,2,1,4,3,6,5}|
152
153 \ddihedral{0,2,1,4,3,6,5}
154
155 \item[Example:] \verb|\ddihedral[s=1, c=4]{0,2,1,4,3,6,5}|
156
157 \ddihedral[s=1, c=4]{0,2,1,4,3,6,5}
158
159 \item[Example:] \verb|\ddihedral[new v=R, v=1]{0,2,1,4,3,6,5}|
160
161 \ddihedral[new v=R, v=1]{0,2,1,4,3,6,5}
162
163
164 \I{darrows} draws the arrows from \verb|\ddihedral| (which represent the row's orbit).
165
166 \begin{itemize}
167 \Ii{no tikz} disables automatic TikZ environment, letting the user type it.
168 \end{itemize}
169
170 \item[Example:] \verb|\darrows{0,2,1,4,3,6,5}|
171
172 \darrows{0,2,1,4,3,6,5}
173
174 \end{itemize}
175
176 \subsection{\textbackslash drow}
177 \begin{itemize}
178
179 \I{drow} produces a twelve-tone row sequence as a mathematical permutation in its matrix form (using an \textit{array} environment).
180
181 \item[Options:]
182 \begin{itemize}
183 \Ii{sep} adjusts column spacing.
184 \end{itemize}
185
186 \item[Example:] \verb|\drow{0,2,1,4,3,6,5}|
187
188 \drow{0,2,1,4,3,6,5}
189
190 \item[Example:] \verb|\drow[sep=10pt]{0,2,1,4,3,6,5}|
191
192 \drow[sep=10pt]{0,2,1,4,3,6,5}
193
194 \end{itemize}
195
196 \section{Notes from the author}
197 This package was created to support the articles written for the DivulgaMAT journal (in Spanish), under the column \textit{Matemáticas y Música}:
198 \begin{itemize}
199 \item \href{https://divulgamat.net/divulgamat15/index.php?view=article&catid=67:ma-y-matemcas&id=18209:100-septiembre-2019-serialismo-y-matematicas-i}{100. (Septiembre 2019) Serialismo y matemáticas (I)}
200 \begin{itemize}
201 \item Introduces the \verb|\dmatrix| and \verb|\drow| commands.
202 \end{itemize}
203 \item \href{https://divulgamat.net/divulgamat15/index.php?view=article&catid=67:ma-y-matemcas&id=18227:101-octubre-19-serialismo-y-matematicas-ii}{101. (Octubre 2019) Serialismo y matemáticas (II)}
204 \begin{itemize}
205 \item Introduces the \verb|\ddiagram|, \verb|\darrows|, and \verb|\ddihedral| commands. The \verb|\ddihedral| command is here invented to illustrate the dihedral $\times$ dihedral group structure of the four historical transformations of a twelve-tone series.
206 \end{itemize}
207 \item \href{https://divulgamat.net/divulgamat15/index.php?view=article&catid=67:ma-y-matemcas&id=18258:102-noviembre-19-serialismo-y-matematicas-iii}{102. (Noviembre 2019) Serialismo y matemáticas (III)}
208 \item \href{https://divulgamat.net/divulgamat15/index.php?view=article&catid=67:ma-y-matemcas&id=18273:103-diciembre-19-re-escalando-musica}{103. (Diciembre 2019) Re-escalando música}
209 \end{itemize}
210
211 \section{The package code}
212 \lstset{
213 language=[Latex]Tex,
214 basicstyle=\footnotesize\sffamily,
215 keywordstyle=\footnotesize\sffamily,
216 identifierstyle=\footnotesize\sffamily,
217 commentstyle=\footnotesize\sffamily,
218 stringstyle=\footnotesize\sffamily,
219 escapechar=¬,
220 numberstyle=\footnotesize\sffamily,
221 numbers=left,
222 stepnumber=2,
223 numbersep=15pt,
224 columns=flexible,
225 showstringspaces=false,
226 tabsize=4,
227 }
228 \lstinputlisting{ddphonism.sty}
229
230 \end{document}