Skip to content

Instantly share code, notes, and snippets.

@samaaron
Created August 5, 2011 22:27
Show Gist options
  • Save samaaron/1128681 to your computer and use it in GitHub Desktop.
Save samaaron/1128681 to your computer and use it in GitHub Desktop.
Overtone example system
user> (use 'overtone.live)
_____ __
/ __ /_ _____ _____/ /_____ ____ ___
/ / / / | / / _ \/ ___/ __/ __ \/ __ \/ _ \
/ /_/ /| |/ / __/ / / /_/ /_/ / / / / __/
\____/ |___/\___/_/ \__/\____/_/ /_/\___/
Programmable Music.
Hello sam, may this be the start of a beautiful music hacking session...
nil
user> (examples dibrown)
:rand-walk (:ar) - Random walk through freqs with rate determined by mouse-x
nil
user> (examples dibrown :rand-walk)
[max 15, step 1]
max Max walk range. Increase to allow for higher freqs.
step Step size. Increase to allow for larger steps (will sound
more random)
Random walk through freqs with rate determined by mouse-x
Here we use dibrown to create an infinite sequence of values
between 0 and max where each successive value is no more than step
plus or minus the last value. This creates a walk-like effect. We
then pull out the values from dibrown using the demand ugen,
pulling at the rate defined by the impulse - which is between 1 and
40 depending on the mouse-x coord. Therefore, you can use the
mouse to speed up and slow down the walk.
(let [vals (dibrown 0 max step INF)
trig (impulse:kr (mouse-x 1 40 1))
freq (+ 340 (* 30 (demand trig 0 vals)))]
(* 0.1 (sin-osc freq)))
Categories: Example cgen
Rates: [ :ar ]
Default rate: :ar
Contributed by: Sam Aaron
nil
user> (demo (example dibrown :rand-walk))
8 ;=> Demo plays (with default params)
user> (demo (example dibrown :rand-walk :max 30 :step 3))
8 ;=> Demo plays (with specified params)
user>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment