algorith-music

Algorithm Music: Everything You Need To Know

Considering music is supposed to be the epitome of creativity, the very notion of algorithm music seems ludicrous. Surely, you can’t program music! However, a glance beneath the surface reveals that algorithmic composition is very much alive and kicking.

Algorithm music covers a style of composition that allows someone to compose tunes to a particular program or sequence using a range of different methods and software to do so.

It has been a feature of music that has been toyed with for millennia. Many famous musicians in history have experimented with it in some form.

The modern-day setup has several different software platforms and technologies dedicated to the practice to aid daring composers. However, it is not as easy as someone may think. So do you need to be a rocket scientist or musical prodigy to understand how algorithm music works?

What is Algorithm Music?

It may not seem very common, but algorithm music is much more common than you may think. The premise behind algorithmic composition is simple: its music is generated by a program.

You can make algorithm music in many ways. It can be using specially designed software platforms, specialist file formats such as MIDI, or how you write the music itself.

How Old is Algorithm Music?

The idea of programmed music is something that far outdates all forms of modern technology. Some music historians initially believed the Ancient Greeks were the first to try this. Famous composers such as Ptolemy and Plato allegedly used sounds of nature to create this music. These natural formulas created unique tunes that always gave a predetermined sound.

It wouldn’t be until the classical eras where we would find the concrete idea demonstrated. Thanks to Mozart, we would see it next in some compositions known as “dice music.” Mozart’s system assigned different sections of music with numbers and then combined them to create new songs. A simplistic premise but indeed an early form.

Minimalist Magic


A real breakthrough in modern algorithmic composition came thanks to pioneers in minimalist music. Firstly, experimental pioneer John Cage took on the idea in his piece “Reunion.”

In “Reunion,” Cage played a chess game, recording different sounds for every individual move. Cage relayed the sounds back, orchestrating a pre-set tune by the game’s end. The result: a tune made solely by controlling the sounds made by corresponding movements.

What Was The First Computer-Generated Song?

In 1955, the University of Illinois would give birth to the first computer-generated song. Lejaren Hiller and Leonard Isaacson used the Illiac supercomputer to turn basic programming commands into a computer-generated piece. The tune, known as MUSICOMP, laid the foundations for others to try their new success.

One of those would be Iannis Xenakis, who took things to a whole new level in the 1960s. Xenakis tested methods by combining values into notes and using powerful processors to make calculations based on these inputs. The result allowed Xenakis to use these calculations to create short tunes.

These two cases would form the spine of algorithmic composition in two distinct approaches: stochastic and rule-based. The more straightforward “stochastic” rules use the platform laid out by Xenakis. Hiller and Isaacson’s “rules-based formula” method was a more detailed orientated process.

Either system works well but shows that algorithm music composers need to have a solid grasp of music theory and computer coding to get a final piece ready.

How To Understand Algorithm Music

Trying to become an algorithm music genius is not for the faint-hearted. You will need a solid grasp of both programming languages and linear theory to be successful.

While both fields are undoubtedly different beasts to master, the result is always the same. Michael Edwards, professor of electronic music composition at ICEM Folkwang University of the Arts in Essen, Germany, expresses this feeling below:

“You can certainly do algorithmic composition without a musical background, but it’ll be questionable as to what the musical sophistication that you end up with,”

“At the same time, it’ll be very hard to succeed if you have never coded before,”

So grasping the knowledge of both coding and theory is crucial before actually trying to compose anything. But what should you know?

Coding Knowledge You Need to Understand Algorithm Music

Coding is just like learning any physical language – it all comes with unique forms and rules. In this instance, you need to know one form of coding to use any modern algorithm software to create tunes. Luckily, most programs derive from three common types of coding: Java, Python & Haskell.

Java

Java is one of the most common coding formats around today – 97% of all websites will use it in some form. The great thing about Java is that its wide use and general versatility support almost all file types. Therefore, you can create songs in any format such as MIDI and XML, and it will still be usable. Many open-source software platforms such as JMusic use this platform for generating pieces.

Python

Python may be challenging to grasp, but it is one of the most rewarding to use in your projects. With python syncing well with other coding scripts and electronic constructs, it is an excellent base for anyone wanting to create music using external components or plug-ins. Python provides a great platform to create your composition if you’re going to use synthesizers or external controllers.

Haskell

Haskell is a coding form that gets straight to the point – it is a very functional programming language. Because it’s purely functional, there are no changeable variables or random numbers. It’s lightweight and straightforward, making it perfect for specific musical needs.

What Music Theory is Important in Algorithm Music?

Before diving head-first into creating your algorithmic masterpiece, you are best off thinking just what sort of song you want to make. Random combinations won’t get you anywhere. Still, some basic principles will take you a long way.

