summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/ddphonism
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/ddphonism
Initial commit
Diffstat (limited to 'macros/latex/contrib/ddphonism')
-rw-r--r--macros/latex/contrib/ddphonism/README.md31
-rw-r--r--macros/latex/contrib/ddphonism/ddphonism.pdfbin0 -> 283599 bytes
-rw-r--r--macros/latex/contrib/ddphonism/ddphonism.sty392
-rw-r--r--macros/latex/contrib/ddphonism/ddphonism.tex190
4 files changed, 613 insertions, 0 deletions
diff --git a/macros/latex/contrib/ddphonism/README.md b/macros/latex/contrib/ddphonism/README.md
new file mode 100644
index 0000000000..02aaf43b68
--- /dev/null
+++ b/macros/latex/contrib/ddphonism/README.md
@@ -0,0 +1,31 @@
+The ddphonism package
+Celia Rubio Madrigal
+2019/09/01
+
+__________________
+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.
+
+__________________
+Change history
+
+Version 0.1 (2019/08/10)
+- Initial public release
+
+Version 0.2 (2019/09/01)
+- Added several new features and options
+
+__________________
+License
+
+Copyright (C) 2019 by Celia Rubio Madrigal <celrubio@ucm.es>
+
+Permission is granted to distribute and/or modify this work under the
+terms of the LaTeX Project Public License (LPPL), version 1.3c or
+later.
+
+The LPPL maintenance status of this work is "maintained".
+
+This work consists of the files ddphonism.sty, ddphonism.pdf and README
+and the derived file ddphonism.tex.
diff --git a/macros/latex/contrib/ddphonism/ddphonism.pdf b/macros/latex/contrib/ddphonism/ddphonism.pdf
new file mode 100644
index 0000000000..54a76037b8
--- /dev/null
+++ 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
new file mode 100644
index 0000000000..4ae54d3e63
--- /dev/null
+++ b/macros/latex/contrib/ddphonism/ddphonism.sty
@@ -0,0 +1,392 @@
+% ddphonism
+%
+% (c) Celia Rubio Madrigal
+%
+%% 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.]
+
+\RequirePackage{etoolbox}
+\RequirePackage{xparse}
+\RequirePackage{tikz}
+\RequirePackage{xstring}
+\RequirePackage{pgfkeys}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Matrices
+
+\usetikzlibrary{matrix}
+
+\ExplSyntaxOn
+\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%
+}
+
+\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
+ }
+ , 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{\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%
+}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Diagrams
+
+\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
+ {\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%
+}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Dihedral diagrams
+
+\tikzstyle ddihedralArrow=[decoration=
+{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,
+ 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%
+}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Rows
+
+\pgfkeys{
+ /drow/.is family, /drow,
+ default/.style = {sep=\arraycolsep},
+ sep/.estore in = \drowSep,
+}
+
+\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}
+}
+
+\endinput
+
+
+%% End of file `ddphonism.sty'. \ No newline at end of file
diff --git a/macros/latex/contrib/ddphonism/ddphonism.tex b/macros/latex/contrib/ddphonism/ddphonism.tex
new file mode 100644
index 0000000000..2a6f438ce6
--- /dev/null
+++ b/macros/latex/contrib/ddphonism/ddphonism.tex
@@ -0,0 +1,190 @@
+\documentclass{article}
+
+\usepackage{hyperref}
+\usepackage{multicol}
+\usepackage{listings}
+
+\usepackage{ddphonism}
+
+\title{The \textsf{ddphonism} package\footnote{This
+ document corresponds to \textsf{ddphonism} v0.2, dated 2019/09/01.}}
+\author{Celia Rubio Madrigal\footnote{Email: \href{mailto:celrubio@ucm.es}{\texttt{celrubio@ucm.es}}}}
+\date{September 1, 2019}
+
+
+\begin{document}
+
+ \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.
+
+ \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}
+ \end{abstract}
+
+ \tableofcontents
+
+ \section{Introduction}
+ There are hundreds of music tools and software online which are able to produce different music notations. However, I have never seen a \LaTeX{} tool that can do the same. This package is not only about notation, but it also calculates mathematically how this notation should work.
+
+ 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:
+
+ \begin{multicols}{2}
+ \dmatrix{4,3,2,1,0}
+
+ \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}
+
+ \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.
+
+ \newcommand{\I}[1]{\item[\texttt{$\backslash$#1}]\quad}
+ \newcommand{\Ii}[1]{\item[\textsf{#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}
+
+ \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
+
+ \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}
+
+ \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{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}
+
+ \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{
+ language=[Latex]Tex,
+ %
+ basicstyle=\footnotesize\sffamily,
+ keywordstyle=\footnotesize\sffamily,
+ identifierstyle=\footnotesize\sffamily,
+ commentstyle=\footnotesize\sffamily,
+ stringstyle=\footnotesize\sffamily,
+ escapechar=¬,
+ %
+ numberstyle=\footnotesize\sffamily,%\ttfamily\tiny\color[gray]{0.3},
+ numbers=left,
+ stepnumber=2,
+ numbersep=15pt,
+ %
+ columns=flexible,
+ showstringspaces=false,
+ tabsize=4,
+ }
+ \lstinputlisting{ddphonism.sty}
+
+\end{document}