Drums and bass loop (tips and comments appreciated)

I had a bit of fun with Sonic PI (work in progress here), but I feel I may be doing it “the hard way” :slight_smile:

Hre is a short list:

  1. The “roll” function feels like something I shouldn’t have to do myself, but I couldn’t find an idiomatic way to achieve the same thing.
  2. Also it feels weird to set the tempo to 480 bpm, to achieve something that sounds more like 120bpm. Is sleep 1 supposed to be one beat or a full bar? Is there any way to specify a time signature and use notations like full, half, dot, etc? Or define a meter for a loop and then just write the sequencer of notes?
  3. Is there any way to include external files / libraries without pasting them in a buffer?

I will appreciate review comments and tips, as well as pointers to articles/docs or interesting code that I can read.

P.S. I found Sonic Pi Online Resources - this would keep me busy for a while

1 Like

Hey @ddimitrov,

There isn’t a dedicated roll function, but the function that will probably be most useful for creating your own is density. (See details in the Lang section of the help panel). There are a handful of topics here on in_thread I can see that relate to a similar question:

(There might be others)…

The sleep function works with beats, so 1 beat.

Not that I know of, you’d need to assign durations to variables yourself - eg:

quaver = 0.5
crotchet = 1
dottedcrotchet = 1.5
minim = 2
semibreve = 4
minimquaver = 2.5

(Or whatever names you want to give them obviously).

As far as external files, yes! What you are after is run_file. Libraries on the other hand, such as Ruby gems, are not officially supported - you can try referencing them in Sonic Pi code, but there’s no guarantee they will work…

1 Like

hi @,

Just concerning the name of note lengths, Music Theory: Note Names, Rests & Dotted Notes - YouTube, it seems that american and British have different names :slight_smile:
here is a little example How to code this song on sonic PI - #5 by nlb