PHILOMENA is a program designed to part write against a bassline based on an arbitrary set of rules. It contains a small declarative language for describing acceptable part writing rules, and can be used to generate both classical harmonic progressions and more unconventional harmonizations.
PHILOMENA’s primary purpose is, naturally, to do my music homework for me, but when it is finished it should be an extremely powerful tool for describing and realizing the full scope of possible four-part harmonies.
Brute force.
More descriptively, PHILOMENA takes as input a file describing a bassline and another containing part-writing rules, and then iterates through all possible configurations of voices until it finds one matching the rules. In order to introduce variety into pieces and aid in finding more difficult solutions, there is an added 50% probability that any given chord will be rejected (this number is currently a fixed constant in the code, but will be adjustable from the rule file in future versions). If no solution is found, PHILOMENA will return to the beginning and try again. As such, the program is Ω(n) for both the length of the bassline and the number of rules. As a result of the random factor, the program is technically not guaranteed to terminate; in practice, I can usually find a solution with the root-position, major rule set in a few seconds.
The program outputs to a LilyPond file that can be used to produce a PDF or midi.
All notes are given an absolute scale degree such that the lowest Do is 0, Dis is 1, Re is 2 and 12 represents an octave above the lowest Do. A bassline file (.pmb) is just a series of these notes separated by spaces. PHILOMENA doesn’t currently support notes of different durations, though this is easily changed by editing the .ly file produced as output.
A sample bassline:
0 4 5 7 9 5 2 7 0
Major root-position triads:
* ^0,5,7 +4 +7 +12
(if the bass has Do, Fa or So add a M3 in the tenor, a P5 in the alto and a P8 in the soprano.
* ^2,4,9 +3 +7 +12
(if the bass has Re, Mi or La add a m3 in the tenor, a P5 in the alto and a P8 in the soprano)
* ^11 +3 +6 +12
(if the bass has Ti add a m3 in the tenor, a °5 in the alto and a P8 in the soprano)
Forbidding parallel fifths:
~ ^? +7 ? ? : ^? +7 ? ?
~ ^? ? +7 ? : ^? ? +7 ?
~ ^? ? ? +7 : ^? ? ? +7
~ ? ^? +7 ? : ? ^? +7 ?
~ ? ^? ? +7 : ? ^? ? +7
~ ? ? ^? +7 : ? ? ^? +7
Forcing the leading tone to resolve up in the soprano:
~ ? ? ? 11,23,35 : ? ? ? >'1
~ ? ? ? 11,23,35 : ? ? ? <.0
(Forbid the soprano from moving to any note that is more than a semitone greater or any lower note)
PHILOMENA is still in development and I greatly appreciate feedback. Please send your suggestions to jqubit [at] gmail [dot] com.
Christine
on Saturday 22 December, 2007 at 5:53:32 am
O___O …and you thought you weren’t going to get into columbia?