Twelve years ago the occasional BMInt writer Nathaniel Eiseman implemented an “Algorithmic Approach to Melodic Harmonization” as an honors thesis to satisfy requirements of the Tulane music and mathematics departments. Wondering if he could combine mathematics and music in a relatively accessible and potentially useful way, he proved that by using the tenets of probabilistic inference and codified domain knowledge he could automate the harmonizing of melodies in the style of a four-part chorale characteristic of the German Baroque. Will readers tell us how AI, Chat GPT and so forth have advanced the field after reading the complete paper HERE and playing the examples? Some excerpts from his paper follow. (FLE)
The ultimate purpose of this thesis is to design an algorithmic framework that allows a computer to do exactly what Bach did: with nothing but a melodic line as input, provide the alto, tenor, and bass voices. This automatic harmonization process is based upon two procedurally distinct subroutines. First, harmonies are selected probabilistically based on a variety of contextual factors including each melodic pitch’s position within its phrase and the notes and harmonies preceding it. The alto, tenor, and bass are then deterministically assigned pitches based on the selected harmony, such that rule violations are minimized.
Given a sequence of melodic pitches, the system developed herein supplies the three other voices of the chorale in a way that produces aurally pleasing harmonic progressions and satisfies the rules of four-part writing. This is accomplished by the interface between a probabilistic process that selects the harmonies for these progressions based on data obtained from the chorale harmonizations by Johann Sebastian Bach and a deterministic process that voices a sequence of four-part chords given melodic pitch and information about the harmonic progression specified by the first process. … Undoubtedly, computers are capable of generating chorale harmonizations that are semantically correct. The question is whether, if supervised by the rules of counterpoint and instructed by analysis of Bach’s harmonic language, they can satisfactory resolve the defective spots. The ultimate question is whether computer harmonization can sound good.
The example below compares Bach’s harmonizations with my algorithmic results.



This project was undertaken 12 years ago and is to be lauded. What students and I learned all these years later is how much time is required to reach popular goals of songwriting using AI: melody, harmony, rhythm, lyrics, instruments, genre/style, video, and perhaps more all working off prompts. As with traditional tools (piano, violin, flute), these new tools also take time to learn. Time becomes a significant consideration in deciding what avenue to take.
Comment by David Patterson — January 20, 2025 at 2:52 pm
The most important element is missing here: the individual lines of the Bach example come before any question of the harmony. Bach is particularly great at writing dissonant (expressive) melodic lines that are exceptionally difficult to imitate. Here the computer program is only doing what a beginning music student would do, that is, focus on the harmony at the expense of the melodic design.
Comment by Larry Thomas Bell — January 20, 2025 at 11:37 am