# Networks in transformational music theory (2)

This is the continuation of my previous post on networks in transformational music theory. Last time, I introduced very briefly the notion of Klumpenhouwer networks, and hinted at their use and the way they can be related through network isographies. In this post, we are going to go deeper and see how we can formalize this notion using mathematical tools from category theory.

Klumpenhouwer networks (short: K-nets) are, originally, networks of pitch-classes highlighting the possible transformational relations between them. The pitch-classes are taken from the set of the usual twelve pitch classes (or, equivalently, $\mathbb{Z}_{12}$), and the transformations are taken from our usual $\text{T}/\text{I}$ group of transpositions and inversions. For example, let’s take our well-known C major chord. From basic music theory, we know that a major chord is made of a stacked major and minor third, so we can describe the relations between the constitutive pitch-classes of this chord using the network shown below.

However, since we are considering transformations in the $\text{T}/\text{I}$ group, we could also describe the relations between some pitch classes using inversions. For example, let’s say that, in the above major chord, we would like to emphasize that the pitch classes E and G are inversionally related through the inversion $I_{11}$. This leads us to the following network.

Of course, we could also have done the same thing for the pitch classes C and E and kept the transposition $T_3$ between E and G, or even described our C major chord using only inversions. At this point, the observant reader may wonder why, as we decided to focus on the $I_{11}$ inversion between E and G, we have also decided to highlight the $I_7$ inversion between C and G. The answer to this question will be given below.

It might seem a little strange to describe a major chord using inversions between its constitutive elements. A major chord is always defined by a stacked major and minor third: the $T_4$ and $T_3$ transformations will always be there, whatever the root pitch class is. Using inversions on the other hand may lead to different results depending on the root. For example, in the C major chord (C,E,G), E and G are related by the $I_{11}$ inversion, whereas in the Eb major chord (Eb,G,Bb), G and Bb are related by the $I_5$ inversion. The advantage of using transpositions and inversions, and Klumpenhouwer networks in general, is in fact immediate when one wants to compare pitch-class sets which are not necessarily related by transposition or inversions. My favorite example, which I have already presented in my previous post, is the following extract of Webern’s Three Little Pieces of Cello and Piano, op.11/2.