Having musical expertise is something that Prof. Edwards puts a significant emphasis on:

“you need more musical expertise than programming. The reason for that is composers are already adept at problem-solving with logic and devising processes for musical structure.”

With that in mind, what are the key areas of music theory that should you need to know?

Chord Progressions

To give your tunes some harmony, you need to try and install some form of chord progression into your system. A chord progression is fundamental in almost all forms of music.

You will hear the general I-IV-V form in different orders and combinations if you listen to most rock or blues songs. Layering this into your programming and algorithms gives you more considerable scope. By mastering this, you will allow pieces to become more intricate and advance as your skillset develops.

Markov Chains

A mathematical principle at heart, Markov Chains, defines that the previous event will determine what happens next. It’s a principle used in all walks of life:

  • Cruise control
  • Waiting times
  • Exchanging currencies.

For composers, utilizing this is relatively simple. It means that the following note selected will be influenced by the previous note and not sound awkward or incorrect. Very much built upon the stochastic system created by Xenakis in the 1960s.

Techniques for Making Algorithm Music

As good as knowing the theory, applying it successfully is another matter. When making algorithm music, you have to follow the rules and utilize them to make an actual tune. Doing this isn’t as tricky as it sounds. You can use several techniques to help diversify your songs no matter what software you are using.

Image Sonification


One of the easier ways to translate data into sounds is through a process called image sonification. Sonification is using an image to create a song by breaking it down into individual pixels. Given pixels make up all pictures, there are boundless opportunities here.

Before going any further, you should only consider using low-resolution images (pixelated images). High-quality images will have tens of thousands of pixels to sift through, making it an arduous project. A lower resolution image still has plenty of data. However, the process is much more streamlined.

There is plenty of specialist software to help convert the data over into sound files that you can use for your song. Using image sonification has many different uses for the music itself. You can use it to add a lot of variance to a piece. Whether it be the pitch or tempo, the sonification technique is a surefire way to add character to your creation.

External Plug-ins for Algorithm Music

Not everything has to rely on what sits on one piece of hardware, however. With so many advances in technology in the past few decades, you can now get dedicated plugins to support your generated tune.

External devices such as MIDI controllers or created synths give you much more flexibility about the sound of the piece itself. These plugins make their data – controlled by the composer – and then feed it back to the central platform that processes it. The individual can shape a piece to mimic or has a distinct feel to it.

MIDI Controllers

MIDI controllers are by far the most common plug-in available for shaping an algorithmic composition. Creators often design MIDI controllers like a typical instrument (i.e., keyboard). You play it, and the resulting information goes back to the software.

As these controllers mimic their real-life counterparts, you could almost faithfully recreate a pop song note for note. The resulting information will be sent to a MIDI software piece on your computer and collate all the data into the defined sequence.

It’s a technique known for creating polyphonic ringtones in the 2000s. It’s also suitable for auto-generating music for use on social media videos and profiles.

Mastering Random Factor Seeds and Outputs in Algorithm Music

For those who are more gifted in coding than music, there is an alternate method. This method involves controlling random factor seeds. It gives the computer a more free-range selection to play notes. But don’t let the word “random” fool use as it still very much a selective process.

As the computer randomly selects a number to an output, it essentially becomes seeded to a sound. It will then set off a new set of commands that syncs well with the previously selected sound forming a chain. By doing this, you then get the start of your composition.

Now, this is where things can get tricky. If you hear something you like, make sure you snapshot it. It can be a screenshot or writing down the seed commands themselves. Why do this? Most platforms will wipe the sound data out whenever you start a new seed command.

It’s unlikely you will hear the best combination the first time around. By running different outputs and creating different seeds, you will eventually settle on a combination that forms a great little tune. Saving the best combinations elsewhere prevents you from recreating the sounds you heard previously.

Once you have everything in place, you can line them up to create a piece.

Text vs. Visual Approach in Algorithmic Music 

When moving on to devising your algorithmic composition, you will need to choose a visual or text-based approach. The two methods both have their advantages but differ wildly in how you create the final piece itself.

What is the Visual Approach in Algorithm Music?

With many modern programs, it is more likely that you would opt for the visual approach. This approach sees you working in real-time to devise your composition. It means constantly working on the piece as the data is compiled to shape the finished product. As the data is crunched, you work on “patching” or editing the outputs to shape a coherent piece.

It gives a “live” feel to the composition as it forms changes as you go giving you more room to work as things progress. Of course, the end output might not always be what you intended. It can leave things sounding unpredictable and oddly incoherent should they be left unmonitored.

Many modern software packages, such as MAX MSP and PD, use this approach. It makes it a typical process nowadays for anyone looking to get into this area of electronic music.

What is the Textual Approach for Algorithmic Music?

