Skip to content

Instantly share code, notes, and snippets.

View SnowBird27's full-sized avatar

SnowWolf SnowBird27

  • Asheville
View GitHub Profile
live_loop :anything do
sample :loop_amen, rate: 0.5
sleep 3.5
end
live_loop :anythingyouwnat do
play (scale :e3, :minor_pentatonic).tick(:foo), release: 0.1
sleep (ring 0.125, 0.25).tick(:bar)
end
sleep 8.5
live_loop :anythinguwant do
sample :loop_garzul, rate: 0.5, finish: 0.25
sample :loop_industrial, beat_stretch: 4, amp: 1
sleep 4
@amosr
amosr / drum.rb
Created January 2, 2018 05:51
sonic pi
# random drum machine
# an array of times for when samples should play
# we'll have a corresponding array for which
# sample to sound at a particular time
def times_beat(i)
# beats, quarter beats, and triplets
times_one = [0, 1.0/4, 1.0/3, 1.0/2.0, 2.0/3, 3.0/4]
times_one.map {|j| j + i}
end