-
Notifications
You must be signed in to change notification settings - Fork 5
Home
FourVoices is software that combines artificial intelligence and music theory to automatically generate music.
Specifically, FourVoices generates music for four voices -- soprano, alto, tenor, and bass -- that follows a chord progression given by the user. In particular, the automatically generated music is guaranteed to obey the rules of four-part writing.
Because FourVoices follows the rules of four-part writing, the generated music often sounds pleasing with no guidance from the user. With additional hints from the user, it is easy to guide FourVoices to generate good music.
FourVoices is primarily geared towards people that are either already experienced in four-part writing, or are currently learning four-part writing. More generally, anybody with an avid interest in music and four-part writing would enjoy FourVoices.
I originally envisioned FourVoices to be a useful tool for students learning music theory and four-part writing. For those unaware, music theory courses have a four-part ("chorale") writing component where students are expected to learn the rules of four-part writing. This includes being able to compose ("realize") four-part pieces that follow the four-part writing style, eg avoiding parallel fifths, correct resolution of certain chord tones, etc.
Check out the Quick Start here: Quick Start
Internally, FourVoices solves the task of four-part writing by first transforming four-part writing into a series of mathematical equations. Once we solve the equations, we transform the mathematical solutions back into musical notes, which end up being harmonically-correct four-part compositions.
In the mathematical equations, the variables are the notes that each singer sings for each chord. For example, if there are 3 chords, then there will be 3*4 = 12 variables (there are four singers: soprano, alto, tenor, and bass).
The equations (aka "constraints") are a mathematical encoding of the rules of four-part writing. For instance, I define sets of equations that disallow parallel fifths and overlapping voices, enforce singer ranges, etc.
Once I have defined the constraints and the variables, I use a general-purpose Constraint Satisfaction Problem library to find variable values that satisfy the constraints. These satisfying variable values are then transformed back into musical notes and displayed to the user.
Aside: Constraint satisfaction problem solvers scale poorly (exponentially) as the number of variables/equations grows. Fortunately, the constraints in four-part writing have a very neat property: each constraint only considers notes from the current chord to the next chord. In the AI jargon, this is known as a tree-structured problem, which can be efficiently solved using a separate algorithm. FourVoices currently uses a general-purpose constraint solver, which seems to be sufficient for typical problem sizes.
Eric Kim: eric.kim.cs@gmail.com