Skip to content

Instantly share code, notes, and snippets.

View samaaron's full-sized avatar

Sam Aaron samaaron

View GitHub Profile
@samaaron
samaaron / jam.rb
Created December 26, 2016 22:13 — forked from poppingtonic/jam.rb
Sonic PI Livecoding Snippet #1
live_loop :lloop do
with_fx :reverb, room: 0.5 do
with_fx :compressor do
sample :bd_boom, amp: 10, rate: 1
end
end
with_fx :reverb, room: 0.5 do
with_fx :krush, amp: 2, cutoff: 100 do
with_fx :slicer, probability: 0, phase: 0.125, mix: 0.5 do
use_synth :dsaw
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
@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
(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 / 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 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 / 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)))
@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 / 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 / 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)))))