May 19

cgMusic - Can computers create music?

Tag: General, Music Composition, Personal, TechnicalMaciek @ 3:45 pm

The short answer is -  yes they can. The long one is – yes, they can and in fact they do it better than most people. I’m not talking about computers performing music (like a MIDI Player or a Toyota robot playing violin). I’m talking about computer software that is composing music - making up melodies and writing scores for some instruments. The only thing which gives us, people an edge at composing music is that a real person can tell which one composition sounds better than others. A computer can create hundreds of songs in a second but it will never be able to tell which one it likes the most. But let’s get back to the beginning…

Apart from being a programmer and a designer I’m also a kind of an occasional music composer. I have created the entire music soundtrack for Magic Match and many tracks for Saqqarah and some other games, but in most cases I create music for fun. I plan to post my compositions on this blog in the future as well as to write about my experiences concerning making of music for games, but now I’d like to write about a piece of software called cgMusic, which I’ve developed as a part of my master thesis.

cgMusicThe goal of the cgMusic project was quite ambitious as I was supposed to create a computer program that would be able to create music with a certain level of quality that most of the existing music generating software lacked. Apart from that, I decided that I would not limit myself to mimicking any particular kind of music and rather make the software universal in such a way that it would be able to create music of any genre.  So, did I manage to do it? You can judge for yourself.

cgMusic Screenshot 

You can download the program here (0,5 MB), install it and give it a try. At start you can either load any of the preset projects or create a new project by selecting two master algorithms that will create a random song  for you. Later you can tweak all the internal parameters to your liking, change the songs arrangement and so on. If you have any questions about using the program, feel free to post them as comments to this article. If you don’t want to download the application here a some compositions created by cgMusic, that I was particularly impressed with. They are in midi format and should play properly on any General Midi compatible device.

The internal workings of cgMusic are quite complex. Basically cgMusic is an expert system distributed among many independent modules, where every single module knows how to create one aspect of music. An example would be an algorithm that creates a certain set of possible rhythms, melodies, harmonies, song structures or hole arrangements. The program can easily be extended by adding new modules on the fly and this is how supporting new styles is possible. Each module can be controlled independently so when you decide on a certain melody and structure you can listen to “your” song in any of the available arrangements. For the purpose of my master thesis I created a sample set of plugin modules that show the very basic abilities of the application. It was a nice surprise for me to see that even with very simple algorithms the program is able to create complex music.

If you think that music generated by cgMusic sounds crappy this probably because midi music generally sounds crappy. But there is no problem in rendering cgMusic generated compositions using some fancy synthesizers or samplers. Below are a couple of examples in mp3 format that show what kind of effects can be obtained with the usage of proper music rendering tools.

There are many potential uses for computer generated music, ranging from real human composer assistance, music production tools, dynamic music for computer games, etc. The main reason behind slow development of advanced new music generating algorithms is that relatively few music composers have the IT based skills and the necessary knowledge to translate their music composition skills into mathematically defined algorithms.

Share/Save/Bookmark

Related Posts

