Dynamically read new samples from folder into buffer in RNBO?

philipp kleinwort's icon

I would like to run a RNBO patch on a rasberry pi and read new samples from folders on an external USB drive.

In Max I'm loading a folder filled with samples into a polybuffer object by using the readfolder message and referencing a folder name. I can choose between the different folders by using a system of folders that stays the same. Then I load individual samples stored in the polybuffer object into a groove object by index. Like this, my samples can change, but the patch stays the same.

Can I do this in RNBO?

There is no polybuffer object in RNBO. So, as far as I understand, it is only possible to load individual files with fixed names, but not folders.

But there must be a way to do this, right?

I want to build a sampler using RNBO and a rasberry pi. The idea is, to load samples into folders on an USB drive, connect it to the rasberry pi and play the samples with a RNBO patch exported to the rasberry pi.

Right now, I can't figure out, how this could be done in RNBO.

I hope my question is clear and I would be happy to receive some feedback. Thank you in advance!

Jan M's icon

Hi Phillip,

AFAIK you can't access external drives with RNBO on a RasPi. You would need to include them as dependencies, when compiling.

Alex Norman's icon

You can't access external drives with the RNBO runner by default but you don't have to include the files as dependencies, you can copy them to the datafile_dir and then load them via OSC. That dir value defaults to: /home/pi/Documents/rnbo/datafiles/

We don't yet have a way to list the files within the datafile_dir in our HTTP+OSC setup, but maybe you already know the names of the files or you can write a custom script that runs on the rpi to do figure them out for you.

BTW, the datafile_dir location is stored in your preference json file which is by default here: /home/pi/.config/rnbo/runner.json
You might be able to set the datafile_dir value to point to your USB drive if you plan to always have it in when you startup your device, though I'm not sure what will happen if it isn't mounted by the time the runner starts.

Alex Norman's icon

We've talked a bit about adding the ability to some targets to load a "folder" of samples, it is something we're considering for the future but for now you'll need to make your own solution for it.

philipp kleinwort's icon

Thanks a lot for your reply Alex.

So if I get you right, I could set the path of the datafile_dir to my USB drive and then load samples from there either via rnbo.remote or OSC. What I don't understand yet: How could I change the reference of a data or buffer object? The file attribute is fixed which means I'm not able to set it via a set message, right?

My idea was to store a list of my files in a text file on the USB drive, load this list into rnbo and then select the files by index. At least I hope that would be possible.

Thanks for your help! I'm new to rnbo but really want to realize this project. There are no hardware samplers with multiple outputs available. So I would like to create one by combining a rasberry pi, a midi controller and an audio interface.

johnsabom's icon

Any development on this one? I would really need this function as well! Or would it be possible to use standard naming like 1.wav 2.wav etc and it would read the new file-sets on startup if I change USB?