Hooktheory is a website with several features. Its core is a database of transcribed pop songs, and built on top of this is a "Trends" tool. You click on a chord that you want to start with, and the graphic will update to show how likely each possible next chord is, according to its database. The idea is that if someone who doesn't understand chord progressions wants to try to write a pop song, they (I) can try clicking on some chords and come up with a "safe" progression that won't sound weird. (Alternatively, you could click on a rarely-used progression, and listen to the songs which use it.) All progressions are stored in relative notation, but can be displayed in any key.
Missing is the ability to work backwards, and I plug this gap below. Say I don't want a four-chords song, and instead I want to go out of key somehow. I read the other day about secondary dominants: a subprogression might go V/vi --> vi. e.g., when playing in C major, you have an E major chord followed by an A minor chord. But how do we get to that E major, when we're playing in C?
To answer this, I scraped some next-chord probability data from Hooktheory's API, as well as "overall probability" numbers, and calculated approximate previous-chord probabilities. The API currently only returns overall probabilities for the 28 most common chords (sevenths and inversions are all treated separately), and to simplify my task I only calculated previous-chord probabilities for these 28 chords. This shouldn't be much of a problem for commonly-used chords, but there are some pretty obscure chords in the database, and so I wouldn't trust the numbers in all cases – the probabilities will always sum to 100%, but they might be ignoring some chord changes.
There are some '??'s in the list of chords in the dropdown menu below. My guess is that these were supposed to be degree symbols (i.e. for diminished chords), but usually the API did return a degree symbol when appropriate, so I'm not sure. Also there are some chords with the same text that are only differentiated by the internal chord_ID field, and I have no idea what these mean. I have sometimes indicated these with the letter used in the chord_ID (b, C, D, L, M).
If I scroll down to the V/vi entry, I see that I have quite a bit of freedom in getting to my E major chord. Most common (29%) is F --> E, then 20% for C --> E, 15% for Dm --> E, 15% for Am --> E, 9% for G --> E, and small probabilities for other chords (some of these numbers would be a bit higher if I put all the inversions and sevenths in together).
I'm not getting too ambitious yet – here I am playing a six-second long piece with chord progression C G E Am F (I wrote this before discovering the Hooktheory API, but it's too short to warrant a separate page and it fits in here):
R code follows.
Recorded 2014-11-30; written and posted 2014-12-07.