I will add my two cents and join this discussion ; I have two strategies I frequently use:
In my ~/.sonic-pi/init.rb
(that’s the place for a Linux system) you can find e. g.:
define :beats do
beats = "~/projects/sonicpi/playground/audio/samples/loops/beats/"
end
Let’s assume this folder contains a sample named my_best_loop.wav
I then load it with:
live_loop :test do
sample beats, "best", beat_stretch: 4
sleep 4
end
I also have entries in the init.rb
like
define :beats do
collection = "~/a/sample/collection/with/subfolders/"
end
as shortcut to a folder which will contain subfolders with samples. Let’s assume the my_best_loop.wav
would reside in a subfolder called selected_loops
. It then goes this way:
live_loop :test do
sample , collection + "selected_loops", "best", beat_stretch: 4
sleep 4
end
That way I can reference a whole collection of folders (and samples) without the need to adjust my init.rb
all the time. But that’s a matter of taste and workflow.