Thursday, January 29, 2009

Variating Drummer Screenshots

Well, as they say, the proof is in the pudding. So here's proof that I've been doing more than just screwing around with senseless code for the past week. Most of these interfaces were designed this week alone. All of them are 100% original and all except the last are fully functional.

What exactly do all these do, you might ask? Basically, they all contribute to building a random yet intelligent drummer for my random music program. You say, "well it's clearly not random if you have to go through and fill out five flipping configuration panels." I say, true. But who wants to listen to atonal music? Or the equivalent as far as percussion is concerned? Not I.

Building music? Takes time. Building completely random (atonal) music? Takes less time. Building good random music? Takes exponentially more time than either of the aforementioned. Random, to me, doesn't mean give the computer a few instructions and listen to a symphony come alive before your eyes. Magic is for Walt Disney. This is hard, tedious, computer science.

And thus concludes my first rant on the nature of the complexity of good-sounding randomness. Now please, enjoy the pretty pictures (click to enlarge).










Infuriating Drumming

I'm continuing to improve upon the Variating Drummer plugin. I need to finish several things, the main one being the variation algorithm editor. Variation algorithms form the basis of the drummer's ability to give the style random twists. Unfortunately, building an editor for them is the most difficult challenge in terms of graphical user interface programming. I'm having a lot of trouble figuring out how I want the editor to look.

I also need to implement some sort of probability mapping for measures, so that the drummer will know when to apply fills and variations more effectively. For example, one does not usually do fancy rhythms during the first measure of the verse. Instead, one would wait until the second or, more often, the fourth, until spicing up the beat. It helps listeners keep track of measures, just like a metronome that highlights every fourth beat.

Finally, I need to develop some way to do fills. Right now I'm thinking that fills will just be special variation algorithms. I don't know. Right now I need to work on the variation algorithm editor. I'll post pictures later.

Wednesday, January 28, 2009

Intelligent Drumming

Today I worked on the Variating Drummer plugin for mGen. Finally I have managed to pull together all the pieces of this miniature framework into song demo in which the drummer demonstrated the ability to switch drum styles based on the intensity of the song!

So what does that mean?

Well, naturally, drummers should dynamically adjust their playing styles based on how intense the song is at any given point. For example, drums should play under the melody during verses but crank up the volume during choruses. The problem, however, is that we're not talking about volume alone. Fancier fills and better techniques constitute some of the aspects of higher intensity drumming.

Although the plugin is far from finished, this is an encouraging demonstration of the power of such a complex plugin.

Monday, January 26, 2009

Haunting, Gone.

It has haunted me for two full days. It has been conquered. I wrote a full algebraic solution since I'm sure you're all anguishing over it as much as I am.

Yes, you could have used calculator trickery. You could have made nasty assumptions and pulled out dirty answers. In the end, you would even have gotten the same answer as me and wasted a lot less of your life thinking about it. But the fact of the matter is undeniable. The problem is beautiful. It's the first problem I've ever seen bring natural logarithms to their knees. I've never hit an indeterminate form outside of calculus. And yet here it is.

If the problem is beautiful, the solution is even more so.

Enjoy.

Free Image Hosting at www.ImageShack.us
(click the thumbnail to view the full solution)

Sunday, January 25, 2009

Progress Report #3

This week, since I worked mostly on the coding aspect of my thesis, cranking out over half a thousand fresh lines of code in the music generating program, I encountered very few sources. Nonetheless, they helped.

  • Ishkur's Guide to Electronic Music
  • I was very excited to find this site...it's the most detailed map of electronic subgenres I've ever encountered! Not to mention that it has descriptions and multiple samples for each subgenre! Watch out though, Ishkur seems to have somewhat of a foul mouth. Still, his information is invaluable.
  • Mr. Hubbard
  • I had a brief chat this week with Mr. Hubbard about my program. This mainly occurred thanks to Matthew Saltz' insistence on me doing so. Since he was pressed for time, I just sat down and showed him a brief overview of the program. He said he thought it had great marketing potential and that there were a lot of places I could go with the idea. I'll be waiting for my next chance to talk to him about algorithmic composition in general.
