Back to Home

Random Music

An observation

For many years I have held the illusion that somehow I could be a musician whos songs would mean something to someone somewhere. It kept me going. But in my heart I knew I had neither dedication to really learn how to play an instrument or the raw talent to make up for these deficiencies.

Still I kept on plugging at it and every now and then something quite good would come up. Even my hamfisted playing would accidentally come up with something good. I was one of those infinite monkeys who laboured to recreate the works of Shakespeare. So I have put down my instruments concentrated on giving random chance a go. I have become Bourges' librarian scouring a seemingly endless stream of random letters searching for something profound. Or maybe the doomed editor the monkeys submit their latest opus to.

For your delight

This is not the be all and end all of what I am working on but a sample of how things are going. I have some programs that knock out bass lines and drum patterns and here is an example of the type of output you can expect in Midi file format:

A random drum pattern

A random bass pattern

What I then do is wade through the output and throw out that which I dont like of both drum and bass and look at how I might combine bass pattern 111123 with drum pattern 23482. It is a thankless task and I am in the process of writing some software to help me do this.

The programs

Here are the programs that I use to create the random drum and bass patterns. It is written in Ruby so be warned. Ruby will run on any platform so just nip off to http://www.ruby-lang.org/ and download a copy. If you have a recent Linux distro then you may already have it installed (type ruby -v and see what happens). There are some DOS batch script files to tie everything together but if you know Unix you will have no problems converting them to bash or similar.

Zipped source files (10k)

The files contained are as follows:

mc.rb The actual midi compiler, I called it mc when I developed it on the PC and then discovered that mc under Linux was Midnight Commander. Bugger.
mcpp.rb A preprocessor to unroll loops and implement macros before the input file is passed on to the midi compiler itself.
bgen1.rb The program to create random bass patterns
dgen1.rb The program to create random drum patterns
b1.bat Bass patterns. The batch file that does the whole thing. All the parameters are set and all the necessary programs will be called to create a midi file for you to listen to.
d1.bat Drum patterns. The same as above except for drum patterns.

The online documentation is here:

Midi Compiler Documentation

More...

I'm not good at writing so this is all rather sparse. I also have other enhancements in mind and other software to write to help me wade through the stream of monkeys.

Back to Home