Analyzing iReal Chord Changes
June 14, 2020
Now that we have a huge dataset of chord changes, we can do some data mining on it.
Metadata Rankings
As a warmup, let's do a ranking of metadata values. Here are some rankings for the 1350 Jazz Standards set, (but you can paste any url from the forum).
top composer ranking
show relevant code
export function countUnique(values) {
return values
.filter((c, i, a) => a.indexOf(c) === i) // filter out duplicates
.map((value) => ({
// count items that have the value
value,
count: values.filter((v) => v === value).length,
}));
}
export function topValues(songs, property) {
return countUnique(songs.map((song) => song[property]))
.sort((a, b) => b.count - a.count) // sort by count
.slice(0, 20); // only use top 20
}
Most Common Chords
To find out which chords are the most common, we can
- collect all chords of all songs
- count the occurrence of each chord, either relative (without root) or absolute (with root)
- calculate the "regularity" with count/totalChords
- for each song, we can then calculate the average regularity of all chords to know how common it is in general
- you can click chords to show only songs who include the selected chords
regularitysorted descending | title | composer | key | style |
---|
Interpretation
And the gold medal for the most boring chords goes to... "Sunshine of your Love by Cream" (that does not mean the song is bad in general).
The songs at the top of the list are the ones that contain only the most common chords. If you learn one of those, you will automatically learn many other songs too. The songs at the bottom of the list contain only exotic, unusual chords, so learning one of those will not be as effective.
Note that this is still a little bit too specific, for example the algorithm treats -9 chords different from -7 chords, but in (jazz) practice, you will mostly play -9 anyway. The accuracy could be improved by adding a layer of abstraction that groups together chords that are more or less interchangeable.
Most Common Chord Transitions
We can find out the most common chord transitions by looking at each single transition between two chords. Essentially, a chord transition consists of:
- from symbol to symbol
- interval (relative) or from root to root (absolute)
So if we map each transition to a string of the format:
`${from.symbol}.${to.symbol}.${interval}`;
... and then count all unique values, we can find out which chord progressions are the most used. Let's try it out with the pop 400 playlist:
regularitysorted descending | title | composer | key | style |
---|
show relevant code
function getChord(_chord) {
const [chord, bass] = (_chord || '').split('/');
const symbol = chord.replace(/[A-G][b#]*/g, '');
return {
root: chord.replace(symbol, ''),
symbol: symbol || 'M',
bass,
};
}
function getTransitions(songs, relative = true, semitones = false) {
let changes = [];
songs.forEach((song) => {
const transitions = song.music.measures
.flat() // flatten measures as we don't care about rhythm
.map((chord, index, chords) => {
const [from, to] = [chord || '0', chords[(index + 1) % chords.length] || '0'].map((c) => getChord(c)); // parse chords
if (relative) {
// relative does only care for interval
let interval = Interval.distance(from.root, to.root);
if (semitones) {
// don't care about enharmonic equivalent intervals
interval = Interval.semitones(interval) + '';
}
return `${from.symbol}.${to.symbol}.${interval}`; // format to id string
}
return `${from.root}.${from.symbol}.${to.root}.${to.symbol}`;
});
changes = changes.concat(transitions); // concat song transitions
});
changes = changes.filter((change) => {
// filter changes where nothing changes..
const [fromSymbol, toSymbol, interval] = change.split('.');
return fromSymbol !== toSymbol || interval !== '1P';
});
// count unique and sort by count
return countUnique(changes).sort((a, b) => b.count - a.count);
}
Note that we are running the script on the music.measures which are not 100% correct for all tunes (see last post), but it should be accurate enough to find out the most common chord progressions.
Interpretation
And the gold medal for the most boring chords goes to: Massachusetts by the Bee Gees.
Most of this is no surprise, but let's try to describe the most common transitions for two big pop and jazz playlists:
M.M.5P I to V triads
M.M.4P I to IV triads
7.M.4P V7 to I
M.M.2M IV to V with triads
M.-.2M V to VI-
M.M.7m I to bVII in mixolydian
-.M.7m I- to bVII
M.7.2M IV to V7 in major
-7.-7.4P I- to IV- or III- to VI-
M.-.6M I to VI-
-.M.6M I to VI-
-7.7.4P II-7 V7
7.-.4P V7 to I-
sus.M.1P suspended I
-7.7.4P II- V
7.^7.4P V7 I^7, V/IV^7
7.7.4P dominant in fourths
7.-7.4P V/II-7, V/III-7, V/VI-7
7.6.4P V7 I6
-7.-7.4P I- IV-, III- VI-, VI- II-
7.-7.5P V7 II- ?!
7.-7.1P V/V7 II-7
^7.-7.6M I^7 VI-7
^7.-7.2M I^7 II-7
h7.7b9.4P II-7b5 V7b9
7b9.-7.4P V7b9 I-7
7.7.7M chromatic dominant
7.-7.6M V7 III-7
Note that those transitions could also describe other degree transitions, but I just picked the most common ones (which should make up the greatest part).
If you sat down at a piano and just learned the top 10 of each, you would be able to learn many songs really quickly..
Chord Diversity
Another song feature that is interesting to determine how difficult it is to learn is chord diversity.
uniqueChordssorted ascending | title | composer | key | style |
---|
Most Difficult Songs
What makes a song's changes difficult? I would say:
- uncommon chords
- uncommon chord transitions
- high diversity
and of course, the opposite is true for the easiest songs..
Next Steps
- Find good tune learning path by including all the features
- Generate Markov Models for chord transitions to generate authentic chord progressions