Purpose Statement
In a broad exploration of algorithmic composition, I will study the creative aspect of music and methods for emulating human creativity. In the end, I will demonstrate my findings and own creative ability by building a working computer program to generate new, original compositions.

Research Questions
I'm still happy with the research questions from last week, I don't think any revisions are appropriate yet. They are guiding me towards the right persuits.

Reflecting on The Week
As I stated above, almost all of this past week was dedicated to raw coding. I started several new plugins including a Trance Progression module, a Trance Bass module, and a Trance Strings module. I'm developing them simultaneously to try to get a basic trance song underway. I'm still feeling great about my topic. I know it's going to be messy. It's going to be a lot more work than I expected and probably more than I expect even now. It's going to be massive. In the beginning I thought I'd have a very workable program by the time I hit ten thousand lines of code. Now I'm thinking at least fifty thousand before I start seeing nice results. Ten thousand seems like child's play. And you don't have to be a programmer to appreciate the magnitude of fifty thousand lines. Open up notepad and see how far you get hitting enter as fast as you can. Now imagine actually typing substantial, logical computer operations on each line. Ouch.

Still, I'm ready to work. I love music. I love computers. I'm clearly on the right track. I'm a firm believer that anything and everything can be accomplished when broken into small, tractable pieces. I sure hope I'm right!

