Melody project: the great reprogramming – update 5

As I stated yesterday, I’m now working on getting my program to create its own melodic knowledge rather than depend on melodic patterns found in pre-existing melodies. This turns out to be harder than I thought it would be — or at least more time consuming. I’m sure it’s possible, it will just take more programming. So I’m continuing to work on that. If I can’t get it done by the end of the week, I’ll give up on it for a while. In the end, perhaps I’ll use a combo of both methods.

Uh… yeah, that’s pretty much it for today.

Melody project: the great reprogramming – update 4

It’s week 2 of melody generator programming fun! Over the weekend, I was preparing to add more knowledge to my program’s melodic knowledge database, but then I thought: Wait a sec. If the knowledge in the knowledge database comes from patterns found in other melodies, why not create a knowledge database from the patterns found in that database? That way we’d only need a small database, and we can have the program create random melodic knowledge from it. Does that make sense? I have no idea if it will work or not, but I’ll give it a try, so that’s what I’ll be working on today: a melodic knowledge generator. I’ll try to have more musical examples by tonight or tomorrow night (or… later).

Thank you for reading update #4. I will keep the blog informed of any and all progress made on this revolutionary product.

In other news, I wrote some melodies over the weekend and started to hear a piece in my head, so I finally bought Garritan World Instruments, which I hope to use soon. I should be saving my money, but when you’re high on your own melodies playing through your mind, you sometimes just can’t help it. And Garritan products are at least priced awesomely for the amount of stuff you get.

Some computer generated melodies…

Here are five melodies my computer program wrote today, all in one MP3 file:

Examples of computer generated melodies

A few things to note:

1. The program is still working within limitations of only being able to compose in C major, only being able to use the basic triads, only being able to compose 8-bar melodies in 4/4 time. I will, of course, work to remove those limitations, but there is still more work to do on the algorithm first.

2. As you can hear, some of the melodies don’t sound that great. I think they technically work (they don’t sound like random atonal garbage), but they’re not quite memorable. I really like the first one though, and the second and third one have some interesting parts. Anyway, my goal with the program isn’t to get it to output something beautiful every single time; the point is to give the user melodic ideas. As the algorithm is now working pretty fast, the user should be able to have the program generate 100 or so melodies at a time, then he can browse through the results and find whatever strikes his fancy.

3. The five melodies in that MP3 are based on melodic knowledge the program learned from just two melodies. So if they sound kinda similar now and then, that’s why. But still, it amazes me how much musical variety can emerge from such a small set of knowledge. I look forward to building the program’s knowledge database; I can’t wait to see what sort of stuff it might produce with knowledge from several hundred melodies or so.

Melody project: the great reprogramming – update 3

I haven’t gotten much done today because I slept all day because I was up late reading because I have library books that are due soon because they are on hold and I can’t renew them and I want to finish them or at least get as far as I can in them before I have to return them because that’s just the way it is, OK?

Anyway, regarding the melody project… I have created a small set of symbolic knowledge with which to experiment with. I am now continuing to work on reprogramming and restructuring the main melody composition algorithm to make use of the knowledge in its new form. That’s pretty much it. An in-depth look at my meaning of this is strictly confidential.

Thank you for reading update #3. I will keep the blog informed of any and all progress made on this revolutionary product.

Melody project: the great reprogramming – update 2

Yesterday I successfully designed, programmed, and tested a melodic information symbology, making melodic information easier to input. This should also save the program time and memory, as it will only have to decode the string of symbols if and when it needs them, and when it no longer needs them it can delete them again. The only caveat is that the symbol strings themselves are always held in memory. I’ll leave it like that for now; if I have memory problems in the future, this issue may need more attention.

My goals now are to use this symbology to create a set of knowledge for the program’s knowledge base for further algorithmic reprogramming, restructuring, and testing. An in-depth look at my meaning of this is strictly confidential.

Thank you for reading update #2. I will keep the blog informed of any and all progress made on this revolutionary product.

