For Lauren

Dynamically Arranging Music Box

This project was an attempt at creating interesting and natural sounding musical arrangements and progressions using a collection of pre-recorded instrument loops.

Simply combining together random instrument loops as the program ran resulted in something far too chaotic and often unmusical, therefore I designed the program around hand selected arrangements.  Each arrangement simply contained a list of instrument loops which would play in unison with each other when triggered which allowed me to limit the programs selections to only combinations of loops which I’d determined before hand sounded correct.  Additionally each arrangement contained a list of animation curves allowing me to animate parameters of each audio loop as the arrangement played.  Currently this is restricted to only volume automation, however this provided enough to create natural sounding transitions and cross-fades, and to chop up loops to create more variation.

Next it was apparent that simply queueing up and playing random arrangements one after the next wasn’t good enough either.  Although at any instant in time the music would sound good, the transitions between arrangements were often too abrupt or made no musical sense.  Therefore for each arrangement I added a list of pointers to other arrangements it could safely transition too whilst still sounding musically correct.  In this way a directional connected graph of arrangements was created that the program could traverse to create interesting musical progressions.

Finally I added various properties to the arrangements such as their intensity level and which sub section of music they belonged to and had the program use these to track various statistics of what it was playing and had recently/previously played.  This statistical data was then used to bias the selection of the next arrangement in the connected graph in order to introduce more meaningful meta structure into the songs progression.  In this way the program will try to choose appropriate arrangement transitions to create meaningful builds and releases of tension and to keep the program travelling through the different musical sections and bridges without lingering too long on any one section.


There are still some issues with the results and some improvement I’d like to make.  For a start, Unity doesn’t offer timing functionality with a high enough precision to always prevent jumps or gaps in the audio between transitions.  To combat this I made efforts to ensure that there were no rapid volume automation changes towards the beginning or end of an arrangement, and in some places I constructed small cross fades in order to try and temper the most troublesome transitions.  It wasn’t possible to completely eliminate audio stutters 100 percent of the time this way though.  If I had access to Unity Pro I could likely get around this problem by creating a high precision timing plug-in, but at the moment I’m only the free edition which doesn’t allow for custom plug-ins.

Secondly, although I think the program is able to hold a users interest for a reasonable length of time considering the small number of individual instrument loops used, after extended listening it becomes obvious that the program only really contains two main musical sections or themes and two small bridge sections.  In the future I’d like to add more loops and arrangements to create more sections.  This will likely also involve having to deal with the issues of key and tempo changes which the program currently doesn’t deal with.  In addition, if I upgraded to Unity Pro I could introduce more automation parameters to control audio effects such as reverb, delay, chorus, etc to enable me to create even more variation with the same number of loops.

Leave a reply

Fields marked with * are required