ProgramNamedAsclepius
Asclepius
Alrighty, so I've been a'workin' for the last month and a half to 2 months on a bit of software that implements the species method of counterpoint layed out in Arnold Schoenberg's book Preliminary Exercise in Counterpoint. I have dubbed it Asclepius, inspired by the characteristically cranky witticism he placed in the book's appendix:
"To base the teaching of counterpoint on Palestrina is as stupid as to base the teaching of medicine on Aesculapius."
As this is the Latin rendering of the name, I, rather, took the Greek.
I have only progressed in this book to the extent of the first species in 2 voices (Though I have done so in a manner new to programming the task); This, however, is also where most of recent literature on the topic stops:
(insert bibliography of those writings here; Ovans, Schottstaedt, Cope, my good friend Ewing, etc)
The overwhelming trend is to base this work on The method of Fux, called the Gradus ad Parnassum. This, in turn, purports to be based on the music of Palestrina (though, as Ewing points out, this claim is problematic). I, by contrast, have elected to use Schoenberg's text as my guide. The main reason for this decision was Schoenberg's tendency toward Systematicism. My judgement was that his method was both stylistically more neutral than Kennan or Merritt or Jeppesen or Fux and more formal and explicit as well. While this may be true, I have had to grapple much more than expected with precisely the opposite -- that is, its true informality. Much will be written of this in the future.
For now, here's the SourceOfAsclepius. It was developed with Racket, a steroid-enhanced dialect of Scheme. This dialect is not so different from Scheme itself that it takes much effort to port it to some other implementation; I have ported it back and forth from and to GNU Guile a couple of times, for example. The code functions; it successfully writes 2 voice, first species counterpoint of any reasonable length, generating both a well-formed Cantus Firmus and a Counterpoint from scratch (This, already, is atypical of counterpoint programs, as most generate a counterpoint only to a user-supplied cantus firmus (though Asclepius can do this too)). That said, the code has some glaring issues, all of which I am either currently working on or plan to work on. Not least of these is that the code is not a fully developed top-level program; the interface is not defined, one must get into some minimal scheme just to use the code. Another issue is that the code is a monolith. Another is that more than one level of procedure contains multiple instances of very similar procedures, which could be encapsulated and abstracted so that, as Gerald Sussman would put it, the "guts of the program aren't hanging out all over the place". There are a number of other issues, which I'll enumerate here at some point. There's also the fact that it isn't done; the idea is to eventually implement Schoenberg's whole book, cover to cover. This would have practical benefit, which I'll also talk about here at some point.
But let's turn away from some of the things I'm embarrassed about to some of the things I'm proud of. I like how that conversation feels more. As I said, the code works. Also noteworthy:
- Many constraints for Schoenbergian well-formed melodic motion
- A tiering system for these constraints, to cover Schoenbergian "emergencies"
- A bactracking algorithm for successful constraint space search and solution
- A system for conversion from internal Asclepius notation to GNU Lilypond code
I don't think that's half bad for a couple months into a first big Scheme project. I definitely understand species counterpoint (at least of this kind) in a whole new and deeper way, and I definitely understand Schoenberg's method for it in and extremely explicit sort of way. Much more to be said with that.
But, for now, sleep calls, then more teaching computers to compose.