For those looking for a more traditional approach, there is the textual method of coding. This method involves putting all the coding into place before crunching all the data. It gives anyone using Python or JavaScript greater control of the piece they create.

It doesn’t give users an immediate sense of what they are creating, but that isn’t bad. You can record the initial composition and then see what does or doesn’t work.

If something sounds good but doesn’t fit your end goal, you can save that section for another work. You can then go back and keep working until you get what you want.

It’s an approach that Prof. Edwards believes gives electronic composers an advantage over someone working using a more traditional score-based method as you can “generate, evaluate, re-code, re-evaluate.”

“Algorithmic composition allows you to manage these global processes several times on a daily basis,”

  • Professor Edwards

What is the Best Algorithm Music Software Available?

There are plenty of different software platforms for you to try depending on your preferred approach. Here are some of the leading contenders :

#1: JMusic

Developed purely for anyone using JavaScript coding, JMusic does what you might expect. It provides many options for generating sounds using data and has a vast toolset for composers to use. It also comes with a complete analysis suite. This suite allows you to review a final piece and make edits as and how you wish.

You can publish the results in various file formats:

  • MIDI
  • XML
  • MP3

It also works on any modern operating system.

#2: JythonMusic

JythonMusic is the leading program for anyone creating a song using python coding. It is an excellent platform for all forms of algorithmic compositions, offering various tools to help users develop pieces.

JythonMusic has dedicated tools to perform image sonification and supports multiple plug-ins such as MIDI controllers and electronic synthesizers. It is an excellent choice for anyone who has equal knowledge of advanced coding and music theory and has a more creative mind.

#3: MAX MSP

Developed in Paris during the 1980s, MAX MSP was one of the first graphical musical software packages available commercially. Designed to run on the original Mac, it has grown into a highly customizable platform. The current version allows composers to work on their pieces in real-time.

It has many different plug-ins and extensions to give users complete control over how they put their pieces together and shape every bit of their composition as it forms. MAX MSP is an excellent platform for creative minds to run wild.

#4: PureData

Taking a different approach, PureData is an open-source program. It gives users almost complete control over every single aspect of the creative process.

PureData supports multiple platforms of coding and gives a more visual interpretation of how everything plays out. It’s great to get into the nitty-gritty of creating the platform. PureData also has a strong user community.

#5: CSound

First developed in the 1980s, CSound was one of the first significant algorithm software generators released to the public. It is still a great tool to use regardless of its age.

It is a great all-around device that gives you complete control over developing your piece with support for multiple coding languages. Its file type is also highly durable, with tunes still customizable decades after file creation.

Valuable Applications of Algorithmic Music

To think that algorithm music is just a hobby for the creatively nerdy is a far cry. Algorithm music is in use for many purposes. You can use it to generate ad jingles to helping to ease sleep problems. It is part of many different industries.

Melomics

One prominent example is using modern apps to overcome a range of common problems. This concept was put into practice by the Melomics project, which successfully trialed this technology, integrating it into app form.

David Albaraccin, a Ph.D. student at the University of Malaga in Spain,  co-founded the project which worked with patients suffering from anxiety, stress, or sleep disorders.

“I think adaptive music is one of the best uses for automated composition.”

– David Albaraccin, Co-Founder of Melomics 

During his project, Albaraccin tweaked the app to work with their heartbeats to generate a musical response. This adjustment triggered a musical response that then synced with their performance, increasing its overall effectiveness.

It proved to be a successful venture for Albaraccin, who believes that the process wouldn’t be possible in real-time by a human composer.

“The computer does a job that is not feasible for a human to do, nor would they be interested in,”

– David Albaraccin

It’s also a platform that could give musicians open access to music too across multimedia forms. Melomics’ pieces were available to use with a Creative Commons License – meaning that anyone could use it without copyright claims.

This sort of approach could reduce the cost of producing music for an array of purposes. It is something that Dr. Albaraccin believes could have a massive impact on creative outputs in the future.

“It will definitely democratize and facilitate access to these samples. Creators will be able to use complete music pieces at no cost and incorporate them into their music videos,”

– David Albaraccin

Do You Think You Could Make Algorithm Music?


As you can see, there is quite a bit to master should you want to try becoming an algorithmic composer. It takes a good knowledge of music theory and computer coding to get your head around it fully.

However, the platform is a sub-niche that has plenty of support and software that can guide you in the right direction into forming an audible piece of music from a computer. By doing this, it shows that music isn’t all about pure creativity. Algorithm music is merely just mathematics coming to life!

Special thanks to Prof Michael Edwards.

Special thanks also to David Albaraccin and the Melomics teams.

Keep it on Bythebarricade.com for tons of interviews, reviews, articles, and photos! Also, “Like” By the Barricade on Facebook to never miss a post.

Similar Posts