We have here three groups of three notes, namely (A,B,Bb), (C#,G,D), and (F,F#,Eb). Clearly, these pitch-class sets are not transpositionally related. In other words, if we describe these pitch-class sets using only transpositions, we won’t find the same sets of transformations, as shown in the networks below.

Notice however that these networks have in common the $T_1$ transposition. This is a hint that these pitch-class sets may be related after all, and in fact they are, if one drops transpositions for inversions, as shown in the networks below.

Now we see that these three pitch-class sets all share a common structure articulated around the $I_8$ and $I_9$ inversions, which results in a semi-tone interval between at least two pitch-classes.

This situation is quite usual in post-tonal music, and most applications of Klumpenhouwer networks can be found there. My previous post included a list of references which you can consult in this respect.

Formalizing Klumpenhouwer networks

The way I have pictured the networks above corresponds to the original formulation of Lewin and Klumpenhouwer, so that we can informally define a Klumpenhouwer network as a labelled graph, wherein the labels of the vertices belong to the set of pitch classes, and each arrow is labelled with a transformation in the $\text{T}/\text{I}$ group that maps the pitch class at the source vertex to the pitch class at the target vertex.

As said in my previous post, it is interesting to note that no definitive definition of Klumpenhouwer networks exists in the literature, and the conditions which are imposed on K-nets can vary from one paper to another. This motivated the algebraic approach we took with Andrée Ehresmann, using tools from category theory. In this regard, we needed to isolate the properties of Klumpenhouwer networks that remained unchanged between authors, in order to derive a sound mathematical formalization.

As said above, Klumpenhouwer networks can be seen as labelled graphs, where both arrows and vertices are labelled. However, there is one more property of arrows that should be respected, namely their compositionality: the composition of two labelled arrows should be an arrow labelled with the composite transformation. For example, if we describe the C major chord using transpositions, then in the networks below only the left one is valid and not the right one, since $T_3 \circ T_4 = T_7$ in the $\text{T}/\text{I}$ group (and not $I_7$).

Similarly, if we describe the C major chord using some inversions, then in the networks below, only the left one is valid, answering the above question on the presence of $I_7$.

Klumpenhouwer networks, with their vertices, arrows, and their compositional aspect, are highly reminiscent of categories, with their objects, morphisms, and composition of morphisms, and this is why we decided to formalize K-nets using category theory. The details of the approach we developped in collaboration with Moreno Andreatta and Andrée Ehresmann can be found in the following papers:

• Popoff, A., Andreatta, M., Ehresmann, A.: A categorical generalization of Klumpenhouwer networks. In Tom Collins, David Meredith, and Anja Volk, editors, Mathematics and Computation in Music: 5th International Conference, MCM 2015, London, UK, June 22-25, 2015, Proceedings, volume 9110 of Lecture Notes in Computer Science, pages 303–314. Springer International Publishing, 2015.
• Popoff, A., Agon, C., Andreatta, M., Ehresmann, A.: From K-nets to PK-nets: a Categorical Approach. Perspectives of New Music, 54(2):5–63, 2016.
• Popoff, A., Andreatta, M., Ehresmann, A.: Relational poly-Klumpenhouwer Networks for Transformational and Voice-leading Analysis. Journal of Mathematics and Music 12(1), 35–55 (2018).

Rather than giving the definition right away, I am going to detail step by step (though a bit informally) how we built the framework of what we call poly-Klumpenhouwer networks (PK-Nets), which are extended versions of Klumpenhouwer networks. I should warn the reader that I’m assuming from now on basic knowledge in category theory.

First, the easy part: we need to describe the musical transformations. If you have been following this blog, you surely know that we can use groups (the $\text{T}/\text{I}$ group acting on pitch classes, or the $\text{T}/\text{I}$ group acting on the set of major and minor chords, or the $\text{PLR}$ group acting on the same set) but also monoids (for example, the Noll monoid acting on pitch classes, or monoids acting on time-spans). But groups and monoids are special cases of categories, namely one-object categories. So in the most general case, we would take a category $\mathbf{C}$ of musical transformations. Since we are doing music theory, with concrete actions on musical objects, this means that this category usually comes with a functor $S \colon \mathbf{C} \to \mathbf{Sets}$ which encodes the action of the transformations on musical objects. This functor may be representable (think about the $\text{T}/\text{I}$ group or the $\text{PLR}$ group acting on the set of the 24 major and minor chords) or not (the $\text{T}/\text{I}$ group acting on the set of the 12 pitch classes). The category $\mathbf{C}$ along with the functor $S$ can be considered as the musical context, or support, of the analysis.

Next, we need arrows between some vertices, labelled with the possible musical transformations, and we need to respect compositionality. It should be quite obvious that this is nothing else but a functor $F \colon \Delta \to \mathbf{C}$, where $\Delta$ is a category which we will the call the diagram category of our network. The morphisms (arrows) of $\Delta$ are labelled using morphisms from $\mathbf{C}$ via the functor $F$, which also ensures compositionality.

But wait. So far, we have only described the transformations (the labelled arrows). We need to continue the construction so that vertices may be labelled too. For that, we need sets and elements, so we ask that there should be a functor $R \colon \Delta \to \mathbf{Sets}$, called the form. The elements of the images by $R$ of the objects of $\Delta$ are the actual musical objects, which we wish to label using elements in the images by $S$ of the objects of $\mathbf{C}$. A note played in a concert has many attributes: pitch, duration, timbre, etc. and the way we label it (for example, by its pitch class) determines one type of analysis.

So, in order to label these elements we could just define a bunch of functions between the image sets by $R$ and the image sets by $S$. But we need to ensure that these musical elements are actually related by the musical transformations which label the arrows. Long story short, the right categorical tool for this is a natural transformation $\phi$ between the functors $R$ and $SF$.

So finally, we have our following categorical definition of a poly-Klumpenhouwer network.

Let $\mathbf{C}$ be a category, and $S$ a functor from $\mathbf{C}$ to the category $\mathbf{Sets}$. Let $\Delta$ be a small category and $R$ a functor from $\Delta$  to $\mathbf{Sets}$ with non-void values. A poly-Klumpenhouwer network of form $R$ and of support $S$ is a 4-tuple $(R, S, F, \phi)$, in which $F$ is a functor from $\Delta$ to $\mathbf{C}$, and $\phi$ is a natural transformation from $R$ to $SF$.

A poly-Klumpenhouwer network can therefore be represented diagrammatically as follows.

• We recover ordinary Klumpenhouwer networks in case the images by the functor $R$ of objects of $\Delta$ are singletons. However we are not necessarily constrained to do so, and choosing a functor $R$ of the most general form gives us the advantage over K-nets of allowing us to consider sets with higher cardinalities, and even sets with varying cardinality (as might occur for example we one studies the transformations between a triad and a tetrachord). In other words, vertices are no longer labelled using single pitch classes, but can be sets of pitch classes.
• By explicitly separating the categories $\Delta$ and $\mathbf{C}$, we allow for a same PK-net skeleton to be interpreted in different contexts. The left part of the above diagram describes the specific musical part we wish to analyze, whereas the right part of the diagram describes the general musical context for analysis. For example, a given category $\mathbf{C}$ may describe the relationships between pitch-classes, while another category $\mathbf{C'}$ may describe the relationships between time-spans. Different functors $F \colon \Delta \to \mathbf{C}$ and $F' \colon \Delta \to \mathbf{C'}$ will then label the arrows of $\Delta$ differently, depending on whether the PK-net describes pitch-classes or time-spans. You can already guess that moving from one context to another will involve some notion of network morphism, which we will describe later using proper categorical definitions, thus generalizing the notion of network isography which appeared in Klumpenhouwer’s and Lewin’s work.
• In addition to the left/right distinction in the above diagram, we can also the notice that this diagram also distinguishes the upper part (the categories $\Delta$ and $\mathbf{C}$, the functor $F$), which corresponds to the realm of musical transformations, from the lower part (the category $\mathbf{Sets}$, the functors $R$ and $S$, the natural transformation $\phi$), which corresponds to the realm of musical objects. In fact, if musical objects are better described in another category than $\mathbf{Sets}$, then the notion of poly-Klumpenhouwer network can be generalized by replacing $\mathbf{Sets}$ with this new category, thus extending the scope of ordinary Klumpenhouwer networks. In a future post, I will explain why we also considered the category of finite sets and relations between them $\mathbf{Rel}$.

This definition may seem very abstract, so I’m going to give an example of a poly-Klumpenhouwer network, and show at the same time how they can describe the transformations of sets of varying cardinalities. Let $\mathbf{C}$ be the group $\text{T}/\text{I}$, considered as a single-object category, and consider its usual action on the set $\mathbb{Z}_{12}$ of the twelve pitch-classes (with the usual semi-tone encoding). This defines a functor $S \colon \text{T}/\text{I} \to \mathbf{Sets}$. Let $\Delta$ be the interval category (i.e., the category with two objects $X$ and $Y$ and precisely one morphism $f \colon X \to Y$, and consider the functor $F \colon \Delta \to \text{T}/\text{I}$ which sends $f$ to the transposition $T_4$. Consider now a functor $R \colon \Delta \to \mathbf{Sets}$ such that

$R(X)=\{x1, x2, x3\}, \text{and } R(Y)=\{y1, y2, y3, y4\},$

and such that $R(f)(x_i)=y_i$, for $1 \leq i \leq 3$. Consider the natural transformation $\phi$ such that $\phi(x_1) = C$, $\phi(x_2) = E$, $\phi(x_3) = G$, and $\phi(y_1) = E$, $\phi(y_2) = G$, $\phi(y_3) = B$, and $\phi(y_4) = D$.

In this way, we have built a PK-net $(R, S, F, \phi)$ of form $R$ and support $S$ which describes the transposition of the C-major triad to the E-major triad subset of the dominant seventh E7 chord. This functorial construction is shown below.

The reader versed in category theory may have noticed that our definition of a PK-net corresponds in fact to a morphism in the slice 2-category $\mathbf{Cat} \downarrow \mathbf{Sets}$. This gives another interpretation to poly-Klumpenhouwer networks. To see how, let’s downgrade things a bit and forget all the elaborate structures (groups, monoids, actions, etc.) we have used, and consider labelled sets. Assume a set $label L$ of labels: a labelled set $X$ with labels in $L$ is then just a function $f \colon X \to L$. But this is also an object in the slice category $\mathbf{Sets} \downarrow L$. In other words, the action (not in the mathematical sense, but in the common sense of the term) of labelling elements of $X$ in $L$ becomes an object in itself, a labelled set. Now, in transformational music theory, we are dealing with sets with extra structure: the musical transformations. So we are considering categories and functors from these categories to $\mathbf{Sets}$. Cranking up the abstract machinery, the action of labelling a set with extra structure (our diagram network) with labels in another set with extra structure (our musical context) becomes a morphism in the slice 2-category $\mathbf{Cat} \downarrow \mathbf{Sets}$, which involves additional stuff (the functor $F$ and the natural transformation $\phi$) to hold the whole construction consistent.

Of course, this all means that at some point we will need to consider morphisms of these PK-nets, and we will see that there are multiple ways to do so, which extend and generalize the notion of Klumpenhouwer network isography. But this will be a story I’m keeping for a later post.

Before finishing this post, I would like to mention an earlier categorical approach to Klumpenhouwer networks which appeared before our contributions, namely the work of Andreatta and Mazzola on limit denotators:

• Mazzola, G., Andreatta., M., From a Categorical Point of View: K-Nets as Limit Denotators, Perspectives of New Music, vol. 44, no. 2, 2006, pp. 88–113, available here.

Their paper can be divided in two parts, one dealing with the category $\mathbf{Sets}$, and one dealing with the category of modules. In the case of $\mathbf{Sets}$, their approach to formalize Klumpenhouwer networks consists in considering the categories $\Delta$, $\mathbf{C}$ (in their paper, the $\text{T}/\text{I}$ group), and the functors $F$ and $S$ just like above, and looking at the composite functor $SF$. One then takes the limit of the diagram $SF \colon \Delta \to \mathbf{Sets}$: if $\mathbf{C}$ is a group, this limit corresponds to a set of all possible Klumpenhouwer networks , so a K-net is just an element of this limit (with vertices labelled with single pitch-classes). In comparison to the approach above, the functor $R$ is absent, so that the distinction is blurred between the network and its musical context of analysis. In addition, since the musical context (the category $\mathbf{C}$ and the functor $S$) is not directly isolated in this construction, I am guessing it would be more difficult to define morphisms of networks corresponding to changes of musical context (the paper does not seem to define such morphisms, apart from the usual Klumpenhouwer isographies). Studying sets of varying cardinalities remain possible using powersets, and the framework of K-nets as limits can be extended to other categories than $\mathbf{Sets}$.