16 Responses to “cgMusic - Can computers create music?”

  1. Pomann Diggs says:

    Thank you for this wonderful software. I tried many different ones i.e. fracmus, fmusic 19, qfc, gingerbread, etc. This one is superior.

  2. Cat says:

    Hoping you’ll make this in Mac format one day. In the meantime… looking for a PC… THANKS! Cat

  3. Dwayne says:

    Try ‘Modern Song Structure’ 11055 and ‘Simple Ballad Song Arrangement’ 11896! :) This is one of the two best random music creators I’ve ever used. The other was AlgoMusic on the Amiga back in the ’90s.

  4. David Pletts says:

    This is an awesome music application, best of its sort that I have come across. Well done and thank you. Now, I am hoping that you will extend it to include extra styles of music, including, perhaps, ones with less emphasis in a melody, such as trance (and similar) and ambient with slower movement of individual parts. But, wow, its good!

    Regards

    David Pletts

  5. Sibilance says:

    wow,
    It’s a wonderful software. I play with it a lot of time, and my son (11 years old) started to write song for his school :D.
    Your program is more interesting than that from soundtreck
    Congratulations
    Your my muse, now.

  6. vandergraaf says:

    First: Sorry for bad English….
    Thanks for this wonderful piece of Software.
    I tried a couple of algorythmic Composition Software,
    “Music in the Numbers” - simple and really great, but no longer developed.
    And other ones….and this seems really great.
    I wish in the future you can implement change the midi-output i.e. to MIDI-Yoke,
    so that is possible use this software on the fly together with Cubase (or similar programs)

    Congratulations !

  7. Steve says:

    It’s not just clever, it’s sensational! I genuinely enjoy the music it creates.
    You’ve done an outstanding job. I hope the University appreciated how your softwares’ capability dwarfs any other in the same arena.

    Is each track it creates truely unique?

  8. Bill-USA says:

    Thanks for this excellent software..

    Wondering if you plan any future development?

    Thanks

  9. Maciek says:

    Thanks for all the kind words about cgMusic.

    Unfortunately I don’t plan to develop it any further at the moment as I hove a lot of work with our games.

    Cheers!

  10. Jim says:

    Just downloaded this, and really want to experiment with it! Three questions though:
    (1) when I try to right click on a tree element to access script options, nothing happens. Am I missing something here?

    (2) are the help files available somewhere in English?

    (3) where can I find out more about the scripting language? what is it written in?

    (4) any possibility of a real-time midi-out implementation?

    Thanks so much! Great stuff!

  11. Maciek says:

    Jim, thanks for your interest in cgMusic. To answer your questions:

    (1) Right clicking on a script in a tree view should give you a popup menu with “Edit This Script”, “Duplicate” and “Remove” options. The “edit this script” function requires the freeware CrimsonEditor to be installed(www.crimsoneditor.com). But in fact you can use anything to edit the files on disk like notepad.

    (2) Sorry, no.

    (3) The embedded scripting language used is angelscript. The syntax is very similar to c/c++. You can learn more about it at angetcode.com/angelscript.

    (4) Actually when you hit the play button the application sends the events to the default MIDI device set in Windows, so you can redirect it wherever you want. But changing parameters during playback is not possible because it is necessary to recompute the whole song after each change.

  12. Bearz says:

    Definitely an amazing program! It is most unfortunate that there is no documentation in english for the scripting language, since writing scripts is such an important part of the cgMusic creative process. Alas… :(

    Also, I can certainly understand that you would be too busy to continue development of the program, but since you are giving it away for free, (Thanks!!), and don’t have the time, would you consider making it ‘open-source’ so others could continue to improve this wonderful gem? There are a number of similar programs out there, but they are all either proprietary (LOTS of $$), hard to use, or seriously out of date. cgMusic is a great, easy to use program that could become the ‘hub’ of a vibrant ‘open-source’ community! (And an easy way for Codeminion to generate more game traffic through a low cost, or no cost, ’sponsorship’.)

    I know that I would be happy to invest a lot of my own time into an ‘open-source cgMusic’ project, (please feel free to email me), and I’m sure others around the world would too. We might even find someone who reads Polish to translate the scripting help for all of us poor, neglected english speakers! ;)

  13. Parker says:

    Beautiful software! I’m working on a similar project with a large format multi-touch interface (see http://www.nuigroup.com). I would love to know more about the architecture of the program. Maybe even a UML diagram? That would be awesome.

    Parker

  14. David McLeod says:

    Do you have English documentation for this program? When I installed, all I see is a couple of doc files that appear to be in Polish.

    Thanks,

    David

  15. RadicalOne says:

    Wonderful software, but how do I use mp3 rendering?

  16. Bastiliash says:

    I also think, that going open-source is a great idea. I also would be very happy to invest my time in contribution to this software.

Leave a Reply