Platonic Music Engine logo

Introducing the PME

I’ve been not-so-quietly working on a super-massive project. Actually two. No, four. Sorry, I should have said five. But of concern right now is just this one, the Platonic Music Engine.

I feel like the name is pretty self-explanatory so I’ll just wrap it up here.

Edit: OK, apparently not.

Here’s what the PME does, it interacts with the user, translates that interaction into a series of numbers, and converts those numbers into random-sounding music with absolutely no regard to what people think of as “good” or “conventional” music.

I really really wanted to stop the project right there.

A friend convinced me that if I want to become fabulously wealthy off this and win multiple Pulitzer prizes that I should have it do a little more than that.

Fine, so the bulk of the PME is taking that original random-sounding bit of music, the Platonic Score, and make it playable on any instrument and allow the user to manipulate it into sounding more conventional or even “good”.

The whole thing has gotten really out of hand.

The Platonic Score

Let’s start with the Platonic Score. The software I’ve written converts some letters/numbers entered in by the user into a series of numbers via a “hash algorithm”. Do not worry about what a “hash algorithm” is—it’s just this thing that converts arbitrary thingie-dobs into numbers. This set of numbers becomes the "random seed" for the “pseudo-random number generator” that then generates a lot more numbers. Don’t worry about those other words either. (If you’re a programmer then you’ll already know what they mean and be worried. If you aren’t a programmer then it’s really not worth worrying over.)

These “lot more numbers” make up the Platonic Score. They are in the form of MIDI parameters. MIDI stands for “musical instrument digital interface” and is a way for electronic instruments to communicate with each other along with a computer and be controlled by that computer. The three basic parameters for a note in MIDI are pitch, volume, and duration. (Volume is actually velocity but for simplicity’s sake I’m just going to call it volume. People knowledgeable in MIDI will understand the distinction.)

So the PME generates three parameters (No, five.) for each note using the full range of values that MIDI and/or my computer can handle (ie, the duration could be forever but my computer MIDI player can’t last that long so I had to choose a duration range it could handle. The other parameters are fine at the full ranges though). This is 128 possible values for pitch (to give you some perspective the piano has but 88 possible pitches and the concert flute roughly 36), 128 possible values for volume (in most classical music we deal with only 8 volume levels: ppp-fff), and 32768 for duration (depending on the tempo this can range from milliseconds to minutes).

This is probably a good time to listen to some music. Here is a version of the Platonic Score. Sounds randomy, no? Not conventionally musical, yes?

Quantizing the Platonic Score

OK, so we have the Platonic Score that sounds all kooky and weird and it uses the full range of MIDI values. Because it uses the full range of MIDI values this means it cannot be performed on any musical instrument known to humanity or by any human known to humanity. (Without lots of cheating, that is.) The range of notes is too large, the levels of volume too fine-grained, the durations too crazy for a person to be able to figure out.

In order to make that Platonic Score playable on an actual instrument by a real live human being we have to quantize that sucker. (Not positive I know what that word means, mainly I think it sounds cool.) Or squeeze it down to fit on an instrument.

Let’s start with a simple example, say our Platonic Score has a range of five notes, 1-5 but our instrument can only play notes 2-4. What to do?

We create a mapping, we say that wherever the Platonic Score has a pitch of 1 or 2 then our instrument will play a 2. If it has a 3 or 4 then our instrument will play a 3. Likewise a 5 maps to a 4 on our instrument. So the melody 4, 2, 1, 5, 3 for the Platonic Score would look like 3, 2, 2, 4, 3 on our instrument.

The PME is a bit fancier than this and can weight the “quantized” values. What I mean is, given the previous example, instead of mapping the Platonic Score to 2, 3, 4 we decide that we really don’t like the 3 pitch but just love, love, love that 4 pitch. So we use these values instead: 2, 4, 4, 4. This translates to a mapping that looks like this, 1 and 2 map to 2 on our instrument. 3 maps to 4. 4 maps to 4 and 5 also maps to 4. Now our original melody (4, 2, 1, 5, 3) would look like 4, 2, 2, 4, 4.

See? That’s pretty cool. Now our Platonic Score can be quantized down to something that can be played by a human on an actual instrument and sounds a bit more musical by leaving out notes that clash while emphasizing notes that sound good together.

Applying Style Algorithms

But that’s just the beginning! The results of the initial quantizing still won’t sound all that musical so next we apply “style algorithms” to the quantized music. I will be going into more details about the various style algorithms I’ve created and plan on creating in future blog posts so for now I’ll just talk about one I call the bel canto style algorithm.

The music that results from the quantizing above will have a peculiar feature that most people think is rather unmusical, it jumps around in a random manner. Sometimes a high note and then a quick leap to the lowest possible note. It’s all over the place. The bel canto algorithm does its best to raise or lower notes in octave leaps to smooth out the melody. It’s a simplistic approach but does a decent enough job.

Now for some music, here is that exact Platonic Score you listened to above quantized down to a flute, using just the notes of the G-Major scale and applying the bel canto algorithm:

Flute Music

Much more conventionally musical but perhaps could use some more tweeking which the PME will allow you to do to your heart’s content.

A very important part of this project is that besides creating audio files it can generate sheet music for the music it creates. Like:

Flute sheet music.

The Future

And that is barely scratching the surface of what the PME can do now not to mention what it will be able to do in the future. In upcoming blog posts I will go into more details, some of them technical, some musical, about what the PME can do. This is just an introduction to the program. Meanwhile I also post updates to Reddit which you can follow in this subreddit.

As always I am in serious need of funding. If you have any money you can spare to the cause it will help me out way more than you can imagine. Just head over here and you can donate however much money you want. Thanks!

Copyright 2015 David Bellows

Colophon