1

**Computer Projects and Ideas / PMusic - Procedural Music Generator**

« **on:**May 03, 2013, 03:34:39 am »

So a couple days ago, I randomly thought of how awesome procedurally generated music would be, and when I looked, there is a (in my opinion) surprisingly small amount of these kind of things. So I decided to write one for fun. Right now, it is very very random sounding and it doesn't really flow at all, but it can still be kind of cool sometimes still, especially when you keep in mind it's all randomly generated I just started this, so it is very early, and will probably change a lot in how it sounds, but this is a very early showcase of how awesome this can be. Right now it loads up with the seed 666 by default, but you can change that. Everything about the song is randomly determined based on the seed. The program is written in java, and attached below. So try it out, and maybe post some of your favorite seeds and stuff!

Note: Large seeds work better!

Now, for those interested, here is a quick overview of he current process:

1. First, it chooses a random tempo (50-170bpm) and a random root note.

2. Based on that root note, I have a formula which transforms the set of integer numbers into the notes on a major scale based on the root note

3. For each measure, it first chooses a root note for the chord for the measure (based on the aforementioned formula), and plays the triad based on that note and in the scale for the root note. Note that I took out it choosing the seventh (a diminished chord) for now because when randomly stuck in there, most of the time it just sounds odd.

4. There are 32 ticks, or steps, in a measure, and each tick is equivalent to a 32nd note at the chosen tempo. So it then figures out how to fill up those 32 ticks with random length note from the chosen triad, varied randomly by octave, choosing lengths between half notes and thirty-second notes.

5. There is also a simple static drum beat, just to keep the sometimes very weird off-beat things that can happen from getting too disorienting

And that's about it for the current version! I hope to start adding things that make the notes and measures more dependent on each other to really make everything start going together better, and also add some generic formulas for some additional melodic parts to the song. There's also quite a few bugs I know of, but for now, enjoy!

NOTE: CHECK LATER POSTS FOR THE NEWEST VERSION.

Note: Large seeds work better!

Now, for those interested, here is a quick overview of he current process:

1. First, it chooses a random tempo (50-170bpm) and a random root note.

2. Based on that root note, I have a formula which transforms the set of integer numbers into the notes on a major scale based on the root note

3. For each measure, it first chooses a root note for the chord for the measure (based on the aforementioned formula), and plays the triad based on that note and in the scale for the root note. Note that I took out it choosing the seventh (a diminished chord) for now because when randomly stuck in there, most of the time it just sounds odd.

4. There are 32 ticks, or steps, in a measure, and each tick is equivalent to a 32nd note at the chosen tempo. So it then figures out how to fill up those 32 ticks with random length note from the chosen triad, varied randomly by octave, choosing lengths between half notes and thirty-second notes.

5. There is also a simple static drum beat, just to keep the sometimes very weird off-beat things that can happen from getting too disorienting

And that's about it for the current version! I hope to start adding things that make the notes and measures more dependent on each other to really make everything start going together better, and also add some generic formulas for some additional melodic parts to the song. There's also quite a few bugs I know of, but for now, enjoy!

NOTE: CHECK LATER POSTS FOR THE NEWEST VERSION.