You're reading the public-facing archive of the Category Theory Zulip server.
To join the server you need an invite. Anybody can get an invite by contacting Matteo Capucci at name dot surname at gmail dot com.
For all things related to this archive refer to the same person.
This is the first of my "five formalized examples", per Baez's advice, to find a common abstraction.
I wrote a lot here, and after writing all of this, a very concrete intuition occurred to me that I think I can define without dumping a lot of text. The intuition is independent of music, so mathematicians can easily comment on it without needing to know music. I'll post it in another thread.
However, I spent a few months trying to make the following easy to read and personally clarifying, so I felt it would be a waste to not post it.
If you're not inclined, or don't have time, to read the post - I invite you to look at the diagrams, I think they're fun.
I want to explore the ways the layout of an accordion could be thought of as a sort of category, or at least how it's in a category. First I'm going to describe an accordion's layout with an algebraic structure.
The standard layout has a property that's sometimes called "isomorphic", unfortunately here this term is an adjective of one layout rather than a relationship between two.
The fundamental rule of an isomorphic layout is: a given handshape determines the quality of the notes.
For example, in the following image the bottom kinked line covers a C major chord, and the top kinked line covers a G dominant chord.
No matter where those patterns are on the grid, it'll sound Major, or Dominant, provided they are of those respective shapes. The quality of the chord shape is invariant under translations. Or in music terminology - translations are transpositions.
How are the notes placed on the keyboard to make this possible?
To answer this, I need two observations
Summarizing, equal shapes having the same quality implies vector additions of notes
I'm going to define these differences with torsors.
Let our base set be a hex lattice. Label the set . We can reach any other point of our lattice from any point by traveling an integer number of horizontal steps, and an integer number of diagonal steps.
Because we can specify the relative coordinates with a pair of integers. The group acting on our lattice is isomorphic to the free abelian group . So our hex lattice is a -Torsor.
If I was looking at a piano, there would only be horizontal moves, I can imagine it as equally spaced dots. This would be a -Torsor. Label this torsor .
Although there are lots of notes of various frequencies, they can be organized into 12 pitch classes labeled: . The pitch classes form a circle. If we say adjacent notes on the circle have a difference of 1, then we can rotate along the circle by specifying a number from - so the pitch classes are a -Torsor. Label this torsor .
For in , we have , where "" here is our group action on the pitch classes. We might also write this as . Then it's safe to write .
As a partial explanation of the pitch classes forming a circle. When assigning notes to the piano, you could imagine the piano layout as a helix over the circle of 12 dots, acting as a sort of universal cover for the twelve notes.
If you map the piano onto the pitches in this way, then if is the number of horizontal moves on a piano, that gets taken to moves on the pitches.
So we could specify how accordion notes map to piano notes. Or we can map to the pitch classes directly.
For example, Euler's tonnetz is the layout on the Harmonetta:
label the button marked "" by in the following examples.
We want a map so , and further, the rest of the points on the hex layout need to be mapped in such a way, so that
Note, because is a torsor, I could rewrite that as
One of my favorite layouts, the Wicki-Hayden, is defined by
This could be rewritten as
Wicki-Hayden_Musical_Note_Layout.png
There are a lot of patterns in the above, for example, the most common accidentals are closest to the diatonic scale.
If you ignore differences up to reflections, rotations and translations, there's under 20 of these - it's a fun puzzle to figure out exactly how many.
It's also fun to figure out how these relate to square grids, or gaussian integers. Square lattice layouts are natural fits for guitars:
I've been implicitly notating the basis of the free abelian group associated with the hex by {➶, ➵}, notate the basis of the free abelian group associated with the square lattice by . Then we have an evident group homomorphism between the two defined by what it does on their basis.
label the square lattice . If we have a layout , then we can pull this back to a layout as follows
So if we have a homomorphism between the free abelian groups, we can use it to define a function from the homset to the homset . If I tracked the underlying free abelian groups of the torsors in this notation, it'd be clear this defined a contravariant functor. This is because we're almost "precomposing" by .
Of course I usually am just playing on the layout I'm given.
I'd like to model the melodies I play on an accordion, as a sort of category. If I think of the accordion as a sort of space, then I'd like to think of paths on this space as a physical representation of the melodies.
My accordion has what is called a C system, its note layout is given by
Here's a diagram of what my accordion looks like, white notes are CDEFGAB, and black notes are the accidentals (a letter with a sharp or flat):
The bottom left C will be "x" on this layout.
Going to the right is a minor third, or three half steps. Going down and to the right is a whole tone, or two half steps. Going up and to the right is one half step, or a minor second:
Intervals changes C system.PNG
In the vector addition image I posted earlier, we add a one halfstep interval to a three halfstep interval, giving a four halfstep interval, or a Major third. I playfully call minor thirds "zigs" and Major thirds "zags" .
The image implicitly defines a layout via a map
I'm pushing the syntax slightly, the connection between squares and hexagons was compared above.
With we can summarize terminology:
One halfstep
Two halfsteps , where
minor third
Major third
I can easily describe more intervals this way, for example:
Perfect fourth
Consecutive perfect fourths, describe the pentatonic scale, this ends up being a straight line on the diagram:
This makes the layout very convenient when reading key signatures, because of the circle of fifths (which isn't explained here). If the key signature has 3 sharps, you include the bottom three black notes of the straight line. If it has 2 flats, you include the top two black notes of the line.
You can build chords by stacking thirds. For example, the kinked lines I shared earlier were describing chords. The dominant chord is a major third, followed by two minor thirds, or a zag zig zig. The Major chord is a Major third followed by a minor third, or a zag zig.
For the below I form the free monoid of and , and use the free monoid functor on to define
With this, I can summarize various possibilities in symbols:
Major triad
minor triad
diminished triad
diminished seventh =
Dominant =
minor 7th
half-diminished (minor seventh flat five) =
Major 7th
(I'm omitting the various augmented chords, those are chords which contain at least one zag zag)
In an earlier version of these notes, I simply wrote $$\t
[message truncated]
Let be a -Torsor, and a free monoid with elements in . Then we can define so
Now, suppose you have a sequence of buttons, . I can determine their quality by finding their sequence of differences. For example . If the sequence of differences is zig zag zig, then if I play those buttons I'll have a minor 7th chord, because m3 M3 m3 .
I can do even more. Given a sequence of intervals, the width of the whole chord is musically meaningful. Therefore, it's useful to add together this list of thirds: m3 + M3 + m3 = m7 = minor 7th interval. (A pet peeve of music notation for me - 3rds, 4ths, etc, should be called respectively 2nds, 3rds, etc. Then we'd have m2 + M2 + m2 = m6. It's annoying when you forget to count from 0!)
So a free monoid of accordion buttons lets me calculate a free monoid of intervals. I can then reduce the free monoid of intervals by simply adding the intervals together.
Usually all the intervals relative to the root are what we care about. This is also easy to find:
Here's a fun feature of these chord names. The sum of the intervals of a minor 7th chord, m3 + M3 + m3, gives a minor 7th interval. The Major 7th chord has the same double meaning behind its the name.
Part 1/3
On the c system accordion layout, the easiest intervals to play are small, making melodic lines convenient. For example, the intervals of the diatonic scale are never larger than 2, so it is a connected path of white notes.
The next diagram was made by putting a line between two notes if
I practice chords and their inversions by simply walking my hand down chord diagrams like the above. I have one for each of the most important chords. Ideally I should be able to walk my hand down any path on these diagrams fluently.
Here is a diagram for a minor triad:
You might've noticed, the above is some translation of a 180 degree rotation of the Major diagram, this isn't a coincidence.
You can even define an important group of transforms between major and minor triads, called the PLR group, to be rotations that preserve two notes in the chord. For example, the following illustrates a "Parallel" or P transformation, because the ends are preserved.
Why is a 180 degree rotation, the same as swapping major chords and minor chords?
For the next argument it's convenient to pick C as our origin, and treat each torsor as their free abelian group. To do this, for a given torsor, assign to each of its elements their distance from the chosen origin. Then our layout map becomes a group homomorphism.
In geometry, if a figure is specified by points relative to an origin then a 180 degree rotation is the same as reflecting each point through that origin. Which is the same as taking a negative .
In music theory, if you have a major set of notes taking the negative of each note gives a minor set of notes.
So because a layout is a homomorphism, we have:
So if we rotate a figure by 180 degrees, and then map it into the set of notes, that's the same as multiplying notes of the mapped figure by their negative.
This works for any isomorphic layout. My proof didn't depend on the C-system.
For example in Euler's Tonnetz, Major chords are typically notated red, and minor chords notated blue. The sets of triangles are related by a 180 degree rotation. But even better, the corresponding PLR transformations correspond to edges of triangles; because - in Euler's tonnetz - the edges contains the average of their vertices.
Neo-Riemannian_Tonnetz.svg.png
On the harmonetta three adjacent buttons have either a "valley" indent or a "mountain" protrusion. This helps the player's fingers decide whether the buttons form a Major or minor chord respectively. You can play a triad with one finger, and you can slide to an adjacent triad with one finger. So PLR transformations are easy!
An aside I didn't fully explore but wanted to mention. If you pick a center on the layout, you can define rotations relative to it, and that gives you a bunch of actions on the Torsor. You can also pick various special subsets of the torsor, and see their orbits under the actions you just defined. I suspect this is the formalism I need to model how translating my hand over the keybed transposes a specific chord.
2/3
I use shapes on my C-system accordion to help myself memorize a song. Again if you're familiar with guitars it's like memorizing guitar chord shapes.
I'll exemplify my thinking via the song "Lamento Nordestina" (https://www.youtube.com/watch?v=W17FyxAscNg)
Here is the line corresponding to 2:18 from the video (https://youtu.be/W17FyxAscNg?si=GnBD_qosGCs2HfvA&t=138).
I play the melody of this line by walking a path with my hand on my accordion:
Measure 31:
Lamento Nordestino measure 31.png
Measure 32:
Measure 33:
Lamento Nordestino measure 33.png
Measure 34:
Lamento Nordestino measure 34.png
I might make a diagram because it's easier to understand, even though it isn't convenient to play in the context of the rest of the song, here's another diagram for Measure 31:
Lamento Nordestino pretty measure 31.png
I like this diagram for measure 31, because I easily see that the song plays a minor chord:
but then the song adds a note to underscore the implied L transformation of this chord:
Because two notes are shared this looks like a Pushout!
Relating seperate chords or melodies via some literal, or implied, relationship is a common musical device to convey meaning.
In the measure 32 diagram. We play a magenta G minor, and then walk back over a cyan harmonic minor scale. Again, to me this looks like a pushout.
Measure 33, and 34 spend most of their time in a Dominant chord, with an added note.
Naming the chords, or other music theory structures, that I walk my fingers through - is the most important conceptual step for memorizing a song. If I can't do this, then I have to memorize a long string of individual notes or hand motions.
If the diagrams are subsets of the torsers, then their intersections are the overlap of the pushout. Then the melodies are, at least, free monoids generated by elements in the pushouts, here unions of sets.
With this framing, the distances are in the background, but you could always recover them. For example, given a melody as a free monoid, you can simply find the differences between adjacent elements.
It'd be fun to describe melodies on the accordion as paths in an accordion groupoid - I think of my fingers as traveling in paths on the surface, but I don't know how to do this and I've already written too much.
Some fun asides, here's a diagram for Maj7:
Following a friend's suggestion I'm making an orbifold with it:
Being fussy about this stuff is often the first step for writing programs. Here's a work in progress of a shader for visualizing chord diagrams - at the moment it only displays notes. I'd like to visualize small finger moves as well:
https://www.shadertoy.com/view/43yfDm
3/3
If you read all that, thank you. I'd welcome comments or feedback on how I'm approaching any of the above.
I've only read the first post so far, but I've enjoyed what I've read!
I especially like the mental picture of the notes on a piano as an ascending helix hovering over a "circle" which holds the different kinds of notes. So the "fibre" of notes hovering over "C" is the set of all the C's on the piano, for example. I like the intuition that the "hovering" space can be viewed as a sort of "extended" or "stretched out" version of the base space.
I'm intrigued by the idea that actions on the "base" space in this case can sometimes naturally correspond to actions on the "hovering" space (e.g. "go up two half-steps" can be viewed as specifying a certain movement on our circle of notes, or a way to ascend a bit up our helix of notes).
Thanks for sharing your ideas! (And I'm sure you shared various other interesting ideas in the posts I haven't read yet :sweat_smile:.)
David Egolf said:
..I especially like the mental picture of the notes on a piano as an ascending helix hovering over a "circle" which holds the different kinds of notes. So the "fibre" of notes hovering over "C" is the set of all the C's on the piano, for example. I like the intuition that the "hovering" space can be viewed as a sort of "extended" or "stretched out" version of the base space...
An intuition I'm exploring in connection with this - For the C-System accordion that I talk about in the next part of the post, you can think of the first 3 rows, as a more tightly wound helix. You've already wrapped around the bottom after just 3 moves along the diagonal. So to see the accordion as pulled back from the piano, you could imagine winding the piano loop tighter. I think this intuition is somehow more glib than what I shared in the first post though.
In part 2 I have a diagram for a major chord on the accordion. Diagrams of those sorts could be thought of as preimages of the major chords in .
I think the repeating notes the diagrams are built out of could be viewed as fibers in the sense you mentioned as well.
So this discussion is specifically about the button accordion?
Chromatic button accordions yes
Though I also talk about a harmonica, and the Wicky Hayden layout is typically used for concertinas.
But many common layouts don't use the "isomorphic" property. I am trying to understand my accordion, and I guess while trying to understand it I started to clarify the category of layouts its layout belonged to, which included isomorphic layouts.
Interesting stuff! This is a nice exploration of mathematical music theory.
Mathematically speaking, one thing I think you're doing is considering two different groups, and , and a chosen homomorphism - and then considering torsors for each of these groups, and how they can be related via this homomorphism.
It might be good to make up another word for "isomorphic" when used in phrases like "isomorphic keyboard", because when you're talking to category theorists it becomes very confusing when you say things like "I started to clarify the category of layouts its layout belonged to, which included isomorphic layouts": here "isomorphic" could mean two very different things.
Yeah, I completely agree. In a "pre torsor" version of these notes, a layout was a map . Then the layout being "isomorphic" really meant it was a group homomorphism.
But after the translation to torsors I think I lost track of the right way to say this.
Now you have the opportunity to develop the notion of a map of torsors 'compatible with' a group homomorphism. I.e. given a group homomorphism , and a -torsor , and an -torsor , what does it mean for a map to be 'a map of torsors compatible with' ?
I think I could define this, or learn something interesting by having my attempt fail. But maybe you'd enjoy doing it yourself! This seems like an important math issue.
One of the neat things about applying category theory is how it sometimes forces you to make up new mathematics (or reinvent math that's already known - that's still fun).
Thank you for asking the question, I think I hovered around it - but it was weirdly hard, both to articulate and solve.
I'm going to think about it more, but I think we can say is compatible with when .
Which is a weirdly unsymmetrical expression, but is a commutative square.
That doesn't seem weirdly asymmetrical to me! It seems beautiful and exactly right, if you're using a definition of torsor that only mentions subtraction.
(Does such a definition exist? I forget. Don't you also need to mention the action of on , and the action of on ? Or is that redundant? Anyway, it's easy enough to write down another commutative square involving that.)
I think the way I wrote it is "intuitively" what's going on, so I want it to imply everything else. But I don't know if it does. I need to be very clear about subtraction if I want to use it.
Thinking about the actions directly has been weirdly harder for me. I'm a bit tired right now, so I'll sleep on it. Thank you for the encouragement.
I think you can write down a commutative square that says the action and the action are related by the functions and . The top and bottom of this square are the maps and .
I began sketching a definition of torsor in terms of an action and a 'division' here. But I didn't get too far. This material should be copied into the nLab article [[torsor]], but right now it's in the article [[heap]], which happens to be better developed right now.
(I say 'division' when the group is not necessarily abelian, since then the group operation is called 'multiplication'. You're mainly interested in the abelian case, where people talk about 'subtraction' and 'addition'. It's just an arbitrary change in terminology, but in the nonabelian case you have to be more careful about some formulas, since .)
Okay, it wasn't too bad. I rearranged the notation a bit to make it easier for me to understand.
Let and be groups, and let be a right -set with action , and a right -set with action . I'll notate both actions as "" in the following expressions, but not the commutative diagram.
Then let be a group homomorphism. Then a map is compatible with when, for all and , we have
I'm thinking of the group as abelian, so I'm using instead of multiplication, but the definition doesn't require this.
The above has a nice commutative diagram:
I'm sure there's already terminology for this condition on maps, but I couldn't find it. I think I was confusing this with equivariance.
This specializes to our condition on maps between torsers if I require all the actions to be transitive and free.
Then is defined to be the unique element of such that . But that means if is defined as above, we have which therefore - by the definition of subtraction we just gave - means .
So the compatibility condition I gave in the previous message is implied by this compatibility condition.
Now I can say my accordion's layout is one of these sorts of maps. So is a torsor map, and if is the physical button on the accordion corresponding to , then we write .
Then the c-system's associated group homomorphism is defined so .
So the expression
written slightly more abstractly with the notation I just introduced looks like:
Now I can define a category that my layout belongs to.
An object , is a torsor over a group . An identity on is a pair , where is an identity on and is an identity on the group . An arrow between two objects (over ) and (Over ), is given by a pair , such that you get a commuting diagram over the underlying actions as explained above.
Then given a second pair from to , we can define composition of arrows from to to be . Its corresponding commutative square is just the composition of two commutative squares of the sort described above. This is the only tricky condition, because associativity and identity properties are inherited from the underlying functions.
So these torsor maps form a category. And my accordion layout is "isomorphic", in the sense musicians mean, if it is a morphism in this category. Does this category already have a name?
Alex Kreitzberg said:
Okay, it wasn't too bad. I rearranged the notation a bit to make it easier for me to understand.
Let and be groups, and let be a right -set with action , and a right -set with action . I'll notate both actions as "" in the following expressions, but not the commutative diagram.
Then let be a group homomorphism. Then a map is compatible with when, for all and , we have
All very nice!
Working with a group and not calling it , working with a torsor and not calling it - that would really bother most mathematicians, since we like mnemonic names. I guess you're calling the group just to punish us even more. You forgot to call the torsor . But that's a minor issue. :laughing:
I'm sure there's already terminology for this condition on maps, but I couldn't find it.
I don't know a name for it; you just write the obvious square and demand that it commute!
Sorry :sweat_smile:, was short for "Translations" in my mind, which is overly specific. I debated calling it because I'm thinking of it like vectors, but that's also not great because it isn't really a vector space.
I wanted to use as a shorthand for "homomorphism". But then I confused it with etc.
As I get used to the more abstract definitions and their conventions, then my proofs will probably get more standard. I'll start using multiplication, division, left actions, for groups, for torsors, etc.
I'm surprised this category doesn't have a name. Then I guess I'll call an "isomorphic" layout a "torsor map compatible with a group homomorphism" then?
Is there a different category that torsors typically live in?
I'd call this the category of torsors, as opposed to the category of -torsors for a specific group . (This big category of all torsors for all groups can be built from the categories of -torsors for all specific using the Grothendieck construction, but never mind.)
Okay, for the purposes of this thread, I'll call an "Isomorphic" accordion layout a torsor map then. That's what I was hoping to be able to do.