Music Generation

Alright, due to an inquiry I’m writing this page. But don’t think for a second that I’m gonna answer any more anytime soon. I’m a busy guy, I have other important things to do, like sleep.

At first this was going to be a very technical post, but I’m gonna rework everything soon (no, not the move to Magenta, but something different) and I don’t need to make enemies with any Computer Science buddies when I accidentally come off as arrogant when I talk about my exploits with making a program shit out midi files.

Another reason I’m not doing anything technical is because most of my code came off scouring through online articles, and so if I released my very bad code I’d also need to write a guide to it. And if I said anything technical about it, I’d need to release the code. So if I do anything, I’ll need to put in lots of extra work I don’t want to do.

I have no interest in writing a guide that’ll get obsolete within a couple small updates, so I’ll piss off my Computer Science buds some other time.

The Music Playing Framework

The first thing you have to deal with is getting your shit to make noise.

At first I was using this synth as a test, but I moved on to midi files using the default SF2 files instead because I have no Javascript experience.

Most people might prefer to use a game engine like Unity because they’re probably making a reliable music generator for a game rather than my useless midi-mess.

Music Theory for The Non-Musical

I’ll just piss off some band students instead.

Harmony – Harmonize with 3rds or 5ths. 2nds or 4ths create dissonance, which is good if you have a spacey 2001: A Space Odyssey-esque synth.

Patterns – Alright, so maybe I got lazy. But if it’s a pattern then it’s alright. So by looping random notes I knocked this one off the checklist very sloppily and lazily.

Rhythm – Just don’t go off-tempo.

Separation – Some helpful advice is to somewhat mix your music to the point where it at least isn’t blaring and having every instrument contribute to chaos in your headphones.

Choosing Colors – While you might like a certain scale, sticking to it will get boring, and depending on how well you want to mask the repeating randomness in your music, you might want to just pick some chords to cycle through that make the music sound “natural” and not like a crossbreed between a randomizer an a keyboard.

Fluid Melody – So this is probably the only part of this entire thing where I didn’t just loop random shit. Melody shouldn’t jump in an awkward way. While there are always exceptions, it’s best to just have some range of movement instead of awkward start-n-stops or jumps-n-jitters. Mine just goes in an up-n-down pattern, but if you gave your program a good sense of melody you could probably make something much better.

Tying it Together – A good bassline glues everything together. Or you can just use a low pad as filler. I did both.

Not Making Junk

Since I’m an amateur, I just got the program to play in an A-B-A A-B-C A-B-A manner and let the melody stay in a safe range in relation to whatever notes the program was playing in the background.

While this isn’t impressive, it follows the basic rules of procedural generation for most games. (Most games use perlin noise to create clean smooth blends when generating terrain.)

If you don’t know what you’re doing, play it safe and use chords to mask your inferiority.

Flaws of Dawson 0.2.5

In the current state, Dawson’s framework is just a midi-shitter.

The failure-to-useable generation ratio is 10:1 and that’s not very impressive.

Future updates will use <secret> and then eventually Magenta (maybe.)