Platonic Music Engine logo

Pythagoras release

I'm very proud to announce the next official release of the Platonic Music Engine: Pythagoras

It has been a very long time in coming but it is worth it. I'll outline below some of the new features.

Csound

I mentioned in the first annual report that I was sticking with MIDI for the underlying audio technology in spite of the fact that it has serious limitations when compared to options like Csound. I said that while leaving open the option that I still might change over some day. Well that day arrived. I have abandoned MIDI and now use Csound for the underlying audio technology.

The nice thing is that I had just gotten MIDI all figured out re: the MIDI Tuning Standard and was using it to its full capabilities. I had MIDI stretched to its limit but it worked and was seemingly capable enough.

But on that same day I also figured out Csound and saw what an amazing piece of technology it is. Here's a brief comparison:

MIDI maximum EDO: 196608. Csound maximum EDO: approx 11 quadrillion.

MIDI max polyphony: 2048 (theoretical, probably less in practice). Csound max polyphony: approx infinite (especially if you compile it).

Need I go on?

Plus it turns out that you can load MIDI soundfont files in Csound and manipulate them using audio frequencies. Directly. Ie, not through some crazy math that I'll never understand as is the case with MIDI.

And calculating durations in Csound is a breeze. The relationship between tempo and beat makes perfect sense as it should to musicians. Again, contrast that with MIDI and its ticks, bpm, ticks per beat, minutes per beats, ticks per tick, etc, whatever.

But the coolest thing is that Csound generates music from a text file and not a binary file (as MIDI does). This makes it so much easier to debug the file as you are just editing an easily read text file. The process of tweaking the PME’s MIDI output was far more involved as you had to compile the MIDI file every single time. With Csound you can just keep editing the Csound till it works and then program that back into the PME.

So I switched to Csound. Obviously that meant rewriting significant chunks of code. But mainly it meant adapting the code to all the new power and flexibility we have access to.

There's a very good chance that we’re going to add the ability to import Scala tunings. Already we can handle around 99.3% of them but that last .7% creates some problems.

tuning

This entire section of code was rewritten from scratch. The process for generating tunings is far better now. Not as many bandaid hack work-arounds. I mean there are still an annoying few but the code is actually maintainable now. You can generate pretty much any n-EDO where 0<n<30,000,000 (or higher but it really slows down after that) including fractional values.

A cool feature here is that you are no longer restricted to generating just equal divisions of the octave but can generate equal divisions for any of the standard twelve scale degrees based on Just Intonation tuning (perfect fifth, minor third, etc).

And the entire format allows for more flexibility now as you can combine cents and decimal representations (including mathematical expressions) in the same tuning.

generate ideal scale degrees

As mentioned in the previous report, I had implemented, crudely, the process of generating scale degrees which allows us to define scales in terms of scale degrees (instead of a specific number of steps) providing a tremendous amount of flexibility. Now your C-major scale will work with any tuning at all. Even Harry Partch's 43 Tone system. Even 0-EDO.

This also means that when we want to emphasize scale degrees we can and again, the same names (M3 (major third), m7 (minor seventh), etc) all work for all tunings.

Eventually we're going to add scale degrees beyond the octave as well as microtones.

preparser

If you thought the tuning code had gotten all out of hand you apparently hadn't yet seen the pre-parsing code. Holy shit.

And like everything else above I rewrote it from scratch. So much better. It's understandable and clean. But it doesn't really have any new features and in fact lost a few. And the main algorithm is going to be abandoned in the next version. But it works far, far more consistently and just makes tons more sense. And it is more flexible.

The code for durations and dynamics now allow for all values and fractional ones. This might seem like a small thing but it was something I had struggled with in the previous code base.

Lilypond

And of course I completely rewrote this section of code as well. It was a mess. But now it's better. We now calculate Lilypond pitches based on the ratios of the tuning. Somehow this is better.

But the big thing is that Lilypond can generate a good file using any tuning imaginable. Yeah, it will use the same note to represent more than one pitch if it has to but that's actually ok—it does so accurately.

And it can use quarter tones now though it is a bit buggy.

The next release will add chords and clean up the quarter tone problems.

conclusion

There are many, many changes under the hood in this release. All the existing functions are far more powerful and flexible than before. It's far more fun to play with as things just work.

I also finished the tutorial and the reference manual. There's a third manual devoted to the various Style Algorithms.

The next version will also be focused on these low-level functions (I mentioned a few things above but see the TODO file for more). After that we'll finally be able to get back to more hardcore Style Algorithm writing and then eventually create an online version of the PME.

As always, I appreciate whatever support anyone has provided since I began this project. I am still in need of much financial help so please check out the support link at the top and consider donating to the cause.

Copyright 2015 David Bellows

Colophon