summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/ddphonism
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 06:22:22 +0000
committerNorbert Preining <norbert@preining.info>2019-09-02 06:22:22 +0000
commitf14a361bc56a46f4453b22584ae25043e1e83397 (patch)
tree41cde77967f157a05f06617447128c9eb1e1350e /macros/latex/contrib/ddphonism
parente0c6872cf40896c7be36b11dcc744620f10adf1d (diff)
update 20190902
Diffstat (limited to 'macros/latex/contrib/ddphonism')
-rw-r--r--macros/latex/contrib/ddphonism/README.md7
-rw-r--r--macros/latex/contrib/ddphonism/ddphonism.pdfbin283599 -> 81693 bytes
-rw-r--r--macros/latex/contrib/ddphonism/ddphonism.sty456
-rw-r--r--macros/latex/contrib/ddphonism/ddphonism.tex138
4 files changed, 164 insertions, 437 deletions
diff --git a/macros/latex/contrib/ddphonism/README.md b/macros/latex/contrib/ddphonism/README.md
index 02aaf43b68..127068572b 100644
--- a/macros/latex/contrib/ddphonism/README.md
+++ b/macros/latex/contrib/ddphonism/README.md
@@ -1,11 +1,11 @@
The ddphonism package
Celia Rubio Madrigal
-2019/09/01
+2019/08/10
__________________
Overview
-This is a music-related package focused on notation from the Twelve-Tone System, also called Dodecaphonism. It provides LaTeX algorithms that produce typical dodecaphonic diagrams based off a musical series, or row sequence, of variable length.
+This is a music-related package which is focused on notation from the Twelve-Tone System, also called Dodecaphonism. It provides LaTeX algorithms that produce typical T.T.S. notation based off a musical series, or row sequence, of variable length.
__________________
Change history
@@ -13,9 +13,6 @@ Change history
Version 0.1 (2019/08/10)
- Initial public release
-Version 0.2 (2019/09/01)
-- Added several new features and options
-
__________________
License
diff --git a/macros/latex/contrib/ddphonism/ddphonism.pdf b/macros/latex/contrib/ddphonism/ddphonism.pdf
index 54a76037b8..4f7b0a17fb 100644
--- a/macros/latex/contrib/ddphonism/ddphonism.pdf
+++ b/macros/latex/contrib/ddphonism/ddphonism.pdf
Binary files differ
diff --git a/macros/latex/contrib/ddphonism/ddphonism.sty b/macros/latex/contrib/ddphonism/ddphonism.sty
index 4ae54d3e63..76f3e028ce 100644
--- a/macros/latex/contrib/ddphonism/ddphonism.sty
+++ b/macros/latex/contrib/ddphonism/ddphonism.sty
@@ -5,12 +5,12 @@
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN archives
%% in directory macros/latex/base/lppl.txt.
-
+
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{ddphonism}
-[2019/09/01 v0.2 Dodecaphonic diagrams: twelve-tone matrices, clock diagrams, etc.]
+[2019/08/10 v0.1 LaTeX package for twelve-tone matrices, clock diagrams et al.]
-\RequirePackage{etoolbox}
+\RequirePackage{ifthen}
\RequirePackage{xparse}
\RequirePackage{tikz}
\RequirePackage{xstring}
@@ -26,131 +26,41 @@
\DeclareExpandableDocumentCommand{\Evaluation}{m}{\int_eval:n {#1}}
\ExplSyntaxOff
-\newcounter{Dsize}
-\newcommand{\DsizeMake}[1]{%
- \setcounter{Dsize}{0}%
- \foreach \n in {#1}{%
- \stepcounter{Dsize}%
- }%
-}
-
-% Only with numbers.
\newcounter{Dfirst}
-\newcommand{\DheadMake}[1]{%
- \setcounter{Dfirst}{-1}%
- \foreach \n in {#1}{%
- \ifnum\theDfirst=-1%
- \setcounter{Dfirst}{\n}%
- \fi%
- }%
-}
-
-% Only when DsizeMake is already done.
-\newcounter{Dmod}
-\newcommand{\Modulo}[1]{%
- \setcounter{Dmod}{#1}%
- \loop%
- \ifnum\theDmod>\Evaluation{\theDsize-1}%
- \setcounter{Dmod}{\Evaluation{\theDmod-\theDsize}}%
- \repeat%
- \ifnum\theDmod<0%
- \setcounter{Dmod}{\Evaluation{\theDmod+\theDsize}}%
- \repeat%
- \theDmod%
-}
+\newcounter{Dsize}
-\newif\ifdmatrixLines
-\newif\ifdmatrixOutside
-\newif\ifdmatrixInside
-\newif\ifdmatrixV
-\newif\ifdmatrixH
-\newif\ifdmatrixTikz
-\pgfkeys{
- /dmatrix/.is family
- , /dmatrix
- , default/.style =
- { lines = false
- , outside lines = false
- , inside lines = false
- , sep = 1
- , vsep = 1
- , hsep = 1
- , no tikz = false
+\newcommand{\DsizeHead}[1]{
+ \setcounter{Dsize}{0}
+ \setcounter{Dfirst}{-1}
+
+ \foreach \n in {#1}{
+ \ifnum\theDfirst=-1
+ \setcounter{Dfirst}{\n}
+ \fi
+ \stepcounter{Dsize}
}
- , no tikz/.is if=dmatrixTikz
- , lines/.is if=dmatrixLines
- , outside lines/.is if=dmatrixOutside
- , inside lines/.is if=dmatrixInside
- , vlines/.is if=dmatrixV
- , hlines/.is if=dmatrixH
- , sep/.estore in=\dmatrixSep
- , vsep/.estore in=\dmatrixVsep
- , hsep/.estore in=\dmatrixHsep
}
-\newcommand{\DLOH}{%
- \draw (0.05*\dmatrixSep*\dmatrixHsep,0) --%
- (\theDsize*\dmatrixSep*\dmatrixHsep+0.05*\dmatrixSep*\dmatrixHsep,0);%
- \draw (0.05*\dmatrixSep*\dmatrixHsep,-\theDsize*0.5*\dmatrixSep*\dmatrixVsep) -- %
- (\theDsize*\dmatrixSep*\dmatrixHsep+0.05*\dmatrixSep*\dmatrixHsep,-\theDsize*0.5*\dmatrixSep*\dmatrixVsep);%
+\newcommand{\Modulo}[1]{
+ \ifnum#1>\Evaluation{\theDsize-1}
+ \Evaluation{#1-\theDsize}
+ \else\ifnum#1<0
+ \Evaluation{#1+\theDsize}
+ \else #1
+ \fi\fi
}
-\newcommand{\DLOV}{%
- \draw (0.05*\dmatrixSep*\dmatrixHsep,0) -- %
- (0.05*\dmatrixSep*\dmatrixHsep,-\theDsize*0.5*\dmatrixSep*\dmatrixVsep);%
- \draw (\theDsize*\dmatrixSep*\dmatrixHsep+0.05*\dmatrixSep*\dmatrixHsep,0) -- %
- (\theDsize*\dmatrixSep*\dmatrixHsep+0.05*\dmatrixSep*\dmatrixHsep,-\theDsize*0.5*\dmatrixSep*\dmatrixVsep);
-}
-
-\newcommand{\DLIH}{%
- \draw (0.05*\dmatrixSep*\dmatrixHsep,-\xD*0.5*\dmatrixSep*\dmatrixVsep) -- %
- (\theDsize*\dmatrixSep*\dmatrixHsep+0.05*\dmatrixSep*\dmatrixHsep,-\xD*0.5*\dmatrixSep*\dmatrixVsep);%
-}
-
-\newcommand{\DLIV}{%
- \draw (\xD*\dmatrixSep*\dmatrixHsep+0.05*\dmatrixSep*\dmatrixHsep,0) -- %
- (\xD*\dmatrixSep*\dmatrixHsep+0.05*\dmatrixSep*\dmatrixHsep,-\theDsize*0.5*\dmatrixSep*\dmatrixVsep);%
-}
-
-\newcommand{\dmatrix}[2][]{%
- \DsizeMake{#2}%
- \DheadMake{#2}%
- %
- \pgfkeys{/dmatrix, default, #1}%
- %
- \ifdmatrixTikz\else%
- \begin{tikzpicture}%
- \fi%
- \foreach [count=\nj] \j in {#2} {%
- \foreach [count=\ni] \i in {#2} {%
- \draw node at
- ( \ni*\dmatrixSep*\dmatrixHsep-0.5*\dmatrixSep*\dmatrixHsep
- , -\nj*\dmatrixSep*\dmatrixVsep/2+0.25*\dmatrixSep*\dmatrixVsep) {%
- \Modulo{\Evaluation{\i-\j+\theDfirst}}%
- };%
- }%
- }%
- \foreach \xD in {1,...,\Evaluation{\theDsize-1}} {%
- \ifdmatrixLines
- \DLOH\DLOV\DLIH\DLIV
- \fi
- \ifdmatrixOutside
- \DLOH\DLOV
- \fi
- \ifdmatrixInside
- \DLIH\DLIV
- \fi
- \ifdmatrixH
- \DLOH\DLIH
- \fi
- \ifdmatrixV
- \DLOV\DLIV
- \fi
- }%
- %
- \ifdmatrixTikz\else%
- \end{tikzpicture}%
- \fi%
+\newcommand{\dmatrix}[1]{
+ \DsizeHead{#1}
+ \begin{tikzpicture}
+ \foreach [count=\nj] \j in {#1} {
+ \foreach [count=\ni] \i in {#1} {
+ \draw node at (\ni-0.5,-\nj/2+0.25) {
+ \Modulo{\Evaluation{\i-\j+\theDfirst}}
+ };
+ }
+ }
+ \end{tikzpicture}
}
@@ -159,82 +69,45 @@
\usetikzlibrary{shapes,arrows,decorations.markings,shapes.misc}
-\tikzstyle{ddiagram}=[minimum height=0pt,inner sep=0pt,outer sep=0pt,scale=0.65]
-
-\newif\ifddiagramTikz
-\newif\ifddiagramNoNum
-\newif\ifddiagramNoArr
-\pgfkeys{
- /ddiagram/.is family
- , /ddiagram
- , default/.style =
- { name =\empty%
- , up =\empty%
- , no tikz = false
- , no numbers = false
- , no arrow = false
- , xshift = 0
- , yshift = 0
- , arrow shift = 2.5
- }
- , no tikz/.is if=ddiagramTikz
- , no numbers/.is if=ddiagramNoNum
- , no arrow/.is if=ddiagramNoArr
- , name/.estore in=\ddiagramName
- , up/.estore in=\ddiagramUp
- , xshift/.estore in=\ddiagramX
- , yshift/.estore in=\ddiagramY
- , arrow shift/.estore in=\ddiagramArrS
-}
-
-\newcounter{Dprev}
-\newcommand{\Dvar}{}
-\newcommand{\ddiagram}[2][]{%
- \DsizeMake{#2}%
- \DheadMake{#2}%
- %
- \pgfkeys{/ddiagram, default, #1}%
- %
- \ifdefequal{\ddiagramUp}{\empty}%
- {\renewcommand{\Dvar}{\theDfirst}}% if empty
- {\renewcommand{\Dvar}{\ddiagramUp}}% if not empty
- %
- \ifddiagramTikz\else%
- \begin{tikzpicture}[ddiagram,rotate=360*\Dvar/\theDsize]%
- \fi%
- \foreach \x in {0,...,\Evaluation{\theDsize-1}} {%
- \ifddiagramNoNum\else
- \node [xshift=\ddiagramX,yshift=\ddiagramY] at (90-360*\x/\theDsize:2) {\x};%
- \fi
- \node [xshift=\ddiagramX,yshift=\ddiagramY] (\x) at (90-360*\x/\theDsize:1.6) {};%
- };%
- %
- \setcounter{Dprev}{-1}%
- \foreach \x in {#2}{%
- \ifnum \theDprev=\theDfirst%
- \ifddiagramNoArr
- \draw [xshift=\ddiagramX,yshift=\ddiagramY] (\theDprev) -- (\x);%
- \else
- \draw [xshift=\ddiagramX,yshift=\ddiagramY,
- decoration=
- {markings,mark=at position 0.099*\ddiagramArrS with
+\tikzstyle ddiagramArrow=[decoration=
+ {markings,mark=at position 0.25 with
{\arrow[scale=1.25,>=triangle 45]{>}}},
- postaction={decorate}
- ] (\theDprev) -- (\x);%
- \fi
- \else \ifnum \theDprev=-1 \else%
- \draw [xshift=\ddiagramX,yshift=\ddiagramY] (\theDprev) -- (\x);%
- \fi\fi%
- \setcounter{Dprev}{\x}%
- };%
- \draw [xshift=\ddiagramX,yshift=\ddiagramY] (\theDprev) -- (\theDfirst);%
- %
- \ifdefequal{\ddiagramName}{\empty}%
- {}% if empty
- {\node [xshift=\ddiagramX,yshift=\ddiagramY] at (0,0) [circle,fill=white] {\ddiagramName};}% if not empty
- \ifddiagramTikz\else%
- \end{tikzpicture}%
- \fi%
+ postaction={decorate}]
+
+\newcounter{anterior}
+\newcounter{var}
+\newcommand{\ddiagram}[3][-1]{
+ \DsizeHead{#2}
+ \def\theDDfirst{\Evaluation{\Modulo{\theDfirst}}}
+
+ \ifnum #1=-1
+ \setcounter{var}{\theDDfirst}
+ \else
+ \setcounter{var}{#1}
+ \fi
+
+ \begin{tikzpicture}[rotate=360*\thevar/\theDsize,
+ minimum height=0pt,inner sep=0pt,outer sep=0pt,scale=0.65]
+ \foreach \x in {0,...,\Evaluation{\theDsize-1}} {
+ \node at (90-360*\x/\theDsize:2) {\x};
+ \node (\x) at (90-360*\x/\theDsize:1.6) {};
+ };
+
+ \setcounter{anterior}{-1}
+ \foreach \xD in {#2}{
+ \def\x{\Evaluation{\Modulo{\xD}}}
+ \ifnum \theanterior=\theDDfirst
+ \draw [style=ddiagramArrow] (\theanterior) -- (\x);
+ \else \ifnum \theanterior=-1
+ \else
+ \draw (\theanterior) -- (\x);
+ \fi\fi
+ \setcounter{anterior}{\x}
+ };
+ \draw (\theanterior) -- (\theDDfirst);
+
+ \node at (0,0) [circle,fill=white] {#3};
+ \end{tikzpicture}
}
@@ -242,148 +115,89 @@
% Dihedral diagrams
\tikzstyle ddihedralArrow=[decoration=
-{markings,mark=at position 1 with {\arrow[scale=1.5,>=angle 60]{>}}},
-postaction={decorate}]
+ {markings,mark=at position 1 with {\arrow[scale=1.5,>=angle 60]{>}}},
+ postaction={decorate}]
-\tikzstyle{ddihedral}=[inner sep=0,minimum height=18pt]
-
-\newif\ifddihedralTikz
-\newif\ifddihedralItalics
\pgfkeys{
/ddihedral/.is family, /ddihedral,
- default/.style =
- { t = 0, c = 0, s = 0, v = 0
- , no tikz=false
- , new t = T, new c = C, new s = S, new v = V
- , no italics = false
- },
- no tikz/.is if=ddihedralTikz,
+ default/.style = {t = 0, c = 0, s = 0, v = 0},
t/.estore in = \ddihedralT,
c/.estore in = \ddihedralC,
s/.estore in = \ddihedralS,
v/.estore in = \ddihedralV,
- no italics/.is if=ddihedralItalics,
- new t/.estore in = \ddihedralNewT,
- new c/.estore in = \ddihedralNewC,
- new s/.estore in = \ddihedralNewS,
- new v/.estore in = \ddihedralNewV,
-}
-
-\newif\ifdarrowsTikz
-\pgfkeys{
- /darrows/.is family, /darrows,
- default/.style = {no tikz=false},
- no tikz/.is if=darrowsTikz,
-}
-\newcommand{\darrows}[2][]{%
- \DsizeMake{#2}%
- %
- \pgfkeys{/darrows, default, #1}%
- %
- \ifdarrowsTikz\else%
- \begin{tikzpicture}%
- \fi%
- \draw foreach \x in {0,...,\Evaluation{\theDsize-1}} {%
- (90-360*\x/\theDsize:2.5) node[circle] (\x) {}%
- };%
- \foreach \x [count=\y] in {#2} {%
- \draw [style=ddihedralArrow] (90-360*\Evaluation{\y-1}/\theDsize:1.25) -- (\x);%
- };%
- \ifdarrowsTikz\else%
- \end{tikzpicture}%
- \fi%
}
-\newcommand\ddihedral[2][]{%
- \DsizeMake{#2}%
- %
- \pgfkeys{/ddihedral, default, #1}%
- %
- \ifddihedralTikz\else%
- \begin{tikzpicture}[ddihedral]%
- \fi%
- \draw foreach \x in {0,...,\Evaluation{\theDsize-1}} {%
- (\Evaluation{(90+\ddihedralT*360/\theDsize)+(2*\ddihedralS-1)*\x*360/\theDsize}:2.5)%
- node[very thin,circle,draw] (\x) {\x}%
- };%
- %
- \draw foreach \x in {0,...,\Evaluation{\theDsize-1}} {%
- (\Evaluation{(90-\ddihedralC*360/\theDsize)+(2*\ddihedralV-1)*\x*360/\theDsize}:1.25)%
- node[very thin,circle,draw] {\x}%
- };%
- %
- \darrows[no tikz]{#2}%
- %
- \node at (0,0) [very thin,draw,circle, fill=white] {%
- {\ifddihedralItalics\else\it\fi%
- \ifodd\ddihedralV%
- \ddihedralNewV\else%
- \ifnum\ddihedralC=0%
- \ifodd\ddihedralS\else%
- \ifnum\ddihedralT=0%
- \ddihedralNewT$^0$%
- \fi\fi\fi\fi%
- \ifnum\ddihedralC=0%
- \else \ddihedralNewC$^{\ddihedralC}$\fi%
- \ifodd\ddihedralS%
- \ddihedralNewS\fi%
- \ifnum\ddihedralT=0%
- \else \ddihedralNewT$^{\ddihedralT}$\fi}%
- };%
- \ifddihedralTikz\else%
- \end{tikzpicture}%
- \fi%
+\newcommand{\darrows}[1]{
+ \DsizeHead{#1}
+ \draw foreach \x in {0,...,\Evaluation{\theDsize-1}} {
+ (90-360*\x/\theDsize:2.5) node[circle] (\x) {}
+ };
+ \foreach \xD [count=\y] in {#1} {
+ \def\x{\Evaluation{\Modulo{\xD}}}
+ \draw [style=ddihedralArrow] (90-360*\Evaluation{\y-1}/\theDsize:1.25) -- (\x);
+ };
+}
+
+\newcommand\ddihedral[2][]{
+ \pgfkeys{/ddihedral, default, #1}
+
+ \tikzset{inner sep=0,minimum height=18pt}
+
+ \DsizeHead{#2}
+
+ \draw foreach \x in {0,...,\Evaluation{\theDsize-1}} {
+ (\Evaluation{(90+\ddihedralT*360/\theDsize)+(2*\ddihedralS-1)*\x*360/\theDsize}:2.5)
+ node[very thin,circle,draw] (\x) {\x}
+ };
+
+ \draw foreach \x in {0,...,\Evaluation{\theDsize-1}} {
+ (\Evaluation{(90-\ddihedralC*360/\theDsize)+(2*\ddihedralV-1)*\x*360/\theDsize}:1.25)
+ node[very thin,circle,draw] {\x}
+ };
+
+ \darrows{#2}
+
+ \node at (0,0) [very thin,draw,circle, fill=white] {\
+ \ifnum\ddihedralV=0
+ \ifnum\ddihedralC=0
+ \ifnum\ddihedralS=0
+ \ifnum\ddihedralT=0
+ P
+ \fi\fi\fi
+ \else V \fi
+ \ifnum\ddihedralC=0
+ \else C$^{\ddihedralC}$ \fi
+ \ifnum\ddihedralS=0
+ \else S \fi
+ \ifnum\ddihedralT=0
+ \else T$^{\ddihedralT}$ \fi
+ \ };
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Rows
-\pgfkeys{
- /drow/.is family, /drow,
- default/.style = {sep=\arraycolsep},
- sep/.estore in = \drowSep,
-}
-
+\newcount\fooo
\long\def\addto#1#2{\expandafter\def\expandafter#1\expandafter{#1#2}}
\newcounter{myDDcntr}
-\newlength{\Dvarr}
-
-\newcommand{\drow}[2][]{%
- \DsizeMake{#2}%
- %
- \pgfkeys{/drow, default, #1}%
- \setlength{\Dvarr}{\arraycolsep}
- \setlength{\arraycolsep}{\drowSep}
- %
- \ifnum\theDsize=0%
- \ensuremath{\left(\right)}%
- \else\ifnum\theDsize=1%
- \ensuremath{%
- \left(\begin{array}{*{\theDsize}c}%
- 0\\%
- #2\\%
- \end{array}\right)%
- }%
- \else%
- \def\TableDDdata{}%
- \setcounter{myDDcntr}{0}%
- \loop%
- \addto\TableDDdata{\themyDDcntr\stepcounter{myDDcntr} &}%
- \stepcounter{myDDcntr}%
- \ifnum\themyDDcntr<\Evaluation{\theDsize-1}%
- \repeat%
- \addto\TableDDdata{\themyDDcntr \\}%
- \setcounter{myDDcntr}{0}%
- %
- \ensuremath{%
- \left(\begin{array}{*{\theDsize}c}%
- \TableDDdata%
- \StrSubstitute{#2}{,}{&}\\%
- \end{array}\right)%
- }%
- \fi\fi%
- \setlength{\arraycolsep}{\Dvarr}
+
+\newcommand{\drow}[1]{
+ \DsizeHead{#1}
+ \def\tabledata{} \fooo=\theDsize
+ \setcounter{myDDcntr}{0}
+ \loop
+ \addto\tabledata{\themyDDcntr\stepcounter{myDDcntr} &}
+ \advance \fooo -1
+ \ifnum \fooo>1
+ \repeat
+ \addto\tabledata{\themyDDcntr \\}
+ \ensuremath{
+ \left(\begin{array}{*{\theDsize}c}
+ \tabledata
+ \StrSubstitute{#1}{,}{&}\\
+ \end{array}\right)
+ }
}
\endinput
diff --git a/macros/latex/contrib/ddphonism/ddphonism.tex b/macros/latex/contrib/ddphonism/ddphonism.tex
index 2a6f438ce6..a5f53c7b65 100644
--- a/macros/latex/contrib/ddphonism/ddphonism.tex
+++ b/macros/latex/contrib/ddphonism/ddphonism.tex
@@ -7,9 +7,9 @@
\usepackage{ddphonism}
\title{The \textsf{ddphonism} package\footnote{This
- document corresponds to \textsf{ddphonism} v0.2, dated 2019/09/01.}}
+ document corresponds to \textsf{ddphonism} v0.1, dated 2019/08/10.}}
\author{Celia Rubio Madrigal\footnote{Email: \href{mailto:celrubio@ucm.es}{\texttt{celrubio@ucm.es}}}}
-\date{September 1, 2019}
+\date{August 10, 2019}
\begin{document}
@@ -17,13 +17,13 @@
\maketitle
\begin{abstract}
- This is a music-related package focused on notation from the Twelve-Tone System, also called Dodecaphonism. It provides \LaTeX{} algorithms that produce typical dodecaphonic diagrams based off a musical series, or row sequence, of variable length.
+ This is a music-related package which is focused on notation from the Twelve-Tone System, also called Dodecaphonism. It provides \LaTeX{} algorithms that produce typical T.T.S. notation based off a musical series, or row sequence, of variable length.
\begin{center}
\textbf{Keywords}
\end{center}
- \textit{twelve tone system, dodecaphonism, music, mathematics, matrix, row, series, permutation, diagram, clock diagram, notation, algorithm, schoenberg, contemporary music, 20th century}
+ \textit{twelve tone system, dodecaphonism, music, mathematics, matrix, row, series, diagram, clock diagram, notation, algorithm, schoenberg, contemporary music, 20th century}
\end{abstract}
\tableofcontents
@@ -33,140 +33,56 @@
It is said that a twelve-tone matrix is the only thing a twelve-tone composer should need, because it provides the whole serial spectrum with which they may work. I wanted \LaTeX{} users to be able to generate them automatically.
- But I also think that a twelve-tone matrix is not enough, that there exist several other notations with which they may understand their series and their potential. These are the diagrams that can be obtained with this package:
+ But I also think that a twelve-tone matrix is not enough, that there exist several other notations with which they may understand their series and its potential. These are the diagrams that can be obtained with this package.
\begin{multicols}{2}
- \dmatrix{4,3,2,1,0}
+ \dmatrix{0,1,2,3,4}
- \ddihedral{4,5,7,1,6,3,8,2,11,0,9,10}
+ \tikz{\ddihedral{4,5,7,1,6,3,8,2,11,0,9,10}}
- \ddiagram[arrow shift = 4]{4,5,7,1,6,3,8,2,11,0,9,10}
+ \ddiagram{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}
+ \tikz{\darrows{4,5,7,1,6,3,8,2,11,0,9,10}}
\bigskip
\drow{4,3,2,1,0}
\end{multicols}
\section{Using the \textsf{ddphonism} package}
- These are the commands provided by \textsf{ddphonism}. The main parameter in every command is the row sequence.
+ These are the commands provided by \textsf{ddphonism}:
- \newcommand{\I}[1]{\item[\texttt{$\backslash$#1}]\quad}
- \newcommand{\Ii}[1]{\item[\textsf{#1}]\quad}
+ \newcommand{\I}[1]{\item[\texttt{$\backslash$#1}]\quad}
\begin{itemize}
- \I{dmatrix} produces a twelve-tone matrix of arbitrary length, as shown in \href{https:matrices.netlify.com}{this website}. For example, \verb|\dmatrix{0,2,1,4,3,6,5}| produces the matrix \dmatrix{0,2,1,4,3,6,5}
+ \I{dmatrix} produces a twelve-tone matrix of arbitrary length, as shown in \href{https:matrices.netlify.com}{this website}. Its parameter is the row sequence. For example, \verb|\dmatrix{0,2,1,4,3,6,5}| produces the matrix \dmatrix{0,2,1,4,3,6,5}
- \begin{itemize}
- \Ii{sep} scales the matrix.
- \Ii {vsep} scales the matrix vertically.
- \Ii {hsep} scales the matrix horizontally.
- \Ii{lines} draws lines between rows and columns.
- \Ii{outside lines} only draws the outside lines.
- \Ii{inside lines} only draws the inside lines.
- \Ii{vlines} only draws the vertical lines.
- \Ii{hlines} only draws the horizontal lines.
- \end{itemize}
- \verb|\dmatrix[lines,sep=0.75]{0,2,1,4,3,6,5}| produces the matrix
+ The command automatically reduces the input and output modulus the length of the input series. Thus, the input \verb|\dmatrix{7,9,8,11,10,13,12}| produces the same output as before.
- \dmatrix[lines,sep=0.75]{0,2,1,4,3,6,5}
-
- \begin{itemize}
- \Ii{no tikz} deletes the tikz environment and lets the user write it instead.
- \end{itemize}
-
- \I{ddiagram} produces a twelve tone clock diagram of arbitrary length, as shown in \href{https:diagramas.netlify.com}{this website}. For example, \verb|\ddiagram{0,2,1,4,3,6,5}| produces the diagram\\
- \ddiagram{0,2,1,4,3,6,5}
-
- \begin{itemize}
- \Ii{name} writes a name at the center of the diagram.
- \Ii{up} lets the user choose which number is up north. The default value is the first number in the row.
- \Ii{arrow shift} lets the user choose where the arrow should fall on the line. The values range from 0 to 10. The default value is 2.5.
- \end{itemize}
-
- \verb|\ddiagram[name=P, up=5, arrow shift=5]{0,2,1,4,3,6,5}| produces the diagram\\
- \ddiagram[name=P, up=5, arrow shift=5]{0,2,1,4,3,6,5}
-
-
- \begin{itemize}
- \Ii{no numbers} deletes the numbers around the diagram.
- \Ii{no arrow} deletes the arrow inside the diagram.
- \end{itemize}
-
- \verb|\ddiagram[no numbers, no arrow]{0,2,1,4,3,6,5}| produces the diagram\\
- \ddiagram[no numbers, no arrow]{0,2,1,4,3,6,5}
-
- \begin{itemize}
- \Ii{xshift} shifts the figure horizontally.
- \Ii{yshift} shifts the figure vertically.
- \Ii{no tikz} deletes the tikz environment and lets the user write it instead.
- The option \textsf{up} does not work anymore and the up position becomes 0.
- It is recommended that the user passes the option \textsf{ddiagram} to the environment:
- \begin{verbatim}
- \begin{tikzpicture}[ddiagram]
- \ddiagram[no tikz]{0,2,1,4,3,6,5}
- \end{tikzpicture}
- \end{verbatim} produces the same diagram as \verb|\ddiagram{0,2,1,4,3,6,5}|.
- \end{itemize}
-
- \I{ddihedral} produces a dihedral representation of a series of arbitrary length. For example, \verb|\ddihedral{0,2,1,4,3,6,5}| produces the diagram\\
- \ddihedral{0,2,1,4,3,6,5}
-
- \begin{itemize}
- \Ii{t} applies the transformation \textit{transposition} to the diagram.
- \Ii{s} applies the transformation \textit{inversion} to the diagram.
- \Ii{c} applies the transformation \textit{cyclic shift} to the diagram.
- \Ii{v} applies the transformation \textit{retrograde} to the diagram.
-
- The transformations are applied in that exact order.
- \end{itemize}
-
- \verb|\ddihedral[s=1, c=4]{0,2,1,4,3,6,5}| produces the diagram\\
- \ddihedral[s=1, c=4]{0,2,1,4,3,6,5}
+ \I{ddiagram} produces a twelve tone clock diagram of arbitrary length, as shown in \href{https:diagramas.netlify.com}{this website}. Its parameters are the row sequence and its name. An additional optional parameter tells which number must be up north. The default value is the first number. For example, \verb|\ddiagram{0,2,1,4,3,6,5}{P}| produces the diagram \ddiagram{0,2,1,4,3,6,5}{P}
+
+ and \verb|\ddiagram[3]{0,1,2,3,4}{P}| produces the diagram \ddiagram[3]{0,2,1,4,3,6,5}{P}
+
+ The command also reduces the input and output modulus the length of the input series.
- \begin{itemize}
- \Ii{no italics} removes the italics from the diagram name.
- \Ii{new t} renames the transformation \textit{transposition}.
- \Ii{new s} renames the transformation \textit{inversion}.
- \Ii{new c} renames the transformation \textit{cyclic shift}.
- \Ii{new v} renames the transformation \textit{retrograde}.
- \end{itemize}
-
- \verb|\ddihedral[no italics, new v=R, v=1]{0,2,1,4,3,6,5}| produces the diagram\\
- \ddihedral[no italics, new v=R, v=1]{0,2,1,4,3,6,5}
-
- \begin{itemize}
- \Ii{no tikz} deletes the tikz environment and lets the user write it instead. It is recommended that the user passes the option \textsf{ddihedral} to the environment:
- \begin{verbatim}
- \begin{tikzpicture}[ddihedral]
- \ddihedral[no tikz]{0,2,1,4,3,6,5}
- \end{tikzpicture}
- \end{verbatim} produces the same diagram as \verb|\ddihedral{0,2,1,4,3,6,5}|.
- \end{itemize}
+ \I{ddihedral} produces a dihedral representation of a series of arbitrary length. Its parameters are the original row sequence and, optionally, the transformations it undergoes: \texttt{t,s,c,v} applied in that order. For example,\\ \verb|\tikz{\ddihedral[t=2,v=1]{0,2,1,4,3,6,5}}| produces the diagram\\ \tikz{\ddihedral[t=2,v=1]{0,2,1,4,3,6,5}}
+
+ It needs to be inside a \texttt{tikz} environment, as opposed to the previous ones, which are separate \texttt{tikz} environments on their own. This is because rotation or translation lines are sometimes included in this diagram, and sometimes it needs scalings.
+
+ The command also reduces the input and output modulus the length of the input series.
\I{darrows} produces the arrows from the \verb|\ddihedral| diagram. For example,
- \verb|\darrows{0,2,1,4,3,6,5}| produces the arrows\\
- \darrows{0,2,1,4,3,6,5}
-
- \begin{itemize}
- \Ii{no tikz} deletes the tikz environment and lets the user write it instead.
- \end{itemize}
+ \verb|\tikz{\darrows{0,2,1,4,3,6,5}}| produces the arrows\\
+ \tikz{\darrows{0,2,1,4,3,6,5}}
\I{drow} produces a twelve-tone row sequence as a permutation in its matrix form. For example, \verb|\drow{0,2,1,4,3,6,5}| produces the row
\drow{0,2,1,4,3,6,5}
- \begin{itemize}
- \Ii{sep} lets the user choose the column separation.
- \end{itemize}
-
- \verb|\drow[sep=10pt]{0,2,1,4,3,6,5}| produces the row
-
- \drow[sep=10pt]{0,2,1,4,3,6,5}
-
\end{itemize}
\section{The package code}
\lstset{
+% frame=lines,
+ %
language=[Latex]Tex,
%
basicstyle=\footnotesize\sffamily,