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.
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?
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.
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:
(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…