Wednesday, May 29, 2013

Fux Capacitor

We began looking at counterpoint in my music course. It turns out there are five different "species" of counterpoint first classified by Johann Joseph Fux in his Gradus ad Parnassum, which is available for free on the IMSLP web site. Unfortunately nobody thought to translate it from the original Latin into English yet. There are English translations but not free ones. All the bigs used Gradus ad Parnassum - Mozart, Haydn, Beethoven, Bach.

Somebody needs to write a five-species-enabled counterpoint generator and call it the Fux Capacitor. Because hey why not?

(Although technically Fux is pronounced "fooks" not "fucks" which kind of ruins the gag, but only if you pronounce it like a German. And if you ain't German... )

So while reviewing the rules of counterpoint it occurred to me that there must be a computer-based counterpoint generator out there. And there are - but not free ones. That I've found. Yet. (I did find one for $5)

Automated music has been around for a long time. According to this paper:
...the computer to aid a composer or even generate an original score. The idea of automatic music generation is not new, and one of the earliest “automatic composition” methods is due to Mozart. In his Musikalisches Wurfelspiel (Musical Dice Game), a number of small musical fragments are combined by chance to generate a Minuet.
But according to Wikipedia Musikalisches W├╝rfelspiel :
The earliest example is Johann Philipp Kirnberger's Der allezeit fertige Menuetten- und Polonaisencomponist (German for "The Ever-Ready Minuet and Polonaise Composer") 1757...
Mozart was born in 1756. Not even he was prodigy enough to be fairly described as responsible for "one of the earliest" and in fact Wiki points out that although a version of Musikalisches Wurfelspiel was attributed to Mozart there's no direct evidence.

But counterpoint lends itself directly to computer programming because of the series of explicit rules developed for it:

  1. Begin and end on either the unison, octave, or fifth, unless the added part is underneath, in which case begin and end only on unison or octave.
  2. Use no unisons except at the beginning or end.
  3. Avoid parallel fifths or octaves between any two parts; and avoid "hidden" parallel fifths or octaves: that is, movement by similar motion to a perfect fifth or octave, unless one part (sometimes restricted to the higher of the parts) moves by step.
  4. Avoid moving in parallel fourths. (In practice Palestrina and others frequently allowed themselves such progressions, especially if they do not involve the lowest of the parts.)
  5. Avoid moving in parallel thirds or sixths for very long.
  6. Attempt to keep any two adjacent parts within a tenth of each other, unless an exceptionally pleasing line can be written by moving outside of that range.
  7. Avoid having any two parts move in the same direction by skip.
  8. Attempt to have as much contrary motion as possible.
  9. Avoid dissonant intervals between any two parts: major or minor 2nd, major or minor 7th, any augmented or diminished interval, and perfect fourth (in many contexts).