Emacs is a really powerful tool for Clojure development, although without a guiding hand it can be a bit of a learning curve. Using the Emacs Live its really simple to get a fully featured development environment for Clojure. I will show you how to get Emacs Live installed and how to start using it for Clojure.
Emacs is fun to configure and if you have the basics of LISP or Clojure then its pretty easy too. After reading how to replace the text on the modeline I decided to customise my mode-line to make it more efficient for Clojure development. I’ll cover how I tweaked the mode line and added this customisation to my Emacs Live based configuration.
Even though I use
.gitignore files to control common files that should not be committed to a git repository, its very easy to forget about the backup or temporary files that my development tools generate. As these auto-generated files are development tool specific, they are not always included in a
Especially when you are under pressure to commit changes or deploy your code its easy to include a few things you dont need, especially when using the commands
git add . or
git commit -am "".
So when I discovered the idea of using a
.gitignore_global file, I quicky adopted this and saved myself a lot of time with this simple approach.
So as soon as I decided to write about LightTable, the developers go and improve a whole bunch of things. With the 0.2.3 release that happened earlier today the configuration of LightTable now works correctly.
This change is going to make it so much easier to use LightTable for demo’s and coding dojo’s. The has been an update to the default solarized light theme that looks very pretty to me.
LightTable aims to give developers instant feedback about their code, showing how any change affects their applications. Giving you a developer “surface” to work on, which will bring information to the places you need it the most. The principles of the LightTable design include:
- Documentation there when you need it, no need to search
- Edit anywhere and anything - not just text and not just as files
- Discover by doing, changes produces instantaneous results
- Shine a light on related pieces of code
I was a little surprised to have an access issue with Heroku when using my new Mac Book Pro, as its always been really easy to deploy my applications to Heroku in the past. I kicked myself when I realised I’d only set up a public key specifically for my Github account.
This got me to wondering the best way to set up keys given I am using different services for both personal project and work.
The August 2012 coding dojo for the London Clojure community brought some creativity to bear, in terms of Clojure, artistic sentiment and a little bare face cheek.
After the usual round of votes for the evenings challenge - which included grand ideas such as re-implementing Emacs in Clojure! - we settled on a poem generator. Here is what we got up to.
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!
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.
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..
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.
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
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
Extreme startup is a practical workshop which simulates the excitement and insanity of working for a high pressure startup company, where every decision (or lack of) can make or loose you money - or in this case points!
Lets delve deeper into the misteries of this kind of coding workshop.
Whilst Github is a great way to share a whole repository of code, sometimes you want to talk about the design and challenges of developing your code, that discussion is often best done in a blog post.
So how do you put your lovingly crafted Clojure code (or anything else) into a blog so that it looks as beautiful as it does in Emacs? Lets take a look at Github Gists.