Melody project: the great reprogramming – update 1

I’m working on reprogramming my melody generator from scratch in an attempt to make it more organized and more efficient. A higher degree of modulation should also make the programming of future feature additions easier. My overall goals are as follows:

1 – Reprogram the algorithm and get it output easier-to-interpret text
2 – Get the program to output MIDI files
3 – Begin adding other features

For now, work continues on goal #1. I’m trying to program a symbology, so that the program can store a bunch of melodic information in the form of encoded strings. It can then decode these strings when and if it needs to. This is in an attempt to save both time and memory, and to make adding future features much easier for the programmer. An in-depth look at my meaning of this is strictly confidential.

Thank you for reading update #1. I will keep the blog informed of any and all progress made on this revolutionary product.

Animation Mentor class 3 almost over… what next?

My final week of Animation Mentor Semester 3 is wrapping up! I turned in my last assignment on Sunday; here’s what it looked like through the four weeks I worked on it:

There are still some problems with it, but I think I’m getting better. That’s 3 semesters down and 3 to go! I’m halfway done!

As I’ve stated before, I’m taking a leave of absence for 12 weeks instead of jumping right into semester 4. I’m going to be working as hard as I can on my automatic melody generator, so I’ll keep this blog updated with my progress on that. My current goal is to create it as an Android app. Other platforms may follow, depending on its success or lack thereof.

I also started a new project: I’m creating a Grand Theory of Human Intelligence (or GTOHI), not only detailing the basic principles of what intelligence is and how it works, but trying to simulate the results of human intelligence with basic artificiall intelligence programs. This project might fall flat on its face, but I have some ideas that I think are definitely worth exploring. There’s a lot of research to do, so I probably won’t have a product based on my findings until I’m 70 or 80 years old… or dead.

Stuff I’m doing

You might be wondering: “gee whiz, I wonder what exactly Sean is up to these days?” If so, I will tell you in this post that I am writing right now.

I’m in week 10 of class 3 of Animation Mentor. It continues to go very well; I’ve learned a ton of stuff this semester. I’ve gotten better at managing my time, but I still find myself pulling very late-nighters or all-nighters the night before assignments are due. But at least I’m not feeling the pressure like I was during the previous classes. I still wish my (almost full-time) part-time job didn’t take up so much time, but I need the $$$ for Animation Mentor tuition (and paying off college loans).

I requested a Leave of Absence for the Animation Mentor Spring 2011 term because I want to watch the trees blossom. But mostly because I want to dedicate as much time as I can to researching and developing my melody generator. My main goal would be to be create and sell an Android app; that has the potential to make some $$$, and Android is Java-based and I’m developing my algorithms in Java anyway, so it would be mostly a matter of getting an Android GUI to work, and figuring out how Android can handle MIDI files (I know it can play them, but can it create them?). I’m not sure if this is something I could accomplish in just 12 weeks, but it’s worth a shot.

Other than that, I’m reading The Lost Gate by Orson Scott Card (the first non-Ender novel from him I’ve read), which is quite fun, along with a number of non-fiction books (I tend to just read whatever chapters interest me, because of my limited time).

I’m also continuing to plan out my fantasy novel and working on a couple of new short stories, one likely to be titled The Boy in the Sword (which I’m almost done writing) and the other currently untitled.

Oh, and I rarely preorder stuff on Amazon, but I had to preorder this: The Lord of the Rings: The Motion Picture Trilogy (Extended Edition) [Blu-ray]. Really looking forward to it.

Melody generator update…

My obsession with programming an automatic melody generator (that actually gives good results, unlike just about every other melody generator out there) continues. Again, the program works by analyzing existing melodies and “learning” from them. In my 2008 version, the program analyzed the given melodies while it composed new ones from them. Now the program stores its “knowledge” so it doesn’t have to analyze a melody more than once. Of course, there’s still the problem of getting the program to find the right sort of knowledge and to use it appropriately. But what I have is coming up with some interesting results. I’ll post more later, but here’s one melody the program wrote early this morning: MelodyExperiment2.mid (melody stated and repeated ad nauseam in pizzicato… the output of the program just gives chords and melody numbers; the tempo, the instrument choice, and alberti bass were added by me)

