Technique for Playing Drum Samples in Pattern

Hey all,

Long time off and on dabbler in Sonic Pi here. I’ve committed to a 2hr seminar for some high school students in March, so time to pro up a bit. :slight_smile:

I noticed a drum pattern technique in this DJ Dave performance that I don’t recall seeing before. I’ve read about rings and ticks but never seen a string used as a ring, or used to create drum patterns.

live_loop :met do
  sleep 1
end

define :pattern do |pattern|
  return pattern.ring.tick == "x"
end

live_loop :kick, sync: :met do
  with_fx :bitcrusher do
    sample :drum_heavy_kick if pattern "x--x--x---x--x--"
  end
  sleep 0.25
end

Coming from more of an Ableton background, it resonates with me as a nice way to pattern different drum samples, change them up live, etc. I’m wondering if this technique is documented anywhere? Is it common? Is there a ‘better’ way?

Cheers and Thanks,
Nick

Hey Nick,

Nope, not really. It works, but it’s not an ‘official’ Sonic Pi technique :slight_smile:

There are a bunch of people that use this idea - whether it’s common is harder to answer :grinning_face_with_smiling_eyes:
I’d say at least that it’s popular with folks that want to work with a more visual style of pattern representation.

Well, there’s no right or wrong here… it comes down to personal preference! :grinning_face_with_smiling_eyes:
There are a handful of interesting ways based on the same idea that other folks have used to represent grid patterns - here’s a few more:

2 Likes

Thanks for the great links @ethancrawford! Starting to see that a list might be a little easier to manage syntax-wise.

Also a bit inspired by this performance by Jindřich Mynarz:

  • Use of spread for drum patterns
  • Use of ring and tick to influence the played amp to create rhythms

Lots of ways to skin this. Thanks again!

-Nick

3 Likes

Hi,
I liked the idea with the x–x patterns, but I wanted something to influence :amp. I came up with this

use_bpm 60

live_loop :kick do
  sample :drum_cymbal_closed, amp: "600203500909".ring.tick.to_f / 4.5
  sample :drum_cymbal_pedal,  amp: "000700000900".ring.tick.to_f / 4.5
  sample :drum_heavy_kick,    amp: "600009900002".ring.tick.to_f / 4.5
  sleep 0.25
end