Goals for This Week
(Sorry if these are too technical...there's really no way around that!)
  • Finish the Variating Drum plugin
  • I've been working on a simple drum plugin for mGen that works by taking basic drum patterns and applying random variation algorithms to the patterns to create dynamic drum beats.

  • Develop a Melody Method
  • While I haven't workeda huge amount on any part of mGen yet, melody is the only area that I literally have not touched. And considering that it's arguably the most important part of any song, I need to start thinking about methods for generating melody.

  • Generate a VERY Basic Trance Song
  • Shoot for the stars, hit the moon, right? This goal is probably very unrealistic, even with the lovely qualifiers in the goal statement. But if I could get mGen to crank out anything even faintly resembling trance by the end of this week, I think that would more or less solidify everything. I would not longer be running on faith that my six thousand lines of code thus far are going to magically come together and make sweet music. I need to hear the proof!

On with the battle!

Thursday, January 22, 2009

Trance: Bass and Progression

Today I worked on a generative module for trance-style bass and a progression module for trance-style chords. The bass is relatively simple, most trance just uses a heavy octaving bass that holds a steady beat. As for the progressions, trance usually keeps it pretty simple and almost always in a minor key.

I've got some really simple results out of the bass and progression modules, culminating in a really simple cheesy piece that inspires the urge to bang one's head repeatedly against a brick wall to the beat of the bass. Nevertheless, progress is progress. You have to start somewhere.

Wednesday, January 21, 2009

Trance

I've always been a fan of trance. It's the kind of music that really takes the idea of "beauty in simplicity" and makes it work. Good trance mixes separate your mind from your body and engulf you in emotions. The sound waves pulse rhythmically and expectedly, usually with a constant heavy kick drum and bass. And yet, in the simplicity of these waveforms lies the capability to enthrall. I've picked up my old trance mixes and started listening to them again.

Unfortunately, I've underestimated the genre. That's not to say that I should change its position on the flowchart. It's just...the task of recreating the human ability to capture emotions. Wow. Wish me luck.

Sunday, January 18, 2009

Genre Flowchart

I created a very condensed list of genres of music that I think represent most of the musical complexity spectrum. Obviously I do not expect extremely complex results in the early stages of the program. In order to stay motivated, I need to see results, which means I'll need to tackle the 'easier,' or less complex genres first. Though the chart I'm sure does a terrible injustice in its descriptions of the genres, it represents a rough road map for my journeys into algorithmic composition.

The chart is ordered with descending complexity, with the most complex genre at the top and the least at the bottom. I'll be starting at the bottom and working my way up.

Friday, January 16, 2009

Progress Report #2

At this point, I'm pretty much locked into a creative thesis dealing with algorithmic composition.

So far I've had no trouble finding sources on the topic. I am keeping a list of all the sources I have found at the bottom of the blog. Here's the current list:
Inquiry Statement
I would like to know more about what elements make up good music and how a computer can be taught to understand and recreate all the aspects required for a good composition.

Research Questions
  • What basic components should I break composition into to alleviate the task of random generation?
  • Which methods of algorithmic composition should I focus on?
  • What should my end goal be? Is it a realistic goal to create a full composition toolkit in a single year?
  • What practical use, if any, would such a toolkit have?
  • Would people oppose the idea of random music generate with arguments such as "it takes the soul out of music"?
Reflection
I have spent most of this week researching methods of algorithmic composition and working on programming the composition toolkit. I have found lots of helpful resources and I feel that I am ready to dive right in to pioneering the methods of composition. I'm feeling confident that I'm going to really love my topic when I start getting into the gritty details and the real work. At the moment I feel that my thesis is going to be weighted more towards the creative side than the research side. I'm already well acquainted with most of the methods of composition, and I'm really much more interested in developing my own and putting them to use than reading about theoretical nonsense that hasn't even been implemented. Less words, more action!

Where is it going?
As of right now, I have very ambitious goals for my thesis. By the time it is completed, I would like to have created my own original program capable of producing completely original compositions with a high amount of variety.

Wednesday, January 14, 2009

Questions and Code

Began thinking of some questions to bounce off experts. I'm going to try to talk to Mr. Taranto or Mr. Hubbard, or maybe both. Here's what I've come up with so far:

Do you think computers could be used to create full original compositions?
Do you think that there's an objective way to judge, at least to some degree, the quality of a song?
Would such a computer program have widespread applicability? Is there a market or at least an audience for it?
Is music rule-based enough for algorithms to recreate the creative process of humans? Or is there too much 'soul' involved?

I also worked some on the program.

Tuesday, January 13, 2009

Neural Networks - Emulating Human Creativity

Upon finding the article Algorithmic Composition and Reductionist Analysis: Can a Machine Compose? I immediately got excited. The author gives a great overview of algorithmic composition and details his own endeavors into the field.

In particular, the author touches on the concept of heuristic algorithms - including both genetic algorithms and neural networks - that slowly approach a desired solution by having a human evaluator determine the fitness of the system. I found the following quote astounding:

"A researcher trained a neural network to recognize makes of car from a photograph, and he decided to look inside the network at the individual neurons, rather than regarding it as a "black box" that somehow worked for some incomprehensible reason. He found that certain areas of the network were specializing into recognizing certain features of the car, and, by introducing a level of random "noise" into the network, got the network to design its own cars."

And finally, the author's take on algorithmic composition and creativity:

"I have always felt very uneasy about throwing any musical ideas away, as it would amount to destroying something that I think is unique. But, if computer composition took over to a degree, would the 'preservation people' be content with the idea that the music exists, somewhere, within the set of possibilities? May I delete Clara Empricost's symphony with impunity, once it has generated it? Should I preserve the algorithm and the random number seeds somewhere? An interesting set of problems."

Monday, January 12, 2009

GenJam

Found a program today by the name of GenJam. It makes use of evolutionary genetic algorithms to "learn" to play jazz by listening to a human play trumpet. The program is private, but there a few links to sample clips in which you can hear GenJam playing along with the human.

GenJam

Sunday, January 11, 2009

Progress Report #1

Well, if I claimed that I hadn't already been thinking intensively about my thesis topic prior to second semester, I'd be lying 100%. Don't get me wrong, I certainly don't have my heart set on anything (at least not completely...), but I do have several topics that I'm passionate about. And by several, I mean one: music. Luckily, music branches off in so many different directions that one topic in this sense translates to an infinite number of potential thesis topics.

In particular, I'm interested in the creative aspect of music. The following questions got me thinking: why do people enjoy different kinds of music? More specifically, what makes music 'good,' and can this quality be defined in objective terms, or is it completely dependent upon the listener? These are very broad questions and seem like they would be rather difficult to approach in the sense of a formal thesis. For this reason, I've taken interest in a more focused topic that seems to encompass all of these questions at the same time: randomly generated music - formally known as algorithmic composition.

The idea behind algorithmic composition is to get computers to compose original, creative, and pleasing pieces of music using one or many techniques that combine music theory with computer sciences. Considering my deep interest in both of these subjects, I feel that this would be a great topic that I would really like to delve in to. My research question would be something along the lines of can computers be used to create original, create, and above all good-sounding music?

Ultimately, if I continue to pursue this topic, I would like to do a creative paper in which I outline various methods for attempting to fullfill the aforementioned question, as well as construct a computer program to do so. Imagine a program in which you simply selected a desired genre and certain other song specficiations, hit a button, waited half a minute, and then sat back and listened to a completely original piece of music with your desired specifications. Or even better - forget the shuffle button on iTunes...just hit a "random all" button on the program and watch it automatically create an entire CD worth of new music and burn it to a CD. Wouldn't that make those long car trips go by a LOT faster? I sure think so.

Best of all, if such a program were created, it would truly be one-of-a-kind. There are several algorithmic composition tools available on the web, but so far I have found none that truly impress me in terms of musical quality. Here is a link to my favorite one so far, entitled "cgMusic." Scroll down and check out the sample "dance_s90es.mp3". It's my favorite and, in my opinion, that's pretty darn good for computer music. Still, I think there's a lot of room for improvement.

A quick side note before anyone starts pointing fingers - this is NOT a rip-off of Matthew Saltz' thesis! Matthew has created an excel-based spreadsheet program that statistically analyzes music progressions and uses these statistics to generate new, random progressions that sound good. His thesis focuses on a very specific part of the overarching field of algorithmic composition, that is, the progression of a song. Click here if you don't know what that means and you want to find out. He uses first-order Markov chains, a mathematical method of algorithmic composition, to generate new progressions. I, on the other hand, want to pioneer a more general but all-encompassing method of algorithmic composition, bringing all the more specific pieces together to create comprehensive generator that creates progressions as well as melody, harmony, bass, drums as well as mastering effects. So no, I am not trying to copy anyone!

There are a lot of techniques for generating random music. Some are very simple and some are insanely complex. For example, one technique known as fractal composition involves the mapping of various mathematical fractal equations to pitches in order to generate a song (that may interest you, Robin?) - see fractalcomposer to try it out yourself with an online program that lets you make your own simple fractal songs. One of my personal favorites is known as a genetic algorithm, which involves the 'breeding' of pitch generators that have 'DNA.' When a user selects his or her favorite generators from one generation, the DNA combines and the next generation gets that much closer to something that sounds like good music; this process essentially models evolution and works based on the 'natural selection' of the user.


Speaking of evolution, even though I've already written far too much, I will say that I am also very interested in evolution and natural selection. Personally I think Darwin's theories have far too many flaws to be reconciled. What's worse, I feel that contemporary molecular biologists ignore many of the gaping holes in the theory. Worse still, much of the scientific community is now using evolution as an atheist front, attempting to squeeze religion out of all public systems, as is apparent in many of the recent court cases and the overall tone of every Scientific American article written on the subject. I'd like to explore some of the shortfalls of these theories.

Consider my apologies extended to anyone who actually took the time to trudge through that superfluous jungle of thoughts. I'm finished for now!

Thursday, January 8, 2009

Two Research Questions

Question: can algorithmic composition be used to compose a creative, coherent, and above-all good-sounding score?
Key Words: algorithmic composition; genetic algorithms; fractal algorithms;
Strategies: bring together creative algorithms and modules of varying types within an overarching framework to create coherency; use variation and stochastic processes to create creativity; use expert systems (heavily coded with music theory) to make sure it sounds good

Genetic composition algorithms; talks specifically about designing an “ear module” that can filter the search space of the solution to a good composition
http://www.ece.umd.edu/~blj/algorithmic_composition/icmc.95.html

Resources for algorithmic composition
http://www.flexatone.net/algoNet/

Question: can a human eye and the intelligence to interpret its output evolve within a bounded timeframe (3.8 billion years or less) from a simple patch of photoreceptor cells?
Key Words: evolution; natural selection; Darwin; irreducible complexity; intelligent design