Saturday, March 28, 2020

Music and Geometry - part IV: Second Voice Leading Plane Live Improvisation



Introduction

In the first article we introduced the pitch line. The second article examined what happens to the pitch line if you remove all octave information and replace pitch with pitch class. As we found out the pitch line bends into a pitch circle. In the third article we left the one-dimensional spaces of pitch and pitch circle, and we started looking at intervals, represented as points in a 2d-plane. In this fourth (and for now final) article in this series about geometry and music, we will examine the effect of removing octave information from the voice leading plane and replacing pitch with pitch class.

First, let’s recall what we ended up doing last time.


Live improvisation in the 2d voice leading space

If you are not afraid of computers and trying new things, I’ve created a supercollider program that allows you to explore the 2d voice leading space auditively by navigating it using the computer mouse.

If you want to play with the program yourself, you will first need to install the free and open source supercollider system. You can download it from the supercollider download site.
Before you worry: this is free of cost and completely legal.

The second step is to download the voiceleadingplane.sc code I wrote from my github page. If you have no idea how to use github, the easiest is to click the green “Clone or download” button on my github page, and then the “download ZIP” link that appears. This will download a .zip file to your computer that contains the voiceleadingplane.sc program as well as a LICENSE agreement that basically grants you the right to use this software for any purpose you see fit, including modifying it and calling it your own, as long as you distribute your derived work under the same license for others to learn from and to modify.

Finally you will need to start the “scide” editor that you installed as part of supercollider, and paste the contents of the voiceleadingplane.sc file in it, put the cursor just before the first bracket and press ctrl-enter (or command-enter on a Mac). You can change the sounding interval by clicking the different points in the voice leading space.

The next video gives a demonstration of me exploring my newly created musical instrument. Navigating the voice leading space like this to actually create music is new to me as well. As with any new instrument this one too would benefit from some practice to make (better) music!




I kept the program as simple as possible. Did you like what you see? Did you encounter problems? Do you wish you had additional features to play with? Consider logging a bug or a suggestion on github then.

Removing octave information

Recall from last article that every point in this plane consists of a pair of notes with associated octave number. Now what happens if we remove the octave information?

If we no longer consider the octave numbers, the space contains a lot of points that represent duplicate information, e.g. the points (E3,G3), (E3,G4), (E4, G3), (E4, G4), (G3, E3), (G4,E3), (G3, E4) and (G4, E4) are all equivalent (as well as all other intervals consisting of an E-note and a G-note). In the following figure, these (E,G) and (G,E) intervals are colored.




As there’s no need to keep all those equivalent points around, we will select some that, taken together, represent all possible intervals (discarding octave information).

Selecting each possible interval

In the next figure each point is colored according to the size of the interval it represents. We select a subset of the points that covers all distinct intervals ignoring octave information. Only the points that fall completely in the black rectangle are part of the selection. Given that horizontal movement represents parallel motion, it should not come as a surprise that the colors form horizontal bands. (The colors represent the size of the interval.) The fact that the colored bands are distributed symmetrically around the horizontal axis should not come as a surprise either: this is the consequence of the fact that (because of ignoring octave information) an interval like (E,G) is equal to an interval (G,E). When you move along the 45deg axes, you’re moving in parallel with one of the contributing pitch lines (and therefore perpendicular to the other one), and therefore you expect to hear oblique motion.



Let us look at this selection of points in more detail. In the following image, the selection of points has been stretched horizontally, and squeezed vertically, but it is still the exact same selection of points as in the previous image.



Each ellipse shape in the ribbon corresponds to a point on the 2d voice leading plane. Moving vertically in this plane still represents perfect contrary motion, and moving horizontally represents parallel motion.

Bending the voice leading plane

