EuroClojure - Developers Get Musical With Overtone

Sam Aaron and Jeff Rose gave a whirlwind tour of creating music with Overtone, an open source music generator written in Clojure.

You can define your own instruments, map keyboards and other synthesiser hardware, all to make some funky sounds - although you probably want to have headphones on when experimenting!

@samaaron with overtone you can sit on a train and make musicI had fun creating my first overtone project from scratch at the last Overtone Hackday. Have a look at how I set up my environment.

The Design of Overtone

Music is not a very easy concept to define in software. Typically you start with a synthesiser and work your way up to notes and chords. Eventually you may get to a music piece, but this is often driven by a hardware keyboard and recorded.

The difficulty is that everyone has a different idea of how to describe music.

Overtone comes in two parts. The Super-Collider generates all the sounds from over 500 midi building blocks, essentially you create a directed graph that returns values to represent those sounds. The clojure project part allows you to define instruments (synthesisers) and orchestrate these instruments together.

Basic approach to making music

Overtone generally works on the principle of subtractive synthesis. You create a number of different sounds by defining individual instruments and by adjusting the time and frequency of the sound wave to vary the sounds produced.

Once you have some instruments, then adding an envelope generator will give you a changing sound through time by, essentially multiplying the sound by the envelope.

Join sounds together by creating a player function that takes a time and plays the instruments - adding durations to the sound.

To spice up your sounds you can then experiment with playing two different frequencies at the same time, referred to as multi-channel expansion. A resident low pass filter is also fun to experiment with.

Sam and Geoff showed off what they call the stepinator, which seems to emulate a square wave form which steps through a series of values over time. This created some Buck Rogers style music.

Eventually you will want to use an external keyboard or some hardware device to pay your music as calling functions over and over again from within the REPL will only get you so far. If you map functions, frequencies, etc to the external player controls then you can play your clojure code..

Getting Visual

To make the music come alive even more, you can use the Java processing framework. Instead of calling processing directly, you can use the clojure project Quil to visualise the overtone sounds, creating a sphere and controlling the size of the sphere with the different frequencies of the sounds.

Get collaborative

Sam and Geoff are trying out different ways of sharing the REPL so they can jam together. Many people are sharing their sounds on freesound.org, a collaborative database of Creative Commons Licensed sounds. Browse, download and share sounds

Get started

Read the Overtone documentation to get started or have a look at my setup on Ubuntu. Dont forget to experiment.

Thank you.
@jr0cket


This work is licensed under a Creative Commons Attribution 4.0 ShareAlike License, including custom images & stylesheets. Permissions beyond the scope of this license may be available at @jr0cket
Creative Commons License