Skip to content

Instantly share code, notes, and snippets.

@hzulla
Created December 11, 2015 23:52
Show Gist options
  • Save hzulla/bbc3773c1161912843f4 to your computer and use it in GitHub Desktop.
Save hzulla/bbc3773c1161912843f4 to your computer and use it in GitHub Desktop.
Sonic Pi: Make Peach the President
# make peach the president
#
# drumloop based on
# http://www.ethanhein.com/wp/2013/my-collection-of-transcribed-rhythm-patterns/
use_bpm 95
drumloop = {
:drum_bass_hard => [0,7,8,14],
:drum_snare_hard => [4,12],
:drum_cymbal_closed => [0,2,4,6,7,8,12,14],
:drum_cymbal_open => [10]
}
live_loop :drums do
for i in 0..15
drumloop.each do |d,b|
sample d if b.include?i
end
sleep 0.25
end
end
@emrox
Copy link

emrox commented Dec 12, 2015

d'n'b variation

use_bpm 160

drumloop = {
  :drum_bass_hard     => [0,7,9,14],
  :drum_snare_hard    => [4,12],
  :drum_cymbal_closed => [0,2,4,6,8,10,12,13,15],
}

live_loop :drums do
  for i in 0..15
    drumloop.each do |d,b|
      sample d if b.include?i
    end
    sleep 0.25
  end
end

live_loop :synth do
  sleep 4
  sample :bass_drop_c, amp: 1.4
  sleep 12
end

@hzulla
Copy link
Author

hzulla commented Dec 14, 2015

# make peach the president
#
# drumloops transcribed via
# http://www.ethanhein.com/wp/2013/my-collection-of-transcribed-rhythm-patterns/

use_bpm 95

drumloop = {
  "The Funky Drummer" => {
    "kick"      => "X.X...X...X..X..",
    "snare"     => "....X..X.X.XX..X",
    "closed hh" => "XXXXXXX.XXXXX.XX",
    "open hh"   => ".......X.....X.."
  },
  "Impeach The President" => {
    "kick"      => "X......XX.....X.",
    "snare"     => "....X.......X...",
    "closed hh" => "X.X.X.XXX...X.X.",
    "open hh"   => "..........X....."
  },
  "When The Levee Breaks" => {
    "kick"      => "XX.....X..XX....",
    "snare"     => "....X.......X...",
    "closed hh" => "X.X.X.X.X.X.X.X."
  },
  "Cold Sweat" => {
    "kick"      => "X.......X.X.....",
    "snare"     => "....X..X....X..X",
    "ride"      => "X.X.X.X.X.X.X.X."
  },
  "Take Me To The Mardi Gras" => {
    "kick"      => "X.........X..X..",
    "snare"     => "....X.......X...",
    "closed hh" => "X.X.X.XXX.X.X.XX",
    "bell hi"   => "X.X..X...X..X...",
    "bell lo"   => "....X..X..X..X.X"
  }
}

drumset = {
  "classic" => {
    "kick"     => :drum_bass_hard,
    "snare"    => :drum_snare_hard,
    "close hh" => :drum_cymbal_closed,
    "open hh"  => :drum_cymbal_open,
    "ride"     => :drum_cymbal_pedal,
    "bell hi"  => :drum_tom_hi_hard,
    "bell lo"  => :drum_tom_lo_hard
  },
  "elec" => {
    "kick"     => :bd_haus,
    "snare"    => :elec_snare,
    "close hh" => :elec_blip,
    "open hh"  => :elec_cymbal,
    "ride"     => :elec_blup,
    "bell hi"  => :elec_blip,
    "bell lo"  => :elec_blip2
  }
}

live_loop :drums do
  drumloop.each do |loop_name,loop_pattern|
    puts loop_name
    drumset.each do |drum_name,drum_sample|
      2.times do
        16.times do |i|
          loop_pattern.each do |drum,drum_pattern|
            sample drum_sample[drum] if drum_pattern[i] == "X"
          end
          sleep 0.25
        end
      end
    end
  end
end

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