Example 1 • Example 2 • Example 3
AutoHarmony is a tool that lets you procedurally compose chorales, using dynamic programming and common-practice voice leading conventions. It's built on Music21.
The main input to the program is the chord progression.
This should be given in one or more lines, each of the format
KEY: CHORD1 CHORD2 CHORD3...
, where the key is the
name of some
key signature
(for example: B-
for B-flat major, or
f#
for F-sharp minor). Each chord is expressed using
Roman numeral notation, like I
, V
, V43
,
viio7
, or bII6
. This determines the
notes and the inversion.
For example, here is a short 8-note chord progression based in B-flat major.
B-: I I6 IV V43/ii ii V V7 I
You can also write longer chord progressions, such as the following chorale that starts in D major, but then modulates to A major, B minor, and then back to A major and D major.
D: I vi I6 IV I64 V I
D: I6 V64 I IV6 V I6 V
D: I IV6 I6 IV I64 V7 vi
D: I6 V43 I I6 ii65 V I
A: I IV64 I vi ii6 V7 I
b: iv6 i64 iv iio6 i64 V7 i
A: IV IV V I6 ii V65 I
D: IV6 I V65 I ii65 V7 I
Note that longer chorales will take more time to generate. This is an expensive operation. If many people are using the site at once, the server may slow down.
You can also specify the
time signature and rhythm when generating a
chorale. Time signature is specified in the usual notation
N/M
, while rhythm is specified as a space-separated
list of the lengths of each chord, in units of quarter notes.
For example, a rhythm of 1/2 1 1/2 2
corresponds to:
an eighth note, a quarter note, an eighth note, and a half note.
You can also encode more advanced rhythms; a hemiola is
represented by 2/3 2/3 2/3
.
Have fun playing with the chorale generator! I hope you find it useful and/or inspiring. There are links to pre-generated examples available at the top of the page. If you're curious about how this all works, feel free to check out the open-source code.