To fully understand the beauty of what we’ve created here, we need to take a second, very close look at the colorful ribbon. We’re especially interested in what happens at the borders of the ribbon. It will become apparent that the ribbon does not represent all our intuitions about the 2d voice leading plane. Recall that moving horizontally causes the 2 voices to move in parallel motion. Look at the upper side of the ribbon. It starts with (C,C), and as we move horizontally, it goes to (C#,C#), …, all the way to the right where it says (F#,F#).

Now what happens if we try to go even further horizontally? Well, at first sight we just drop off the ribbon into empty space. But look closely… what we should be doing, taking into account that moving horizontally implies parallel motion, is jumping to the lower left corner and continuing our journey going horizontal until we reach the lower right corner of the ribbon, where it says … (B,B), (C,C) again. And what happens if we try to go even further horizontal? Indeed! We jump back to the upper left corner and continue our journey horizontally.

It is as if the upper left corner and the lower right corner are one and
the same point in space. And in the same way the lower left corner and the
upper right corner are the same point in our interval space. Our ribbon does
not represent these intuitions explicitly.


Similarly, you can verify that travelling vertically on the ribbon represents perfect contrary motion of the voices, and that again the same corners seem to be connected to each other as in the previous paragraph. Now also verify how every point on the right side of the ribbon matches up with the upside-down points on the left side of the ribbon.

Our 2d ribbon representation does not explicitly show these connections between corners and left and right side of the ribbon. Can we do something, similar to what we did with bending the pitch line into a pitch circle, to get a graphical representation that makes all these connections explicitly visible?
The answer is: yes! But it’s not as easy as when we bent the pitch line into the
pitch circle. I’ve created a video to illustrate how it can be done.


This time we use 3 dimensions to represent the effect of ignoring octave  information and order between notes in the intervals on our 2d plane. Despite using 3 dimensions to draw our space, the resulting space is really still two-dimensional. Only points glued to the surface have a physical interpretation as an interval. The resulting figure is a so-called Moebius strip. It is a fascinating geometrical object for many reasons.

Amusing videos illustrating some of the wonders of Moebius strips can be found on Youtube. Here’s one (not made my be) that illustrates the unexpected things that can happen if you try to cut Moebius strips in half.


Here’s another one (also not made by me) that demonstrates how Moebius strips, despite first appearance, have no top or bottom side, and no left or right side


Conclusion

Congratulations if you made it until here! We’ve come a far way. We started with pitches and pitch lines in the first article, then discarded octave information and saw how this bent the pitch line into a pitch class circle in the second article. Next we turned our attention to intervals and discussed how to represent these intervals as points on a plane in the third article. Finally we discarded octave information again in the fourth article and ended up with a Moebius strip.

Geometry doesn’t stop at 2 or 3 dimensions. Mathematics is not limited to things we can easily imagine and represent. You can create a voice leading cube with three-note chords, and keep on adding dimensions to analyze four- and more-note chords, and study the geometrical properties of these spaces. But as the number of dimensions in these spaces increases, things get harder to represent with movies and drawings. That’s where you need to start using more rigorous maths.

Music and Geometry - part III: Intervals, Counterpoint and Voice Leading



In the first and second article we’ve studied single pitches. This is great for analyzing melodies or scales, but its usefulness is limited when considering multiple pitches sounding simultaneously. In this article we will turn our attention to intervals (2-note chords).

Representing intervals

A straightforward idea would be to represent intervals as line segments on the pitch line, or as circle segments or chords on the pitch class circle. The following could represent an interval made of pitch classes C and E.


While this representation has been used as the basis for other exotic music theories (e.g. Peter Schat’s tone clock theory), as far as the geometrical structure of the space of intervals is concerned this approach won’t bring us many new insights.

To represent intervals we will instead represent groups of 2 notes as one point in a 2-dimensional space. Representing an interval as a point in a 2-dimensional space sounds abstract, so let’s examine first what this means.

Probably the simplest way to represent an interval as a point in a two-dimensional space, is to consider two pitch lines, each of which contribute a note to the interval. A horizontal pitch line contributes a note, and a vertical pitch line contributes another note. Both together determine a point in the 2-dimensional plane. Any point on the plane can be analyzed as consisting of a combination of 2 pitches.

As an example, we look at the representation of the interval (E4,G4). The fact that each point consists of the contribution of two pitch lines is what makes this a two-dimensional space (you need two coordinates to unambiguously define a point in this space). This is a 2-dimensional extension of the pitch line we discussed in the first article. Because every point in this space represents an interval, we call it the interval space.

The first note for every interval is contributed by the horizontal pitch line, and the second note in the interval is contributed by the vertical pitch line. In the above drawing each note in each note pair has an octave number associated to it. Just as with the pitch line, also microtonal intervals can be drawn in the interval plane.

A composition in 2 voices can be represented as a path in the two dimensional interval space. Consider e.g. a counterpoint exercise in the D dorian mode taken from Johann Joseph Fux’ book “Gradus ad Parnassum”. Suffice to say there’s a lot more to counterpoint than just drawing lines in 2d interval space but in this article we won’t go any deeper.






When moving from interval to interval, the jumps (thick black lines) are kept relatively small, especially if you mentally cross out intervals (points) that cannot be used because they contain notes that are not available in the D dorian mode. This is no coincidence: one of the (many) rules in counterpoint is to limit the size of the jumps in melodies, to keep the intervals easy to sing.

Voice leading

Voice leading is a compositional principle governing many styles of music. It is used by classical, pop, folk and jazz musicians alike. The basic idea is that when you go from one chord (or interval) to the next, you do so by moving the different voices the shortest distance possible, so as to gently lead the listener from one chord to the next. Consider the following examples of good and bad voice leading. Both measures move between the same chords. Play them on the piano to hear the difference! In the smooth version adjacent notes take small leaps or remain the same as much as possible.

Because of how the two-dimensional plane of intervals is constructed, points that lie closer together in the plane have a shorter voice-leading distance. Another way to say the same is that a jump between two points in the plane (i.e. a move from one interval to another interval) will have better voice leading if the distance you jump is smaller. This follows from the fact that adjacent points in the 2d interval space are made from adjacent notes on the contributing pitch lines.

Note that our 2d interval space contains all chromatic notes. In many pieces, composers restrict themselves to a subset of the chromatic notes (e.g. only the white keys on a piano). In such cases the interval space can redrawn showing only the relevant intervals.

Voice leading is not only used to write choir pieces! Listen, e.g. how smoothly J.S. Bach moves from chord to chord in his prelude #1 from the well-tempered clavier:
or the dazzling tribute to Bach’s prelude made by Frederic Chopin in which he guides us through a wild ride from c major through the most distant keys and back to c major with ease (well… for the listener at least!)

Motion

Now that we’ve introduced the concept of voice leading, it’s useful to mention the concept of motion, and to study how it translates to our 2d interval space. When moving from one interval to the next, one has a choice between four types of motion.



In parallel motion, both voices move together, keeping the same interval between them. In similar motion, both voices move up or down together, but not necessarily keeping the same interval. In contrary motion, when one voice moves up, the other moves down and vice versa. In oblique motion, one voice remains stationary while the other voice moves.

In many music styles certain parallel motions are forbidden: parallel fifths and parallel octaves are commonly forbidden. This is not just because music teachers like to be pedantic, but also because they sound really bad in a piece that for the rest uses more traditional rules. People who didn’t study music composition can still hear that something “strange” happens when hearing a parallel fifth, although they will struggle to define exactly what causes this sensation of “strange”. It’s also advised not to keep using parallel motion for too long because that starts to tie the two voices together, threatening their melodic independence.

In contrapuntal writing at the same time contrary motion is applauded, as it helps suggesting that the melodies in the two voices are independent.

Parallel and contrary motion in 2d interval space

How is parallel and contrary motion visible in our 2d interval space? Look at the diagram and verify for yourself: any two points in the 2d interval space that are connected by a straight line under 45 degrees represents parallel motion. And any two points in the 2d interval space that are connected by a straight line under -45 degrees represents perfect contrary motion (i.e. contrary motion whereby each voice moves the same number of scale degrees).



If you check the 2d path again that we drew in the counterpoint exercise, you can immediately see from the path segment angles that the composer switches between parallel motion and contrary motion after every chord.

Because voice leading and motions play such a central role in classical music theory, professor Tymoczko decided to rotate the 2d interval pitch space a bit, to make parallel and contrary motion happen along horizontal and vertical directions in the 2d space. This new space contains all the same information as the original space, just rotated a bit. The new space is called the “voice leading space”.

This article was mostly about explaining the preliminaries for the next article where we will examine what happens to the voice leading space if we replace pitch with pitch class again. Remember from the previous article that the pitch line was bent into a pitch class circle.

What do you expect will happen to the 2d voice leading space? Will it simply bend into a ring? Or can we expect something more twisted? Stay tuned for the next episode!

Music and Geometry - part II: pitch class circle and composing

In the previous article we introduced the concept of pitch and pitch class. We saw how notes could be represented on a pitch line, forming a one-dimensional geometrical space, and how removing octave information caused the line to turn into a circle.

The pitch class circle, despite first appearance, is still a one-dimensional space (but it’s a curved one). The reason is that, like on the pitch line, you still need only one number (a so-called coordinate) to unambiguously address a point on the circle compared to a chosen reference point. We’ll explore this idea and some of its consequences later in this article. We will look at some properties and applications of the pitch class circle, getting a first taste of how strange life in curved spaces can be.

Composition operations on the pitch class circle

Geometrical operations

As with the pitch line, the pitch class circle allows to perform certain composition operations.
Transposition of pitch classes is done by traveling along the pitch class circle. After the transposition is done, the composer is free to assign octaves to convert from pitch class back to pitch.
Both example 1 and 2 in the following picture can be represented on the pitch class circle below.



Inversion mirrors around a diameter of the circle:




Mathematical equivalent of geometric operations

Instead of drawing pitch class circles, and sliding or mirroring pitches, one can also do something easier. Remember how I said that the pitch class circle is a one-dimensional space? And we needed only one number (a coordinate) to unambiguously name any pitch on the circle? Well, let’s choose the “C” class as reference (i.e. we give it the coordinate 0) and assign a coordinate to the remaining pitches. Note that with our choice of numbers, microtonal pitches can be represented as floating point numbers. E.g. F quarter sharp would have a coordinate 5.5, because it falls exactly between F (with coordinate 5) and F# (with coordinate 6).

Note that coordinate 12 does not occur on the pitch class circle. Coordinate 12 is equivalent to coordinate 0 on the pitch class circle. Whenever we do mathematics operations while working with pitch classes and we end up with numbers >= 12, we need to keep subtracting 12 until we end up lower than 12 again. In math speak, we say that we calculate “modulo 12”, and that “12 is congruent with 0 modulo 12”.

When you calculate modulo 12, you can write funny sums like: 11 + 3 = 2 (mod 12). Why? Well, 11+3 in the normal universe equals 14, but we’re calculating modulo 12, so we need to subtract 12 until the result is smaller than 12, and we get 14-12=2. Life in curved spaces at first sight seems different from what we’re used to in everyday life but attentive readers probably have noticed that clock reading uses the exact same form of modulo 12 arithmetic. 3 hours later than 11 o’clock indeed is 2 o’clock. Perhaps this is the reason that in at least one other exotic music theory I’m aware of the pitch class circle is also known as a tone clock.


Using the coordinates we can now also do the same composition operations we did using geometry before using only purely mathematical operations. Transposition boils down to adding a constant number to each note-coordinate.




Inversion boils down to subtracting the note-coordinate from the constant number 12.



Beyond geometry

Now that we can use numbers instead of geometry, nothing stops us from performing other operations on pitches and pitch classes. What happens to a melody if you multiply all pitch coordinates with 2? What happens if you take your 2 favorite melodies and calculate their average? What happens if you take two melodies and you multiply them pitch by pitch? Your imagination and curiosity are the only limits here. Let’s see some simple examples.

Transforming a single melody using maths





Using the pitch class circle to analyze scale symmetry

Neither the pitch line nor the pitch class circle in themselves are the right or wrong representation. The pitch class circle offers possibilities for analysis and composition that were not readily present in the pitch line representation.

As an example, the pitch class circle immediately and very visually shows you if a collection of notes belong to a symmetrical scale. This is illustrated in the following picture, where some important symmetrical scales/modes are illustrated (there are many more). The symmetry is visually present.


There are more music-theoretical things one can do with the pitch class circle, but in this article I won’t go any deeper.

In this article we saw how pitch classes can be assigned numbers, how we can calculate with these numbers. We saw how closely connected the concepts of musical pitch class, curved spaces and modular arithmetic are connected.

In the next articles we will investigate “intervals” instead of “pitches”. We will leave our one-dimensional spaces (pitch line and pitch class circle) behind, and will end up exploring two-dimensional curved spaces, where life is even more strange and fascinating.

Music and Geometry - part I: pitch class

Introduction

In this series of 4 articles I’m going to introduce you to what for many will be the most exotic piece of music theory you’ve ever come across. Even if you think you’re not good at theory, you may want to try following along and – who knows – perhaps pick up an insight or two.

Music shows deep inner structure on multiple levels that appeals to mathematically inclined people. Math professor Guerino Mazzola has written a book called the “Topos of Music”. It’s safe to assume that only a handful of people in the world really understand the finer details of what it describes. You literally need a PhD in mathematics (in category theory to be more precise) to even begin making sense of it. Professor Mazzola argues that all this complexity is unavoidable because the music it models is just as complex.

Luckily also other books showing neat connections between music and mathematics have been written. And luckily these books are accessible to a wider audience. One of the more intriguing ones, in my humble opinion, is “A Geometry Of Music” by professor Dmitry Tymoczko of Princeton University. In these articles we will dip our toes in some of the very basics of his ideas. To be perfectly clear: I’m not affiliated to professor Tymoczko or the book in any way, and all awesome ideas are his, whereas all mistakes in the explanation are mine.

Pitch line


If you just consider notes in a chromatic scale, starting with the very lowest note you can imagine, and rising to the very highest note you can imagine, it’s not so difficult to depict these notes as points on a line. Although the picture below highlights only a few special notes on the line, actually all conceivable pitches, including microtonal ones or pitches so high they can only be heard by dogs, have their place on the pitch line which has no beginning and no end. It’s an infinite line. In geometry, such a line is considered a 1-dimensional space.


Some simple composition operations can be done by reasoning on a pitch line directly. Take transposition, e.g., and observe how it corresponds to sliding along the line. Or consider inversion of a melody and observe how it corresponds to mirroring pitches around some other pitch on the pitch line.





Pitch class

Yet this pitch line doesn’t model all existing intuitions about pitches. One intuition that is not visible on this line, is the feeling that notes one octave apart in some sense sound the same. Who doesn’t remember the lyrics to the Do-Re-Mi song from the sound of music? When reaching the end of the song, it’s made very clear that “this will lead us back to do”, as if all do’s (C notes) are equal in some sense.

A more difficult way to say the same thing is to say that in some contexts it makes sense to abstract away the exact pitch, and instead reason on pitch class. In other words we don’t speak of a concrete C4 or D3 note anymore, but of a more abstract concept of a “C” note, or a “D” note, with no indication of exactly which octave it belongs to.

The question arises what introducing this “pitch class” abstraction does to our pitch line. How does incorporating pitch class change the pitch line?

The solution is straightforward, but not necessarily trivial to come up with by yourself. To model the concept of pitch class, we need to transform our pitch line so that all differences between octaves disappear. This can be done by curling up the pitch line in three dimensions, so that all equivalent notes (e.g. all “C” notes) perfectly line up. After this is done, we will squash the curled line until it’s flat again. If you think deeply about it, the lining up and especially the squashing of equivalent pitches indeed is a kind of geometrical equivalent to replacing concrete notes with pitch classes. Just like with the pitch line, the pitch class circle has plenty of room to host all microtonal pitches you can come up with. In case you’ve been wondering: the pitch class circle as such has nothing to do with the so-called “circle of fifths”. Other than the fact that both are represented on a circle, there’s no special relation between the two circles.

Please watch the first video animation to better understand how replacing concrete pitch with pitch class has the effect of curling up the pitch line into a pitch class circle.


Before going on to our next topic, let’s sum up a few quick facts about the concept of pitch class and related subjects:
  • “Pitch” indicates a specific point on a pitch line.  C4, for example, is a different pitch than C5.  The higher the number, the higher the sound.
  • “Pitch class” indicates an entire group of pitches, related by their “octave equivalence”.  The pitch class of C, for example, includes C4, C5, C9 and so on.
  • “Pitch class” includes notes with enharmonic spellings.  The pitch class of “C”, for example, would include such pitches as C3, B#5, D double flat 6, and so forth.
Pitch classes are “octave equivalent”, which means that pitches in different octaves are still in the same class.   Pitch classes are also “spelling equivalent” which means that notes spelled differently but sounding the same, which we call enharmonic spellings, are in the same pitch class.

Here is an example of a piece which is built entirely on one pitch class, until the final few measures.