Skip to content

Instantly share code, notes, and snippets.

View xavriley's full-sized avatar

Xavier Riley xavriley

View GitHub Profile
@xavriley
xavriley / gist:c1c0d255e6f2f40dcdb4
Created October 15, 2015 07:35 — forked from darinwilson/SonicPiDrumMachine
Sonic Pi Drum Machine
#########################################
## Sonic Pi Drum Machine
## coded by Darin Wilson
## changed by Xavier Riley
##
use_bpm 95
in_thread(name: :drum_machine) do
# Live coding example for Retune conference 2014
# 1) Press Run (Cmd+R) to start
# 2) Make changes (e.g. comment in/out various lines in :beats & :amen)
# 3) Press Run again (changes will only be audible from next queue point)
# compute loop length (4 bars), bar & quarter note durations
dur = sample_duration :loop_compus
bar = dur / 4
quart = dur / 16