How Chordcat works – a chord naming algorithm
(blog.s20n.dev)123 points by lapnect 4 days ago | 106 comments
123 points by lapnect 4 days ago | 106 comments
niobe 3 days ago | root | parent | next |
The algorithm makes several false assumptions AND misses some crucial points about harmony that affect chord naming. One of each below:
- Chords are definitely not always built on thirds. Mainly the traditional western sounds are.
- Even more importantly, chords are never named in isolation, they are named with respect to their musical context. An Am7 could more correctly be called a C/A depending on the overall harmonic picture - the melody, the chords before and after and even the emphasis created by the performing musicians. Voicings are basically ignored but could be said to come under this point.
When I teach harmony to students I always point out the key thing to understand is how the harmony is changing, and to look at it dynamically not statically. It's more about the relative motion of notes comprising chords than names although names are obviously a useful construct.
abeppu 3 days ago | root | parent | prev | next |
I agree with you but I wonder if this algorithm could be reworked to be an important part of a system of that considers context.
Roughly, what if we consider x_i the sequence of latent chords, and y_i the observed notes. If we reframe the accidental-based sorting this uses to act like a likelihood function e.g. P(y_i | x_i) ~= 1/exp(# accidentals), then we "only" need a transition function P(x_i | x_i-1) which describes what chords typically follow which preceding chords, and then we have an HMM system for which we can do inference easily. You can also imagine extending the order (number of preceding chords regarded as context), or training some higher order latent state z which might carry information about mood or genre and what chord sequences are appropriate in context e.g. P(y) = P(z_0) \Product P(z_i | x_i-1, z_i-1) P(x_i|z_i) P(y_i|x_i)
epcoa 3 days ago | root | parent | prev | next |
> My hunch is that any algorithm that analyzes chords in isolation (and not in the context of other chords in the song)
You can at least get much further by naming a key (what a key is, is not etched in stone either, but there are some useful enough definitions for most cases). That would be a bare minimum for a useful algorithm though. Especially if your input is just a set of notes.
tolciho 3 days ago | root | parent | next |
And then the key may be unclear, or musicians may differ as to where they feel, say, modulations occur: "it clearly modulates in measure six" "no, measure six is just a borrowed chord and the real modulation is at the cadence in measure eight" etc.
RandomThoughts3 2 days ago | root | parent |
The way music is written has more to do with tradition and legacy systems than being efficient and correct and musicians like to fight about ultimately meaningless things like time signatures.
HelloNurse 3 days ago | root | parent | prev |
Naming a key seems, at the very least, a better way to decide the root note than counting accidentals; but which chords are the preferred, common ones isn't completely clear-cut.
bonzini 3 days ago | root | parent | prev | next |
Sometimes the context even includes the genre. A F/G might be written G9sus4 on a jazz lead sheet or G11 for a pop song. The latter is somewhat incorrect, since the 3rd is pretty important in a G11 voicing.
Without other context I would say that you can probably label G/C as Cmaj9 or even Cadd9, even though the E was not in the original label, but to be sure you do need to check whether the E is indeed okay instead of or in addition to the B.
dhosek 3 days ago | root | parent |
What’s more functionally F[maj7]/G¹ is functionally a G7 chord in that any place you see the one you can substitute the other and the harmonic function remains the same.
⸻
1. This chord and its relatives in other keys is my favorite chord.
bonzini 3 days ago | root | parent |
Kind of since you don't have the B-F tritone. There is a lot more instability, and the resolution to C is a lot stronger, in G7 than in F/G or similar chords.
seanhunter 3 days ago | root | parent | prev | next |
Yes.[1] In particular your point about analyzing chords in isolation is spot on.
In “An Introduction to Musical Analysis”[2], Nicholas Cook says something that I have always considered very profound and applies widely, not just in music, which is
> All notation is analysis
So whenever you write something down in music you are (of course) making some simplifications and you are also doing it for a particular purpose. Usually the purpose is performance. So when you write something you are providing an instruction to the performer.So when you write Cma7 for a jazzer, that’s an instruction that you are generally in the major tonal area and they may well play a Cma9 or a Cma7#11 for example. This is why my functional harmony teacher used to get annoyed by people writing the “Crosstown Traffic”/“Purple Haze” Hendrix chord as E7#9 (which you see a lot). He would say it is E7b10 because that g natural is coming from the minor modes so it’s actually the fourth degree which has been flattened. If you call it a #9 you’re telling players the wrong scale for improvisation (pretty much everyone else in the whole world calls it E7#9 though).
Likewise going back to your point about slash chords, a lot of people learning this stuff get hung up on “what is this slash chord really?” (Eg if I’ve got B/C or whatever what actually is that) whereas when I’ve talked to really serious musicians in that world who play that kind of intense modal music they really are thinking about what the slash chords are in terms of where they come from and what they are leading to. Because that gives a sense for what the underlying tonality is. You can’t get it just from the notes of the chord vertically in that one instant.
If you look at baroque music and earlier, if you just do a vertical chord analysis (eg something like Gesualdo if you really want an extreme example) the chords make absolutely no sense in many cases but that’s because they work in terms of voice leading (ie context) rather than vertical relationships. Analysts used to call that feature “vertical false relations” because they found the vertical chord analysis troubling.
[1] ex-professional musician with a degree and postgrad in jazz, contemporary and popular music here. Wife is a professional musician who teaches at a couple of conservatoires and mostly plays baroque and early music with some 20th and 21st C music thrown in for good measure. Lots of pro musician friends. Not trying to argue purely from authority but I do talk music a lot with people who know a lot, and this topic comes up a lot.
[2] Which stands out as a great book in a field with lots of terrible books btw.
anentropic 3 days ago | root | parent | next |
> This is why my functional harmony teacher used to get annoyed by people writing the “Crosstown Traffic”/“Purple Haze” Hendrix chord as E7#9 (which you see a lot). He would say it is E7b10 because that g natural is coming from the minor modes so it’s actually the fourth degree which has been flattened. If you call it a #9 you’re telling players the wrong scale for improvisation (pretty much everyone else in the whole world calls it E7#9 though).
you mean the third degree I think?
at first I thought your teacher seems overly pedantic here, but it does kinda make sense... I'm surprised I've never heard anyone argue that before!
rerdavies 2 days ago | root | parent | next |
I'm not sure your teacher is right. The notation should be Em7b11.
Ultimately, I think it would depend on whether Hendrix included F or F# in the scales that he used to solo over The Hendrix Chord. If he includes F, E7#9 would be the better notation, since it suggests an altered mode: I, IIdim, IIImi, IVdim(and probably Vdim). (E, F, G, Ab, Bb, C D) . If he includes F#, then you could make a case for E7b10, which I would read as implying a blues scale, although I've never ever seen that notation: I, II, IIImi, IIImaj, IV, V (E, F#, G, G# A B C D). My bet is that Hendrix plays F, not F#, given that he was a jazz musician before he was a rock musician.
The argument for Em7b11 would be that the major third is actually the FOURTH note of an altered scale. . Better still: Em7b9b11. Or I suppose you could be uncontroversial and just write Ealt.
Chords derived from altered scales, and chords based on quartal stacks are both severely broken cases in modern chord notation. Neither seems to have settled chord notations, and the chord notations that do exists vary greatly by dialect.
(Jazz guitarist who very much prefers modern functional chord notation, that implies both scale and chord, to the older Broadway jazz notation style).
seanhunter 18 hours ago | root | parent |
Well he would say it's not functioning as a minor chord it's functioning as a dominant, so any kind of Em is off the table. Also if you call the major third the b11 you are turning one of the notes of the main triad into an extension which he would take issue with too.
But you know, obviously do whatever makes sense to you. As Schonberg says in Harmonielehre, "There are no rules of music, only rules of style".
seanhunter 3 days ago | root | parent | prev | next |
yes. Blame it on lack of sleep.
Also as a sibling to your comment points out it's a blend of major and minor, so also in jazz you'll often see something like E7b9#9b13 written, but that really makes no sense in terms of a scale. The 9th is either flattened or sharpened, can't be both. So the next degree of the scale is the b10, which also makes sense when you think about something like a "diminished" scale which people play over this chord often.
He also used not to like the name diminished for the scale btw, but would refer to it as one of Messiaen's modes of limited transposition. I can't remember Messiaen's nomenclature exactly but the scales which people call the wholetone/semitone diminished and semitone/wholetone diminished are one of his symmetrical system of scales. IIRC there are 3 distinct "diminished" scales and all the other ones are just modes of these three. So you can see that the st/wt diminished starting on D is just a mode of the wt/st diminished starting on C for example.[1]
[1] This is him https://williamkinghorn.org/Biography he was an awesome guy and I learned a lot from him
derriz 3 days ago | root | parent | prev |
Yep! It’s far more logical. This chord blends major and minor so the obvious way to indicate this is by adding a flattened 3rd.
magicalhippo 3 days ago | root | parent | prev | next |
> Because that gives a sense for what the underlying tonality is. You can’t get it just from the notes of the chord vertically in that one instant.
I'm not at all into music theory and such, but your passage just reminded me of what AlphaPhoenix mentioned in his latest video[1], where he analyzed two frames from an experiment, both with a piece of string stretched horizontally across the screen.
They look identical, but they are not. One is a stationary string and the other in an oscillating string which just happens to be flat at that moment in time, but the pieces of the string still carry momentum.
ta2112 3 days ago | root | parent | prev | next |
> He would say it is E7b10 because that g natural is coming from the minor modes so it’s actually the fourth degree which has been flattened.
I'm guessing you mean Emin7b10.
It's in interesting take, but a bit weird considering you wouldn't stack the chord that way. You want to voice the G# below the G, E G# D G, making a major 7 interval which sounds good. If you instead voice it E G D G#, then the G to G# will form a minor 9th which is pretty clashy, generally avoided, and doesn't sound like the Hendrix chord anymore. Try it out, tab (0 7 6 7 8 x) vs (0 7 5 7 9 x). This is a standard jazz voicing rule of thumb, although I forget the name of it.
Sesse__ 3 days ago | root | parent | prev | next |
All of this makes a lot of sense. But to add; a semi-professional piano player I know once gave me a heuristic that can help sometimes, namely “the lowest fifth contributes the most to what the chord feels like”. But you can still get into discussions about whether something is, say, a Dm/F or F6 (and I see a lot of tabs where I disagree which the author's choice).
2 days ago | root | parent | next |
scrozier 3 days ago | root | parent | prev |
(semi-professional piano player here) That's interesting. I've never heard that...not even sure what "lowest fifth" would mean. I would think that the root and the third contribute the most, right? The fifth is sometimes even omitted. I'm very curious how this might work. Do you have any examples?
rerdavies 2 days ago | root | parent | next |
(Semi pro jazz guitarist here). The heuristic I was taught: the accompanist owns the 3rd and the 7th, which allows the SOLOIST to choose #4, 5th or the #5 as the muse dictates in the moment. The 5th is an semi-avoid note, until I hear the soloist commit to a choice of 5th.
Sesse__ 3 days ago | root | parent | prev |
I guess it means in the sound scape as a whole, potentially including multiple instruments. But to keep it to a single piano, e.g. if you play B3 D4 G4, then it won't sound like a B chord (neither minor nor major) because there's no fifth. Instead, you'll hear D5 as an overtone of D4, and G4-D5 will be the lowest fifth that you hear, so it is readily interpreted as G/B. If the third were the most important, then this would have been a Bm, which is pretty clearly isn't unless you add an F# (or there is some other instrument in the mix that provides one).
At least that's how I interpreted him :-)
scrozier a day ago | root | parent |
Allowing that I'm simply not sophisticated enough to understand this, I think he's overthinking things. :-)
I mean, B3 D4 G4 in isolation probably does sound like G/B to western ears, and maybe the overtone explanation is acoustically relevant, but it seems like there are not too many other things that those notes could be, and the spelling clearly spells a Gmaj triad.
madcaptenor 3 days ago | root | parent | prev |
It looks like this book is called "A Guide to Musical Analysis" (or does Cook have more than one such book?)
seanhunter 3 days ago | root | parent |
Maybe. Or my edition is old or something. He does have a few books. “music, imagination and culture “ is also excellent
3 days ago | root | parent | prev |
badlibrarian 3 days ago | prev | next |
"It is also important to know that chords are built on thirds."
Except for the ones built on seconds ("cluster chords"), fourths ("quartal chords"), fifths ("quintal chords"), the chords that make jazz work, and for obsessive/completists, polychords.
andybak 3 days ago | root | parent | next |
I'm going out a limb here and saying "your ears interpret them in terms of their relationship to thirds and everything else is a fiction"
Although:
a) I have only given this a moment's thought and...
b) The term "fiction" here is relative as all music theory is a fiction to some degree.
c) "Ears" here is short hand for a weird mixture of maths, physics, brain structure and learned cultural expectations.
I'm kinda clutching at a valid idea here though - despite the above flakiness.
klodolph 3 days ago | root | parent | next |
“Your ears interpret them in terms of their relationship to thirds”
I don’t really see a basis for this one. I think if we really dig into it, the use of thirds is somewhat arbitrary and has more of a historical basis to it than any other foundations (rather than physical or physiological foundations).
Thirds really do fall apart when you start looking at quartal harmony, tone clusters, and all sorts of modern harmony. Thirds even get stretched to the limit in a lot of very traditional, “safe” harmony. I think on some level, we are just using thirds because of the mathematical coincidences in our systems of harmony.
Cultural explanations are the biggest ones.
schwartzworld 3 days ago | root | parent |
It’s not that arbitrary. A lot of what we define as consonance comes from the harmonic series, the set of overtones you can access by doubling, tripling, etc the frequency of the fundamental tone. If you look at this series, the third is the first interesting interval.
Fundamental - octave - fifth - octave - third - fifth - flat 7
klodolph 3 days ago | root | parent |
The harmonic series really, really does not explain why harmony comes in thirds.
The minor 7 is not in the harmonic series. It’s just not there. This is not a nitpick or a quibble—the minor 7 is just a completely different interval, separate from the just intonation 7:4 interval. To my ears, it is like saying that red and yellow are the same color.
What about augmented or diminished chords? How do they fit into this theory? What about, say, the 9? Why do we put a 9 in a chord, and not a 2? Why do we like the b9? Why do we use a #11?
There’s a million little historical and cultural factors going on here. You can come up with a sort of apologia to explain why thirds make sense, but this doesn’t mean that thirds are in any sense fundamental in some physical or physiological sense.
schwartzworld 3 days ago | root | parent |
If you look at the evolution of how music and harmony progressed in western music, fifths were seen as consonances, then later thirds. Minor 7ths weren’t much of a thing until like the 1400s. Augmented intervals were still not really even used during the baroque.
You can discount the fundamentalness of thirds, but it’s there.
klodolph 3 days ago | root | parent |
That’s a historical, cultural foundation for thirds—exactly the point I am making.
andybak a day ago | root | parent | next |
If you accept a physical basis for fifths (by virtue of the harmonic series) then surely it's not a major leap (no pun intended) from that to thirds?
As you get further along the series you're moving from simple to complex ratios. Thirds are next in line after 4ths/5ths and they have a function that solves some obvious harmonic problems.
A lot of this has echoes in the historical development of music and the commonalities between harmony in different parts of the world. There's a reason cultures independently discover similar constructs i.e. the pentatonic scale
klodolph a day ago | root | parent |
> If you accept a physical basis for fifths (by virtue of the harmonic series) then surely it's not a major leap (no pun intended) from that to thirds?
It’s not a leap to go from the fifth (as an interval, two notes) to the major triad, three notes. However, if you consider major triads, you’re just dipping your toe in the water as far as chords are considered.
The question is not, “Why does the major third above the root appear in chords?” but rather “Why do we build chords out of stacked thirds, which can be minor, major, or even diminished or augmented?” At this point, the part about the major third appearing in the harmonic series lacks explicatory power.
Consider, for example, that a chord “built out of thirds” can contain a major or minor seventh, a minor second, or an augmented fourth. Just as examples.
andybak a day ago | root | parent | next |
> At this point, the part about the major third appearing in the harmonic series lacks explicatory power.
I really don't think it does. Fifths (and their inverted form fourths) are the most consonant interval (ignoring octaves as the trivial case).
Most cultures develop musical processes that involve fifths very early on in their history.
Where do you go from fifths if you want to add another voice? If you have three notes and you want the most consonant result - you put a note that forms a third between the root and the fifth.
Given a few basic assumptions ("prefer simpler integer ratios") there's no better way to play 3 non-octave notes together.
klodolph 12 hours ago | root | parent |
It lacks explicatory power past the triad.
Sure, if you look at major triads only, and ignore extended harmony, it works fine.
But it’s also not that useful if you look only at triads, because there just aren’t that many triads.
schwartzworld a day ago | root | parent | prev |
> Consider, for example, that a chord “built out of thirds” can contain a major or minor seventh, a minor second, or an augmented fourth.
According to modern harmonic rules those are valid. For a long time, these were not harmonies you'd hear in music. Really only since counterpoint fell out of style, since it forbids augmented intervals.
klodolph 12 hours ago | root | parent |
Counterpoint didn’t have “chords” anyway.
pohl 2 days ago | root | parent | prev |
Norman D Cook's work is interesting in this context. This is a great talk, if anyone is curious:
https://www.youtube.com/watch?v=CrmnaiyS5EE
This thread reminded me of the "Conclusions" slide.
rerdavies 2 days ago | root | parent | prev |
That might have been true in the 19th century. (Although Bach, infamously, uses some pretty advanced harmony that stands up very well against modern harmony).
I think you're spot on with learned cultural expectation though. As a musician, you have to learn how to hear quartal harmony and polychord harmony. The sounds and the logic of how things fit together are different from triadic harmonic theory. As an audience, though, I think you're probably so used to quartal harmony and (to a slightly lesser extent) polychord harmony that I don't think you'd find it at all unusual to hear a chord without a third in it.
That particular chunk of harmonic theory was added near the end of the 19th century by composers like Debussy, and subsequently became completely embedded in hollywood movie music, so you are completely culturally used to it. You probably wouldn't even notice that what you're listening to has no 3rd. 19th century audiences weren't so comfortable about it.
The only real problem is that classical music theory gets quite broken when it comes to quartal and polychordal music. No accident, because compositional techniques involving quartal and polychordal music were deliberately designed to get away from classical music theory.
Ylpertnodi 3 days ago | root | parent | prev | next |
Zappa used 2nds a lot, for his improvs. Allows a lot of freedom to both major or minor or both.
badlibrarian 3 days ago | root | parent | next |
I considered sending the first ten seconds of Clair de Lune through this thing to see what nonsense it would spit out. Tech people tinkering in the humanities (and vice versa) is always good for fun.
scrozier 3 days ago | root | parent |
This is one of my favorite categories of HN posts. But hey, if it engenders some interest in ______ (fill in arts category), then it's all good.
pohl 3 days ago | root | parent | prev |
See also the very recent "Symptom Of Life" by Willow Smith, a cluster chord bonanza.
klysm 3 days ago | root | parent | prev | next |
The thing is though you can get to every note by stacking enough thirds - I don’t think it’s a particularly bad perspective
shermantanktop 3 days ago | root | parent |
You can get to every note by stacking enough of literally anything but octaves. Such is the power of the modulus operator.
Thirds appear to me to be pretty much the fundamental particle of western harmony.
wglass 3 days ago | root | parent | prev |
And don’t forget the barbershop 7th!
mjg2 3 days ago | prev | next |
as a programmer and a classically trained pianist, this section:
> For example, the notes C, E and G (The C major chord) can have any of the following names, based on what is considered to be the root note.
> root note chord name
> C C Major
> E E Minor #5
> G G sus4 (13)
> (To the best of my knowledge, I'm no music theorist)
is disqualifying for any usefulness in this program-- it will lead to more misguidance than clarity. without theory, there is no reason.
i would analyze these inversion chords in the frame of the key of C major: CM, C6, and C64 based on Figured Base Notation https://en.wikipedia.org/wiki/Inversion_(music)#Figured_bass
epcoa 3 days ago | root | parent | next |
For what it is worth it’s not wrong to say that the triad where E is the root would be Em#5. The inversions you point out still have the same root (C) even if the bass is different. But I agree you’ve identified the fundamental problem: we cannot infer the root note and, therefore the name (enharmonics aside), from just a set of notes and attempting to is a fool’s errand. Even with a root note, it's going to be difficult many times to have a sensible answer
The key problem with this implementation in addition to not simply taking the root note as input (or a key or scale), appears to be the chord database is pretty spartan, since it doesn't appear it would identify C-E-G as anything other than CMaj. If you want figured bass/slash notation then you'll need to specify that as well (bass note).
A number of chord namers take these as additional inputs.
tunesmith 3 days ago | root | parent | next |
Em #5 would have a B#, not a C. This isn't a pedantic point; it very much matters if we're trying to be accurate with chord naming.
Another example to illustrate how identifying the root is important: C E G A. It's either a C6 or an amin7.
epcoa 3 days ago | root | parent | next |
You're absolutely right about enharmonic equivalents and I could/should have been more precise. However of course the given task of "keys" or pitches -> chords we don't have any information about this, enharmonic equivalents are equivalent. The point is, if the C/B# note (we don't know which one), G and E are given to you and I tell you to root is "E", then the chord could be Em#5. If it really were unambiguously C then it would be a Em♭6(no 5). Point in any case is you need more to go on (at the very least a scale).
I think the point that root and bass should not be conflated is also valid.
shermantanktop 3 days ago | root | parent |
Chords in isolation are an academic exercise. In the context of an overall chord progression, this “enharmonic ambiguity” normally disappears completely, at least for mainstream jazz, pop, rock, folk, most classical, etc. - you know, the music that people who weren’t music majors actually like.
epcoa 3 days ago | root | parent |
Sure, but I certainly haven't been proposing that naming chords based on identifying pitches on a standard keyboard with no other context is suitable, quite the opposite (fool's errand in my original comment). In the confines of the problem statement, it's all enharmonic ambiguity, and that's the point. The Em#5 example was based off the one in the original article, but a much more down to earth one would be F♯ and G♭. Not exactly obscure chords and illustrative of the fundamental issue with this method.
pistoleer 3 days ago | root | parent | prev |
Unpopular opinion: if it walks like a duck and quacks like a duck, then dude, it's a duck.
Inverted chords have, in my ears, never sounded anything like the chords they are supposedly an inversion of. It's like saying "10 is just really 3+7". It's true, and it's also useless. Let 10 be 10. Let 3 be 3. Etc.
Most composers don't even use this system as they compose, it's just for after the fact analysis. Composers hear a tune in their head and then transcribe it. Unless they're writing cookie cutter shit without inspiration, then they might synthesize some soulless crap that intentionally follows some well known chord progression as picked by a dart thrown at a poster of the circle of fifths.
epcoa 3 days ago | root | parent |
You’re saying if the triad E G C is played in a piece in C major it doesn’t sound like a C chord??
Ok. Then what do you call it?
pistoleer 3 days ago | root | parent | next |
E-G is a 3 semitone interval and G-C is 5 semitones so it's an E+3+5 chord. If you wanna play it on piano, that means leave a gap of 2 keys and then a gap of 4 keys.
Known in western classical harmonization theory as "Em+" (E chord with minor third, augmented 5th). C first inv is actually Gsus4add6no5 or as I like to call it G+5+4. It has an incredibly warm and rich tone, nothing like C+4+3 (C major triad).
It works in C because all of its notes are also present in the C major scale, but that's just a coincidence. Calling it a C inverted chord is like making astrological or numerological conclusions.
And no, shifting up or down by octaves is not the same sound. It's close but not equal. You can probably get away with octave substitutions in a busy song but you can not say it sounds exactly the same. A 9th is not a 2nd. 11 not 4, 13 not 6. When you play La Campanella, is that your excuse for skipping those octave jumps? :)
As I said, unpopular opinion :)
tunesmith 2 days ago | root | parent |
It would make jazz lead sheets impossible to read and play. The whole point of a jazz lead sheet is that a chord symbol can be played in a huge variety of different ways depending on how the jam is going. If you followed the chord symbols literally and only played them all in root closed position then depending on the stage you might get a cymbal thrown at you.
pistoleer 2 days ago | root | parent |
I don't understand how this is a relevant criticism of my system.
If you are already ignoring the actual chord "voicing" as written in the "classical" system, then just keep doing that in my system??
If you are already able to intuit that a note should go elsewhere, then keep doing that for your jazz sets? What's the issue again?
"Gsus4x5" is just as unreadable and ignorable and malleable as "G+5+4".
kazinator 3 days ago | root | parent | prev |
You are right, and we can add the observation that the first harmonics of the E and G will form a CEG triad with the C.
kazinator 3 days ago | root | parent | prev |
E-C is simply not a sharp fifth. Sharp fifth is enharmonic with minor sixth. E-C is a major sixth.
shermantanktop 3 days ago | root | parent | next |
Right. This is where math-oriented people get stuck on counting half-steps and forget that the assigned names carry information. E-B# is a different thing from E-C which is different from abominations like E-Dbb.
epcoa 3 days ago | root | parent | prev |
This is off. E-C# is the major sixth. E-C is the minor sixth, which as you say is enharmonic with sharp fifth (E-B#).
kazinator 2 days ago | root | parent |
Yes, how could I gaffe so badly? Inverting a major third gives a minor sixth. Rule of nine, minor-major swap. Elementary school stuff.
recursive 3 days ago | root | parent | prev |
Interesting.
Coming from a cover band/local small-time musician, C6 means C-E-G-A. In other words, C with an added 6 on top.
The charts I play from generally don't have any inversion information on them, and I probably play different inversions each time.
epcoa 3 days ago | root | parent |
This is unfortunately one of the ambiguities in notation. But usually not a problem because it should be quite clear when figured bass is being used.
In jazz/pop notation inversions are indicated with slash chords.
wrs 3 days ago | prev | next |
As people are rightly pointing out, this is only ever going to be a crude heuristic since it has no idea of the context. But in that spirit, I suggest including the distance between the notes as a factor. That would help with slash chords (E2 C4 G4 Bb4 -> C7/E because the E is much lower) and extensions (distinguishing a sus2 from an add9).
xanderlewis 3 days ago | prev | next |
> (To the best of my knowledge, I'm no music theorist)
I know this is considered off-topic, but I’ve refrained a thousand times and now I can’t help it…
Please stop abusing commas! This sentence deserves a semicolon or a dash or a hyphen or a couple of full stops/periods or… anything else! With a comma it’s actually harder to read and is semantically indistinguishable from the sentence ‘I’m no music theorist, to the best of my knowledge’, which is obviously not what is meant.
</unpopular rant>
dahart 3 days ago | root | parent | next |
Hey I’m guilty of going on unpopular nit-picky language rants, but I’ve learned something over the years after doing more historical language research: there are almost no rants about language abuse that are correct, they are almost always incorrect. And this one is incorrect, I’m sorry to say. The first mistake is assuming a comma has a well defined right and wrong usage. It doesn’t. Your favorite pet use of comma is not the only use of a comma. There are lots of valid uses of comma that have overlap with other punctuation marks, and with lack of punctuation marks too.
Language is extremely fluid and is defined by usage and changing over time. It is not defined by style guides or dictionaries or what we think we learned in school. Personally I think it has become far more fun to be a language pedant once I’ve embraced that fact that there’s rarely ever such thing as wrong usage, and started to look for the interesting uses in the past and the in present to think about how things have changed before and how they might change in the future.
Other examples of incorrect rants include how to use the semicolon (lots of ways), whether to use two spaces or one between sentences (either, who cares), whether using literally figuratively is wrong (it’s not), whether using the word really as an emphatic rhetorical question is acceptable (it is), whether the word myriad can be followed by the word of (it can), etc., etc., etc..
Come join the side of enjoying how weird language is and how many different flavors it comes in, and how as long as someone gets their point across, nothing else matters, though some people make really beautiful language and also communicate well while breaking all the “rules”.
xanderlewis 3 days ago | root | parent |
Your whole comment boils down to ‘you should never be allowed to comment on another’s’ language use’. Which is particularly nonsensical, as you also explain how commas have other ‘valid uses’. I thought there were no rules at all! …or are there only rules sanctioned by you?
> as long as someone gets their point across, nothing else matters
This is just classic. It’s the standard boilerplate response to any criticism of bad grammar (which this is, I’m afraid). I’m not foolish enough to believe that there are God-given rules for language, but when the non-conformity adds nothing and simply makes the text more difficult to read it’s worth pointing out.
I mean, seriously, why is a comma better than any of the alternatives here? It isn’t.
dahart 2 days ago | root | parent |
I’m sorry I made you feel defensive. (Though maybe take a moment to consider how the author feels in response to your comments...) I’m not at all saying you can’t comment on language. It is possible to break language rules, this just isn’t one of those cases. I’m saying if you’re going to criticize someone for their language on the basis of perceived language rules, you should either be certain you’re correct about your complaint, or be prepared to receive counter-criticism. In this case, your top comment is factually incorrect, the usage of the comma was not wrong above, according to the rules and usage of commas.
> why is a comma better than any of the alternative here? It isn’t.
Your complaint boils down to the writing has other alternative choices that you would prefer. That’s fine. It’s pure opinion, but you are entitled to your opinion. I’m not arguing the sentence in question is the best way to write it, I’m pushing back on your incorrect claim that it’s wrong. It wasn’t wrong, it wasn’t non-conforming, the usage of comma in the article matches what sources say about comma. Maybe before criticizing or arguing further, take a moment to review what a few sources say about the comma and it’s legitimate uses. [1] For the comma to be wrong, it must break all of the acceptable uses, not just any of them. IMO it’s also worth reading about why language prescriptivism itself is considered bad by many people. [2] Reasons include prescritivism being overly dogmatic, classist, racist, regional preference, and doesn’t adapt with changing language.
It’s fair for you to say it could be better written. It’s not fair to try to justify your opinion by claiming valid language use is breaking language rules.
And my actual point was the part about leaning into descriptivism and away from language policing other people. I have done both, and I’m just saying you’ll probably be happier — I am — if you realize that following prescribed language rules aren’t what makes writing good or bad, and that legitimate usage is broader than you imagine. It’s also helpful when discussing language clarity to take the viewpoint that some of the burden of successful communication is on the receiver, and that when the reader or listener has an open mind and assumes there are multiple interpretations, it becomes easier to choose a good faith interpretation that makes the most sense in context.
[1] https://en.wikipedia.org/wiki/Comma
[2] https://en.wikipedia.org/wiki/Linguistic_prescription#Critic...
xanderlewis 2 days ago | root | parent |
> It’s pure opinion, but you are entitled to your opinion.
Exactly! So I’m not even sure why you commented.
> dogmatic, classist, racist
Oh dear…
dahart a day ago | root | parent |
> I’m not even sure why you commented.
Why did you? Since you asked, I shared my opinion, same as you shared yours. You invited the sharing of opinions. Don’t criticize others if you can’t handle being criticized.
If you agree your comment was pure opinion, that implies you knew all along that the article was not “abusing” the comma per se.
I don’t know what ‘oh dear’ is supposed to mean, but did you read either Wikipedia article? The first one supported the article’s use of comma, and the second one explains my brief summary you quoted. It’s not my opinion, but that of many language experts that policing other people’s use of language necessarily imposes class, race, and region preferences on others. You should probably be aware of that fact when you choose to share your opinion on other people’s writing, especially when your opinion doesn’t seem to be backed up by the encyclopedia article on commas.
PittleyDunkin 3 days ago | root | parent | prev | next |
> or a dash or a hyphen
Em-dashes are typically used for separating clauses. Hyphens and en-dashes are used for hyphenating terms and indicating ranges (among a couple of other uses).
Not that this really matters in practice, but the visual cue is useful for reading rapidly and accurately
xanderlewis 3 days ago | root | parent |
Thank you — I know. I think the usage varies (traditionally, anyway) between British and American English anyway.
My point was that anything other than a comma would be preferable.
thezipcreator 3 days ago | root | parent | prev |
what?
it's perfectly readable to me, I just read any comma as a short pause. When saying that out loud, you would make a short pause. It's read the same whether there's an ellipsis, semicolon, hyphen, or whatever.
Also, no, it isn't semantically indistinguishable from that latter sentence, what? You literally know this, you said that that's "obviously not what is meant". The order of the sentences, and the pause there, is what conveys semantic information, not whether that pause is a comma or not.
xanderlewis 3 days ago | root | parent | next |
> It's read the same whether there's an ellipsis, semicolon, hyphen, or whatever.
So why do you think we have all of those different punctuation marks instead of just one?
I understood what was meant by reading carefully and guessing. If you punctuate more ‘correctly’ (and I’m aware that’s a controversial and triggering suggestion for some), readers don’t have to be careful or guess what you mean — it just flows.
You may think this stuff is surprising because you’ve never noticed it before, but if you look you’ll find that it matters to editors everywhere. If this were to be published, it’d be corrected immediately.
shermantanktop 3 days ago | root | parent | prev |
Yes, there are age-old debates between descriptive and prescriptive grammarians. But in my book, “pause = comma” is a crude and inaccurate tool, and “the commas didn’t stop you from figuring out what I meant” is the lowest possible bar.
dahart 3 days ago | root | parent |
There are active prescriptive English grammarians? How many, relative to descriptivists? Serious question, I honestly don’t know. Maybe I’m biased, but I thought the framing that English language rules are de-facto historically descriptive and not prescriptive was by far the dominant view among language experts. If there are prescriptivists, they seem to be losing, since English has changed a lot. When I try to dig into any language question, whether it’s punctuation history or word etymology or whatever, the answers by professional linguists always seem to be along the lines of, ‘well some people have opinions, but there’s a wide variety of usage throughout history, c’est la vie’.
I don’t know what you mean about a low bar. Is that a bad thing? What do you want to have happen, either here or with commas in general?
Merriam Webster like descriptivism: https://www.merriam-webster.com/grammar/descriptive-vs-presc...
shermantanktop 3 days ago | root | parent |
I’m not a prescriptivist either. Language usage changes over time, and that’s fine. And my personal conventions for usage can be different than yours.
The more interesting (to me) question is whether spoken English and written English share the same conventions. I think it’s abundantly clear that in most languages, they are divergent, to the point that some spoken languages have multiple written forms, each with their own ruleset for handling topics like formality or gender.
So to me, saying “gonna” all day long doesn’t automatically transfer to writing, where most people write “going to.” Same with commas—the written conventions are not, as far as I’m concerned, about mimicking speech pauses. If that rule works for you, great. It doesn’t for me, and I fall back to patterns that are drawn from reading the written word.
For low bar, I didn’t mean to sound like I was taking a dig. What I meant was that a written sentence which isn’t comprehensible isn’t functional. Once you get past functional, there’s a world of expression and nuance that come from different writing styles.
xanderlewis 3 days ago | root | parent |
> And my personal conventions for usage can be different than yours.
I don’t think anyone would disagree with that. But what bothers me (enough to eventually write a comment) is not that others’ conventions differ — it’s that they don't have conventions at all. Words are just strewn all over the page with abandon and anyone who questions it is told to piss off, usually via a long counter-rant laced with moral superiority and mentions of the standard buzzword ‘prescriptivism’. I suspect it’s because it’s deeply insulting and humiliating to be told you’re ignorant about something so seemingly basic, and almost everyone is ignorant when it comes to effective punctuation.
> If that rule works for you, great.
You give people too much credit. It’s not that they’ve tried several styles and eventually landed on this one as a matter of personal taste. They’ve never even noticed the difference.
Again: that there are ‘no formal rules’ for language use does not imply there’s zero value in caring how language is used and trying to keep it consistent and logical.
tiniuclx 3 days ago | prev | next |
Thanks a lot for posting this. I am working on Chord Chart Memo [0] which is a tool for entering and transposing chord charts and this algorithm might come in very handy for naming the chords entered through the application.
What we're doing right now is essentially a hard-coded database of chord names. Every single new chords requires a new entry into this database, which currently makes adding chords with many accidentals impractical. Your approach of tracking the accidentals separately to the database of chords seems very useful and it may allow me to add 'jazz chords' into the app!
ksr 3 days ago | prev | next |
Thanks, I'm curious to try this algorithm. I've been using https://github.com/no-chris/chord-symbol for many years with much success in my own iReal Pro to MusicXML converter https://github.com/infojunkie/ireal-musicxml. The author mentions that their source is "Standardized Chord Symbol Notation: A Uniform System for the Music Profession" by Carl Brandt and Clinton Roemer, published in 1976.
rerdavies 2 days ago | root | parent |
Phew! That wasn't nearly as misguided as I thought it was going to be. It is a mostly decent and sensible guide. And if you're going to do one and only one dialect, a Broadway dialect isn't a terrible choice. I do hope your software has an easy way to override your auto-generated chord symbols though.
seancolsen 3 days ago | prev | next |
I have a similar project which is web-based:
My chord naming algorithm works somewhat like the one described here but is based on an intentionally more limited set of chords which I've carefully curated here:
https://github.com/seancolsen/music-theory-data/blob/master/...
afandian 3 days ago | prev | next |
I built something like this in CLIPS at university. Would easily suit Prolog too. When compared with the bookkeeping needed in this example, it’s a great demo of logic programming’s strengths.
(If only I could find the code)
efortis 3 days ago | prev | next |
For teaching coding to musicians, I wrote a program the other way around.
But it can help you understand how most chords are formed.
https://github.com/ericfortis/web-projects/blob/main/chord-m...
kiaofz 3 days ago | prev | next |
Technically one of the points in the first example with the different ways of describing C E G isn’t quite right. C, while enharmonically equivalent to B#, indicates a different function, and potentially a different tonal center/tonic. This change is tough though because it ~triples the number of note values you can have I think.
bonzini 3 days ago | root | parent |
Also because when you add diminished chords you get lots of double flats (for example C-E♭-G♭-B♭♭ vs C-E♭-F♯-A)
ks2048 3 days ago | prev | next |
This problem is calling out for a real world test set to evaluate the method. I would be surprised if such a dataset doesn’t already exist (eg in the MIR, music information retrieval, community)
epcoa 3 days ago | root | parent |
The problem is not the testing. The problem statement is flawed.
Chord naming is not particularly useful as simply a function mapping a set of undifferentiated notes to a name. The post interestingly gets that the root note is important, but then sort of misses the point in the end. You either have to specify the root, or if the procedure is generating all combinations then one needs to know the implied root in the output (and then this of course leaves the hard bit of identifying what is the correct root to elsewhere). As an example, an input of {A, C, E, G} will spit out C6 and Am7. Which one it is, is the important part. And these are both relatively common chords.
Looking at prior art you will see that chord namers either take something like a key to infer the root, they take the root explicitly, or they treat the notes as an ordered set, some then improperly assume the first element is the root (conflating root and bass). In a GUI that is super misleading.
https://muted.io/chord-identifier/
eg: If you put in E-G-C it identifies as Em#5. Which is a completely false sense of "oneness" and would usually be incorrect. In practice E-G-C played on the keyboard in pop music is more likely a first inversion Cmaj chord, or C/E.
There are better tools out there (https://www.scales-chords.com/), but the example above would be how not to do it. This is not to dunk on it (or the post), but to motivate thinking more about the problem.
In this case the posted algorithm won't identify Em#5, simply because the database doesn't have an those entries. If you scale the algorithm by augmenting the database with more spellings then the output set is going to become larger without being more useful. It will be technically correct, yes that C-E-G might be a Csus4♭4, a C, a Em#5, but what do I do with that.
ks2048 3 days ago | root | parent | next |
I think you're right, and other posts here point out that you need context for this problem. A good dataset of the type I was referring to, would take a score and simply remove the chord labels and try to infer them for the whole piece.
rerdavies 2 days ago | root | parent |
... while inferring from the overall feel of the piece when and where the piece was composed, and what compositional frameworks the composer may be using, so that it can use the correct dialect.
Good chord symbols indicate not only function, but also the composer's intention.
Debussy probably needs different chord symbols from a 1930s Broadway tune, which needs different chord symbols from 1960s jazz leadsheet, which needs different chord symbols for a 21st century jazz composition inspired by Dave Leibman's See "A Chromatic Approach to Jazz Harmony", which is where chord symbols go do die. Seriously. Liebman's chord notation style for quartal chords is influential, if not authoritative.
kazinator 3 days ago | root | parent | prev |
Nope. It's an "Em6 (no 5)".
3 days ago | root | parent | next |
epcoa 3 days ago | root | parent | prev |
♭6 ;-) (E-C is minor 6th)
But I think it should be noted from the context of that comment (and the original article) that the names are necessarily ambiguous. So the names E-G-C (or whatever set you choose, how about F#, A#, C#) are pitch positions and don't disambiguate between enharmonic equivalents, eg in isolation we have no reason to prefer F# over Gb. Which is the problem.
kazinator 3 days ago | root | parent |
You picked a good example because by key signature circle-of-fifths distance from C major, the choices are equidistant.
Gb-Bb-Db can be obtained in the key of Db: Bb, Eb, Ab, Db, Gb. It is that key's subdominant.
F#-A#-C# is in the key of B: F#, C#, G#, D#, A#, and is that key's dominant.
Five sharps or five flats. Same distance from C major.
thezipcreator 3 days ago | prev | next |
I think it'd be interesting to extend this to Xenharmonic (aka Microtonal) chords. I think it would break down pretty quickly though, considering diatonic usually doesn't exist (altho you could use some MOS scale as a replacement)
ysofunny 3 days ago | prev |
way tangential
but why, oh why, does 12 but not 12*1 nor 6+6, not even 5+7 but precisely as 2+2+1+2+2+2+1=12 is so important for music !?
how can we make a general object that describes such a "folded" structure?
this strtucture arises naturally from repeating 3^1 all the way to 3^12 and inserting the appropriate 2^n (where n is negative integer) to keep all between 1 and 2 (or 2 and 4)
is 2212221 a group?
if we stop at 3^7 instead of going all the way to 12 we have a diatonic major, if we stop after 5 iterations of multiplying 3*3 it's a pentatonic.
wrs 3 days ago | root | parent | next |
It’s only so important for “Western” music. Other musical traditions/cultures (including some from the “West”) find other scale patterns more important. Or they don’t even use the 12-tone division of the octave that this is working within.
mrob 3 days ago | root | parent | prev | next |
Because that pattern forms a scale that allows for playing several intervals such that the harmonics line up nicely, so that they're either very similar or very distinct, but not annoyingly almost similar. William Sethares has a good overview here:
https://sethares.engr.wisc.edu/consemi.html
Note how figure 3 shows dissonance minima close to degrees 3, 4, 5, and 6 of the major scale when played against degree 1. Although there are many other possible combinations of notes, combinations with degree 1 are very important because degree 1 provides a kind of "home" that the music often returns to (the "tonic"). But the goal isn't just to maximize consonance, so these notes alone would make for a boring scale. For better musical value, we need some more dissonant intervals to build tension before it can be resolved with the consonant intervals. The obvious place to put them is in the big gaps. Putting degree 2 a single semitone above degree 1 is probably overdoing the dissonance a bit, but putting it two semitones higher gives a useful mild dissonance. Considering only combinations with degree 1, degree 7 could theoretically also go a single semitone above degree 6, which gives the mixolydian scale, but the major scale is more popular. I assume this is because of combinations that don't involve degree 1.
ysofunny 3 days ago | root | parent |
I know his work well, I must rephrase my question
he answers why it works well, but I don't think he really addresses why the "folding" pattern (as I called it) arises
I'm also looking at Erv Wilson's work (in the book by Nakamura) and he gets closer to addressing what I'm focusing on.
Phrodo_00 3 days ago | root | parent | prev |
It's pretty much historical, and initially based on the tastes of medieval priests doing Gregorian chant. It started with the handful of intervals they would use and more intervals were added as needed when music grew more complex until we got to similar-ish 12 intervals, which were then actually equally spaced later.
kazinator 3 days ago | root | parent |
There is something to the 12 intervals. Indian music theory nails it.
Indian music theory identifies an octave 7 notes, which are modified further to make 12. Beyond these 12 some of them have finer divisions that map onto an underlying 22 tone system.
This diagram summarizes it:
https://22shruti.com/wp-content/uploads/2023/03/revised-evol...
Notice something peculiar. The P note which corresponds to perfect fifth in western theory, is the same through those layers. It does not split into multiple fine or grain pitches.
Those pitches that we would identify as flat fifths are related to M, not P. And in fact, jazz theorists take a similar view: that in many contexts flat fifths are actually augmented fourths, related to the Lydian.
To make a 7 note scale, you would need an M. In the 12 tone layer, there are two flavors of it: M and m. Something analogous to your perfect fourth and augmented fourth. Then each of these has one of two possible representations in the 22-tone layer. The P is always just P.
parpfish 3 days ago | next |
I don’t think that this algorithm can handle slash chords like G/C (G over C) and would instead label it as Gsus4. The former gives a lot of important context to voicing which can by important if you need a particular sort of motion in the bass line.
My hunch is that any algorithm that analyzes chords in isolation (and not in the context of other chords in the song) is going to miss out on overall readability. Good chord notation has a sort of elegance that can highlight the similarities/differences between sequential chords that can make things very intuitive for the musician