Skip to content

Instantly share code, notes, and snippets.

@xavriley
Created May 21, 2017 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xavriley/44b4908dc3573744928b099f51af772e to your computer and use it in GitHub Desktop.
Save xavriley/44b4908dc3573744928b099f51af772e to your computer and use it in GitHub Desktop.
Rhythm ladder in Sonic Pi
use_bpm 100
live_loop :ladder do
bars = 2
no_of_beats = [1, 1.5, 2, 3, 4].map {|x|
[x, (4 * x.to_f)*bars]
}.flatten
count = (knit *no_of_beats).tick
sample :elec_tick
sleep (1/count.to_f)
end
@rbnpi
Copy link

rbnpi commented Jul 6, 2017

This if fun.
I put two ladders together with different map contents, and pan settings. Made one loop run twice as fast with 4 bars. Added some reverb and it's quite mesmerising!

  live_loop :rightdrum do
    use_bpm 100
    bars = 2
    #adjust map contents to taste
    no_of_beats = [1,1.5,3,2,3,2,3,1.5].map {|x|
      [x, (4 * x.to_f)*bars]
    }.flatten
    count = (knit *no_of_beats).tick
    puts "count1",count
    sample  :elec_flip,pan: 1
    sleep (1/count.to_f)
  end
  live_loop :leftdrum do
    use_bpm 200
    bars = 4
    #adjust map contents to taste
    #making the two maps different lengths allows progression
    no_of_beats = [2,1.5,0.5,1.5,2,1.5,0.5].map {|x|
      [x, (4 * x.to_f)*bars]
    }.flatten
    count = (knit *no_of_beats).tick
    puts "count2",count
    sample  :elec_flip,pan: -1
    sleep (1/count.to_f)
  end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment