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

49 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.

  17. Boutros Boutros says:

    Genius program, simple and very effective. Well done! I think open source is a great idea too, but I totally understand if you wouldn’t want to release such great code. It’s free, it’s fantastic, thanks again!

  18. Paul says:

    I tried cgmusic and this one is the best music done by algorithmic composition. I can say only: WOW! :)
    I tried to output the midi file into ZynAddSubFX synthesizer and sounds great :)
    I am an open source music programmer and I recomand you to make your program open source (eg: under GPL license). I think that many developers will make this program even better ( and will make music composers to worry :-)) ) .

    Paul, the author of ZynAddSubFX, PaulStretch, and other open source software

  19. Érico says:

    awesome, reminds me of algomusic on my amiga days, thanks some genius have done such works on days like these. Would be nice to be able to kick in some self made samples, maybe it can and it is just me… anyway congratulations!

  20. bambang pranoto says:

    cg is break my midi mind to open imagination - bravo - oh ups how file save transfer to midi base recording system like pro tools or abelton - ones again brovo

  21. James Plant says:

    Hello,
    I am a freeware game developer. I would be interested in using music generated by cgMusic in my games. The games would be distributed, but not commercially. Does this count as personal use? If not, can I get permission to use the music generated in my games? If you choose to reply, please reply to toilethumour#AT#merseymail#’DOT#com.

    Thank you for reading,
    James

  22. James Plant says:

    I forgot to mention, you would of course be fully credited. Unfortunately, I am unable to pay for a licence, if one is needed, as I have no method of transferring money over the internet.

    Thanks again,
    James

  23. yuri says:

    AWESOME!!

  24. James says:

    I came across this while doing some research into procedural/generated/computer music, very cool. Any chance of the (or some of the) source code being open source?

  25. Myron says:

    Very impressive results! I’ve done some work with algorithmic composition myself. My web application (fractalcomposer.com) generates music using self-similarity.

  26. Joe says:

    Nice results! Is your master thesis available somewhere online? I’d be really interested in reading it. Kudos for sharing this program.

  27. Valerio says:

    This is the best music generation software I have ever used. You are authentically a genius - really!

  28. Thomas says:

    I’m interested in this field of research. Can I download your master thesis anywhere?

  29. otaru says:

    you are the man , awesome program.

  30. jmc says:

    Hi,

    Would you be interested in sublicensing the system/idea ?

    Regards,

    jmc

  31. mmm says:

    “A computer can create hundreds of songs in a second but it will never be able to tell which one it likes the most.”

    So what if someone makes a program that can learn receiving input from human who can tell it what it has to “like”?

  32. rabt says:

    This is the best music generator software I’ve ever used. Period.

  33. Ralph Arscott says:

    Brilliant!

    after only a few hours mucking about I’ve made several enjoyable songs that really seem like they’ve been composed by a human.

    You may know of this already but there is a man who has developed software that can copy a musician’s style and then use it to elaborate upon a given musical theme. His name is David Cope.

    Here is a link to some of the compositions produced and I think they are very good (particularly the Bach piece).

    Thanks for the brilliant and interesting software!

  34. Ralph Arscott says:

    Sorry, forgot the link.
    Here it is: http://arts.ucsc.edu/faculty/cope/mp3page.htm

  35. Katie says:

    This seems like an interesting project, but it’s a shame you’ve only targeted Windows so far. Might I suggest opening the source on the port-resistant interface bits, if not the entire project?

    I’m sure you’ve done a good enough job of writing portable code for the internal bits, and I know more than a few Linux users (myself included) who would love to tinker with this!

  36. Ralph Arscott says:

    Do you know of any fancy synthesizers to use?

  37. Ed says:

    Is is possible to you to send me the orchestral score of “hapsi_s90es.mp3″ and the choral score of “piano_gigastudio.mp3″?? (if available, please) or how to generate them exactly on the CgMusic software. I’m very interested on the quality of those pieces and I would like to analyse them in detail.

  38. Maciek says:

    Hi Ed. You can simply download the piano.mid and hapsi.mid attached in my post and use any program that can print midi files as music notation. The project files are also distributed with cgMusic so you can also load them yourself in the app and save to midi. Best regards.

  39. JJ says:

    Hello. Great piece of software. I’m wondering if there is any way possible to batch export multiple randomly generated pieces without having to change everything by hand each time. Any help is appreciated. Thank you again for such wonderful work!

  40. Ed says:

    Hi again, thanks for the reply, but I have problems running CgMusic, it says that MSVCP70.DLL is missing… (both in windows xp sp3 and windows 7 rc). Any suggestions?

  41. Maciek says:

    I’m not really sure what the problem with MSVCP70.DLL is. As far as I remember cgMusic should not require it. But then again I might be mistaken as it was quite some time ago when I compiled the program. Anyway, you could try installing the Microsoft VC Runtime libraries. You can find it here:

    http://www.microsoft.com/downloads/details.aspx?FamilyId=32BC1BEE-A3F9-4C13-9C99-220B62A191EE&displaylang=en

    I hope it helps.

  42. sr says:

    Excellent quality of music generated. the expert system rules should be well formed given that it is possible to produce human like output from randomization.Would be nice to read the master’s thesis. is it available on the web?

  43. Maciek says:

    Thanks for the good words, sr. Unfortunately the thesis is only available in Polish language and only in the building. Unfortunately this is the current policy as they had problems in the past with people stealing and selling works to students of other schools.

  44. Progress Report #5 « A New Music says:

    [...] cgMusic A freely-available and unpublicized software, cgMusic is the gem of all algorithmic composition tools that I have found so far. Maciej Biedrzycki created this flexible architecture that uses a scripting engine and expert systems to generate coherent music. A very impressive demonstration of algorithmic composition. [...]

  45. Per says:

    Hello,

    I have translated the documentation with the help of Google’s language tools and the result is surprisingly good.

    Great program!

  46. Zachary says:

    This is very interesting. I can create a random siong, export as a midi file, then import the midi file into guitar pro 5, and i have an instant guitar riff(mayby not the best, but how easy!) This software wold be great if t contained different scales (aeolian gypsy pentatonic) woud it be possible to add them into the program… if so, how woud I.( i have no programming knowledge, but im a quick learner) I would even consider paying for a program which would have the different scales. Please respond!

  47. vo says:

    This is one of the best music software ever created.

    It would be wonderful if you could continue its development or, alternatively, open the source, even with a restrictive licence.

  48. Dave G. says:

    Is it possible to use the midis generated by this software commercially, or is it just for personal use? And if only for personal use, do you ever plan to release a program that can be used commercially?

  49. Martin says:

    Hi! I met Philip Glass (well, I saw him in a restaurant once or twice) and other celebrity composers, but your software is the COOLEST among em all! Genius, thanks! It beats the best of Eno or Nyman anytime!

Leave a Reply