Skip to content

Instantly share code, notes, and snippets.

View samaaron's full-sized avatar

Sam Aaron samaaron

View GitHub Profile
@samaaron
samaaron / gist:1298534
Created October 19, 2011 14:57
Overtone ascii-art logos
1 _,,ddP"""Ybb,,_
,dP"' `"Yb
,d" .gPPRg,
d" dP' `Yb
d' 8) (8
8 Yb dP
8 "8ggg8"
8 __
@samaaron
samaaron / gist:1284485
Created October 13, 2011 15:17
basic sequencer
(ns overtone.studio.sequencer
(:use [overtone.live]))
(defn- play-sample
[samp time vol]
(at time (stereo-player samp :vol vol)))
(defn determine-time
[onset-time b-idx beat-dur num-beats]
(+ onset-time (* b-idx beat-dur)))
@samaaron
samaaron / gist:1128681
Created August 5, 2011 22:27
Overtone example system
user> (use 'overtone.live)
_____ __
/ __ /_ _____ _____/ /_____ ____ ___
/ / / / | / / _ \/ ___/ __/ __ \/ __ \/ _ \
/ /_/ /| |/ / __/ / / /_/ /_/ / / / / __/
\____/ |___/\___/_/ \__/\____/_/ /_/\___/
Programmable Music.
@samaaron
samaaron / gist:998970
Created May 30, 2011 14:26
soundcodr
(ns soundcodr.core
(:use [overtone.live]
[overtone.inst.synth]))
;;change these values to suit the environment:
;;------
(def NUM-SYNTHS 50)
(def LISTENING-PORT 57110)
;;------
@samaaron
samaaron / gist:869423
Created March 14, 2011 16:42
rxtx handler
(defn listen
"Register a function to be called for every byte received on the specified port."
([port handler] (listen port handler true))
([port handler skip-buffered]
(let [raw-port (:raw-port port)
in-stream (:in-stream port)
listener (reify SerialPortEventListener
(serialEvent [_ event] (when (= SerialPortEvent/DATA_AVAILABLE (.getEventType event))
(handler in-stream))))]
(ns foo
(:require [loom.io.ubigraph :as ubi]))
(ubi/clear)
(def idxs (doall (take 500 (repeatedly #(ubi/call :new_vertex)))))
(defn rand-idx [els]
(rand-int (count els)))
(ns boiingg.core
(:use
overtone.live
[clojure.contrib.seq-utils :only [indexed]])
(:require [monome-serial.monome :as monome]))
(refer-ugens)
(boot)
(Git:master?) λ lein deps on master(38a6c98)
Downloading: org/clojure/clojure/1.1.0-alpha-SNAPSHOT/clojure-1.1.0-alpha-SNAPSHOT.pom from clojure
Downloading: org/clojure/clojure/1.1.0-alpha-SNAPSHOT/clojure-1.1.0-alpha-SNAPSHOT.pom from clojure-snapshots
Downloading: org/clojure/clojure/1.1.0-alpha-SNAPSHOT/clojure-1.1.0-alpha-SNAPSHOT.pom from clojars
Downloading: org/clojure/clojure/1.1.0-alpha-SNAPSHOT/clojure-1.1.0-alpha-SNAPSHOT.pom from central
[null] An error has occurred while processing the Maven artifact tasks.
[null] Diagnosis:
[null]
[null] Unable to resolve artifact: Missing:
[null] ----------
#!/usr/bin/ruby -wKU
require 'rubygems'
require 'ya2yaml'
$KCODE="UTF8"
lines = File.readlines(ARGV[0])
lines.map!{|l| l.gsub(/[;"\r\n]/, '').split(" ", 2)}
lines.map!{|m| [m[0], m[1].strip]}
lines.map!{|m| [m[0].split('-'), m[1]]}
∴ /Users/sam
λ rlwrap java -cp ~/.clojure/edge/clojure-edge.jar:~/.clojure/edge/clojure-contrib-edge.jar clojure.main
Clojure 1.2.0-master-SNAPSHOT
(ns your-namespace
(:require clojure.contrib.command-line))
java.io.FileNotFoundException: Could not locate clojure/contrib/command_line__init.class or clojure/contrib/command_line.clj on classpath: (NO_SOURCE_FILE:1)
your-namespace=>