The last post in the music category dates from almost 3 years ago. And even longer ago I started a not so long-lived series on computational composition using Strasheela. Time to change this situation.

Last week as a programming finger exercise I decided to implement a brute-force first species counterpoint solver in Python, enumerating all legal solutions and then scoring them. The first part is finished now, and can be seen at GitHub.

There are several directions in which I would like to take this little project. First of all it needs to be faster, which might be feasible by multi-threading (something I'd like to try just for getting some experience with multi-threading in Python). Observe that the code certainly hasn't been written with speed in mind, I went for conceptually clear code not some super-fast C-type implementation. Then of course, I want to implement the scoring system. But before that, there are some rules that aren't implemented yet (e.g. hidden fifths and octaves come to mind) and some of the rules have an ugly implementation.

Going to second species will be a significantly harder task: one has to interpret the function of a note correctly.

Feel free to chime in with suggestions! I have discovered a similar project and I should definitely try to implement something like melodypy.com but for now you'll have to look at plaintext and hear the notes in your head.