EDIT: I think I answered my own question, after shutting down Sonic Pi and booting it up again it seems to now use the appropriate index values. I think it was because I altered the contents of the folder my code was pointing to.
I’m having a bit of a problem loading in sample libraries where sometimes it works and sometimes it doesn’t. Right now when I debug the code it’s saying “no match found, skipping.”
What I’m attempting to do is add something to the top of my code that loads up the folders which contain my homemade samples:
#LOAD IN SAMPLE LIBRARIES:
sampDrum = “/Users/sheamkennedy/Desktop/Sonic Pi Files/SPi - Samples/Acoustic Drums”
sampSFX = “/Users/sheamkennedy/Desktop/Sonic Pi Files/SPi - Samples/Retro SFX”live_loop :kick do
sample sampDrum, 3
sleep 0.25
endlive_loop :sfx do
sample sampSFX, 0
sleep 1
end
Currently I hear no sound. I know that my drum folder contains five samples so I’d assume that their index values would be 0-4. And I know I have 10 samples in the SFX folder so I’d assume their index numbers would be 0-10. This does not seem to be the case. In past projects I have similarly loaded up a folder and used the values 0 to (#number of samples - 1) in order to find my samples so I don’t know why this isn’t working now…
I should point out that I know I can specify the sample name that I’m looking for. I do not want to do this. I prefer to work with number values so I can easily swap out samples by changing their number value since I can’t be bothered to remember hundreds of sample names.
I wonder if this has something to do with me added, replacing and removing samples from these folders…?