Making Music With Clojure And Bananas

At this point, the banana piano is a pretty classic hack. The banana becomes a cheap, colorful touch sensor, which looks sort of like a piano key. The Arduino sets the pin as a low-level output, then sets the pin as an input with a pull up resistor. The time it takes for the pin to flip from a 0 to a 1 determines if the sensor is touched.

[Stian] took a new approach to the banana piano by hooking it up to Clojure and Overtone. Clojure is a dialect of Lisp which runs in the Java Virtual Machine. Overtone is a Clojure library that provides tons of utilities for music making.

Overtone acts as a client to the Supercollider synthesis server. Supercollider has been around since 1996, and provides a wide array of sound synthesis functions. Overtone simply tells Supercollider what to do, letting you easily program sounds in Clojure.

The banana piano acts as an input to a Clojure program. This program maps the banana to a musical note, then triggers a note on Overtone’s built-in piano sampler. The result is a nice piano sound played with fruit. Of course, since Overtone and Supercollider are very flexible, this could be used for something much more complex.

After the break, a video of the banana piano playing some “Swedish Jazz.”

12 thoughts on “Making Music With Clojure And Bananas

    1. Are you saying…you DON’T want a banana keyboard?
      But seriously, I actually tested this too randomly w/ a cap. touch sensor and thought, “hmm, banana has capacitance or it’s flowing from my hands thru the banana. Neat.”. And you’re welcome for a worthless story lol.

Leave a Reply to phosphor Cancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.