Updates (16th September, 2021):
While the same general architecture originally presented is still used, most fundamental systems needed a rewrite to allow the system to support notes of differing length (as in, beyond just the First Species of Counterpoint as outlined by Fux.) While unfortunately the changes as of now are not flashy enough to re-record a new presentation, any continued support for this project necessitates these fundamental upgrades.
These changes were done with the intention of supporting a much more varied note generation pattern, and were designed to allow as much customization to selection and generation sequences as needed.
Original Description:
Musical counterpoint generator. Generates harmonization given an input line following a rule set.
Early western classical music composition could be seen as governed by many guidelines or rules. A standard text reference text for these is Gradus ad Parnassum (Fux, Johann Joseph).
Since these rules are well defined, it is possible to write an algorithm that, given a melody line, computes all the harmony lines "permissible" by the rules.
The project would be to construct a program that does this.
Completing the project involves a couple of industry-relevant skills beyond coding:
(1) The ability to read documents from a different domain (music) and figure out what the important content is from a programmer's point of view - going from a user's non-technical requirements to programming.
(2) Designing an extensible architecture so that it would be easy to:
- Interface with relevant libraries with utilities like generating or playing midi files, reading score, etc. Integrating with these would make the end software usable.
- Adding and removing in new rules and heuristics (for example, to modify the style of music generated)
How much experience does your group have? Does the project use anything (art, music, starter kits) you didn't create?
This was produced by students from the CodeDay Labs advanced track, between both of them at least twelve years of development experience.
For the given rules in the project Alfred Mann's translation of The Study of Counterpoint from Johan Joseph Fux's Gradus Ad Parnassum was heavily referenced.
What challenges did you encounter?
As explained in the demonstration video the biggest initial hurdle is that without human interference computers are very bad at making music. Especially since we were working from scratch instead of using a Digital Audio Workstation that's already had countless hours of development put into it, it was hard to figure out exactly what all had to be set up to convince a computer to properly engage with music.
The big issue that came up in development though was at around the halfway point when we were switching from the very simple First Species of Counterpoint (as in: all whole notes, all lined up perfectly) to supporting notes of varying lengths that did not perfectly line up. A lot of early design took too many shortcuts relying on always knowing note length and easily tracking how far into the process we were. If I were to do this project again with this knowledge I would probably have started counting positioning independently of notes from the beginning and just had plug-ins for the generator based on whether we were following the First Species of Counterpoint or the Second or Third.