Programmable Music Overtone – from Installing to Playing songs

Composing music by programming language was my dream.
Omg, there’s already such a tool…(-_-)
Today, I’ll introduce the dream tool “Overtone”.

By the way, there are also similar projects: SuperCollider, Sonic Pi, Takt.
If you just wanna generate MIDI data, I recommend Takt.
It’s easier but you can also control velocity.
However, I wanted an oscillator, so I didn’t chose Takt.

SuperCollider has been used since a long time ago.
Overtone and Sonic Pi uses SuperCollider.
SupperCollider let you use its own language, but you can use Clojure for Overtone, Ruby for Sonic Pi.
Sonic Pi is made for education too.
So it’s easier and simpler than Overtone.
I prefer more geeky, so I didn’t chose Sonic Pi.

Once I chose SuperCollider but I thought it’s complicated to compose with SuperCollider by vim.
I think it’s easier to use its own IDE.
I prefer using text editor, namely vim lol.
Using vim for composing is sooo cool for me.
Thus I decided to use Overtone.

Overtone use SuperCollider, but maybe it doesn’t mean it needs to transpile.
Client side and Server side are separated in SuperCollider.
It means it’s okay to use different language for client side as long as it exchange message appropriately.
So it’s still happy hacking.

Installing

Overtone works by Clojure.
So install clojure at first.

$ brew install leiningen

Make a project wherever you want.

$ lein new tutorial

Next, add a dependency in project.clj.

$ vim tutorial/project.clj
(defproject tutorial "1.0"
  :dependencies [ [org.clojure/clojure "1.8.0"]
                  [overtone "0.10.1"] ])

Install dependencies in the directory.

$ cd tutorial
$ lein deps

Live Coding

Let’s do like live coding.
Start REPL.

$ lein repl

Addition

user=> (+ 1 2)
3

Let’s make a sound.
Start Overtone.

user=>(use 'overtone.live)

If you input below, it sounds.
So please be careful your around.

user=>(demo 7 (lpf (mix (saw [50 (line 100 1600 5) 101 100.5]))
                   (lin-lin (lf-tri (line 2 20 5)) -1 1 400 4000)))

Woow, cool!
I can hear you!

Play songs

Let’s download repository Chris Ford made.

$ git clone https://github.com/ctford/whelmed.git
$ cd whelmed
$ lein run
...
Exception in thread "main" java.lang.Exception: Unable to read file - perhaps path is not a valid audio file

Seems WAV file is too big to download by git.
Make it able to clone big file.

$ brew install git-lfs
$ git lfs install
Git LFS initialized.

Clone again.

$ git clone https://github.com/ctford/whelmed.git
$ cd whelmed
$ lein run

Wooow, coool!
I feel so happy just by playing a song.
How long does it take to compose a music!?

Impression

I feel configurations are smaller than SuperCollider
I prefer Overtone.
I’ll continue to introduce Overtone.

I still don’t know how to make files and play it so far.
Also I’m not familiar with clojure.
Next time, I’ll try to introduce how to make a template.

Anyway, is it going to be popular?
Maybe…, not.
I’ll try to keep on challenge.

However, I think generating MIDI and loading to other DAW and make it cool is more realistic for awhile.
A song composed by Overtone tends to sound like a game music in 80s in my opinion.

References

Welcome to the Overtone Wiki
Getting started with Clojure and Overtone | Simon Owen | Front-End Developer
高機能な音楽プログラミング言語Takt – 丸井綜研

Leave a Reply

Your email address will not be published. Required fields are marked *