EDIT: By the way, obviously some of the melodies it outputs sound much worse than that. That’s one of the better ones…

Unfortunately there are still a lot of limits in the program that need to be dealt with:

1. It can still only compose an 8-bar melody in 4/4 time. I need to give it a wider range of time signatures (3/4, 2/4, and 6/8 at the very least), and I need to let it be able to compose 16 and 32 bar melodies, and “extended” melodies, such as a 10-bar melody which is really just an 8-bar melody that takes two extra bars to resolve. Ideally the user could choose the bar length and time signature.

2. It can only compose in C major. That might seem trivial; can’t the program just transpose the melody up and down afterward generating it? Unfortunately that can lead to notes that are way too high or way too low. To keep the melody within a certain range, we’ll have to deal with this.

3. It can only compose diatonic melodies. It can not yet shift into other keys or limit itself to a certain scale. Fortunately I don’t think this would be very hard functionality to add; it’s just a matter of giving the program more options, and making sure it uses them appropriately.

4. It can only compose within a certain range of notes. Which is fine, but ideally the user could decide what range is allowed, and what interval leaps are allowed.

5. There are limits on chord progressions. It must always start and end with the I chord. This makes it sound nice and complete, but it should have the ability to start on a different chord or something. It also sometimes comes up with some pretty odd chord progressions that are technically fine, but just odd. It would be interesting to program an “inventive” variable, telling the program how much it should do whatever it wants with the chord progression (within reason), and how much it should adhere to what it “knows.” Also, it currently only recognizes the main triads; it ignores major 7ths, major 9ths, sustains, etc. I’m not sure that matters much; a listener could always change that himself if he wants to use the melody for something, so if I do add that feature, it will probably be the last thing I concern myself with.

And then matters of practicality:

6. It outputs numbers in a text file which then have to be laboriously converted manually into a MIDI file, which takes too long. It should be able to output a MIDI file (or files) by itself, or at least a much easier to read text file.

7. It’s programmed in Java. To get it to work on the Internet (if that’s what I decide I want), it will probably have to be converted to PHP, and we better make sure it’s not too computationally heavy for that. (I don’t think it would be.)

That’s all! Enjoy that beautiful melody! Look out for more!

Computer, write a melody in G major, please…

I’ve been finding it hard to focus on my animation studies this week. I had a little musical epiphany, and my mind is now once again obsessed with working on my book on writing melodies and the “melody generator” computer program to go with it. The program is now capable of outputting some pretty nice stuff, a huge improvement compared to the 2008 version. But you’ll just have to take my word for it because I’m not quite ready to share samples just yet. But soon, I hope. I also think I’m pretty close to getting it to generate complete songs (in melody + chords format, not entire instrumental arrangements), at least algorithm-wise; then I still have to program it. I’m tempted to expand the topic of the book from melody composition to musical composition in general; after all, couldn’t one define any polyphonic piece as just a bunch of melodies played together? It’s the natural extension of my work, so why not just go for it? But who knows how long that would take…

Anyway, I’m extremely excited, and I’m pretty confident that within this decade, perhaps even within the next few years, we’ll have some great computer music generating programs (from me or from someone else) that will provide us with a lot of inspiration. I’m confident because I have it now. In baby form, at least.

But I’m probably getting way ahead of myself. “Don’t get excited.” It’s in the artist’s creed. Gah, it’s hard…

I’m not really sure why I’m posting this. I don’t have anything useful or interesting to share yet. I guess I just wanted to let out my excitement.

Oh, I’ve also been composing endless melodies. When you’re writing a book on the subject, the ideas just pour from the mind. I suppose that’s part of what’s fueling my obsession… melodies, melodies everywhere…