Getting started with Clojure and Overtone
Continuing on from my previous post. I had a few issues getting up and running on my mac so thought I'd put a quick blog post up in case it helps anyone.
First I headed over to: https://github.com/overtone/overtone
And read this:
- Make sure you have a Java JDK version 6 or later.
- Download the lein script from the stable branch of this project.
- Place it on your $PATH. (~/bin is a good choice if it is on your path.)
- Set it to be executable. (chmod 755 ~/bin/lein)
- Run it.
Here's a bit more detail:
-
First off I tried in the command line
java -version
but this isn't what you're after. You need the actual JDK, I'm not sure how to check if you have this installed, but I was pretty sure I didn't so went to google and typedJava JDK download
and got to: https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html -
To download this, open the link in a new tab, copy the contents and save this to a file called
lein
on your local machine. -
I'm not sure if this is the correct way to do this, but it worked for me. I moved the file
lein
created in the previous step to the bin folder in the root folder of my machine, a handy shortcut is to open the Finder, thenShift+Cmd+G
then can paste in~/bin
to get to that folder. -
In Terminal (or I use iTerm, whatever you use for writing commands on the command line) paste in
chmod 755 ~/bin/lein
and hit enter so it runs. This will change the permissions of the file. -
To run it, in Terminal do
bash lein
and again hit enter so that commands runs.
I then then did lein new insane-noises
, cd insane-noises
, lein repl
, but got:
1 | ༼ つ ◕_◕ ༽つ⚡ lein repl |
For some reason not all the dependencies are included in the insane-noises/project.clj
file, to fix this I had to add in the dependencies manually, so changed the project.clj
file from:
1 | (defproject insane-noises "0.1.0-SNAPSHOT" |
to:
1 | (defproject insane-noises "0.1.0-SNAPSHOT" |
saved the file, then when I ran lein repl
the dependencies got downloaded and… woohooo!!!!! boom I'm in :)
1 | --> Loading Overtone... |
After this I was also able to clone Chris's repo: https://github.com/ctford/whelmed
I use some custom aliases to do this: g c [email protected]:ctford/whelmed.git
which is basically git clone [email protected]:ctford/whelmed.git
after that cd whelmed
, lein run
and now I get:
1 | ༼ つ ◕_◕ ༽つ⚡ lein run |
and this is now playing Chris's song, lovely stuff, especially like the shudder
sound.
I just need to try and find out what's going on with the *** ERROR: open directory failed '/Users/simonowen/Library/Application Support/SuperCollider/synthdefs'
error now and I'm set.
Nice chatting to Chris afterwards, thanks again!
Browse by category:
- apple1
- bash1
- browser1
- case study4
- chrome2
- chrome dev tools4
- clojure overtone2
- conference2
- css2
- dev tips1
- digihike1
- dotfiles2
- event4
- ffconf1
- freelance6
- gaming2
- health3
- hexo1
- https1
- jank1
- javascript1
- jobs1
- lego1
- mcrfred107
- nux1
- octopress4
- photography2
- raspberry pi1
- responsive web design1
- sass1
- screencast1
- speaking2
- svg4
- unplugged6
- upfrontconf1
- web development2
- webgl1
- wordpress17
- work51
- workflow16