Skip to content

Instantly share code, notes, and snippets.

View samaaron's full-sized avatar

Sam Aaron samaaron

View GitHub Profile
Graeme has been making a nuisance of himself on the Internet and in various
open source communities since 1992 when he managed to blag a 9k6 modem from
school. However, he didn't discover Ruby until late 2005 when he was frustrated
with Zope (Python's only web framework at the time) and heard about this
thing called Rails.
Graeme was so impressed with Rails (and Ruby) that he quit his day job and
started his own company, Rubaidh, so he could work with it full time. Since
then he's worked with a variety of companies – from tiny startups to
household names – using Ruby to deliver awesome software.
@samaaron
samaaron / tarai.clj
Created December 2, 2011 13:55 — forked from kawabata/tarai.clj
tarai mawashi in overtone
(ns tarai.core
(:use [overtone.live]))
;; basic.clj より
(defsynth foo [freq 200 dur 0.5]
(let [src (saw [freq (* freq 1.01) (* 0.99 freq)])
low (sin-osc (/ freq 2))
filt (lpf src (line:kr (* 10 freq) freq 10))
env (env-gen (perc 0.1 dur) :action FREE)]
(out 0 (pan2 (* 0.1 low env filt)))))
@samaaron
samaaron / core.clj
Created December 11, 2011 00:04 — forked from deltam/core.clj
Overtone jingle bells
(ns overtone-chrismas.core
(:use [overtone.live]))
(definst beep [freq 440]
(let [env (env-gen (perc 0.1 0.2) :action FREE)]
(* env (sin-osc freq))))
; ドレミの周波数を定義
(def doremi {:none 0
:do :c3
@samaaron
samaaron / bells.clj
Created December 12, 2011 15:20 — forked from jennifersmith/bells.clj
Cheesy Holiday Music and bell synthesis example
(ns overtone-xmas.bells
(:use [overtone.live]))
;;tested in Overtone 0.6-dev
;;add [overtone.sc.machinery.defcgen] to ns :use clause for 0.5.0
;;http://computermusicresource.com/Simple.bell.tutorial.html
(def dull-partials
[
0.56
@samaaron
samaaron / sun-flare-thingy.clj
Created June 7, 2012 19:21 — forked from quephird/sun-flare-thingy.clj
Quil: sun-flare-thingy
(ns sun-flare-thingy
(:import [processing.core PApplet PConstants])
(:use quil.core))
(def screen-w 1920)
(def screen-h 1080)
(defn- compute-stroke-color [x1 c1 x2 c2 x]
(map #(/ (+ %1 %2) (- x2 x1)) (map #(* (- x2 x) %) c1) (map #(* (- x x1) %) c2)))
(ns square-exploration
(:use quil.core))
; This is another blatant ripoff, this time of the images produced
; by Don Relyea here: http://algorithm.posterous.com/tag/algorithmicexplorationofsquares
; This code needs some serious refactoring, particularly the screen metrics.
; Stay tuned...
(def screen-w 1000)
@samaaron
samaaron / pleiades.clj
Created June 13, 2012 12:27 — forked from quephird/pleiades.clj
Quil: pleiades
(ns pleiades
(:import [processing.core PApplet PConstants])
(:use quil.core))
(def screen-w 1920)
(def screen-h 1080)
; TODO: Need to apply blur to entire background; stars look too fake here
(defn- generate-background-stars []
(doseq [_ (range 1000)]
(ns mondrian-factory
(:use quil.core))
(def screen-w 1920)
(def screen-h 1080)
(defn- red-yellow-blue-or-white []
([[255 0 0] [255 255 0] [0 0 255] [255 255 255] [255 255 255] [255 255 255]] (int (random 6))))
(defn- generate-positions-and-widths [n]
@samaaron
samaaron / markov.clj
Created September 6, 2012 07:23 — forked from kelsey-sorrels/markov.clj
Overtone Internal Sequencer with Markov chains
(ns overtone.examples.internal-sequencer
(:use [overtone.live]))
;; A fully server-side sample sequencer.
;; =====================================
;; This example demonstrates some of the benefits of moving all synth
;; triggers inside the server itself. For example, it allows you to
;; modify the synthesis with *immediate* effect (rather than waiting for
;; the next bar/chunk to be scheduled) and you can use a global pulse to
define :mockingjay do
use_synth_defaults release: 0.7
play 91
sleep 0.6
play 94
sleep 0.6
play 93
sleep 0.6
play 86
end