RNBO on Raspberry play local audio file

consortium coop massif sonore's icon

Hello,
I'm trying to use my rpi as a simple media player.
I want to play files from a USB key connect to the Pi.
The absolute path of the file is: /media/pi/USBkey/sound1.wav
So i created a buffer object :

buffer~ test @file /media/pi/USBkey/sound1.wav

I disabled "Copy sample dependencies" from compiler.

I understand that RNBO copy file from my computer to the pi but how to play file stored on the pi ??

Thank's

Alex Norman's icon

Currently we only load files from your "datafiles" directory, defaults to "~/Documents/rnbo/datafiles/"

There is a preference in ~/.config/rnbo/runner.json called datafile_dir that can change this. So if you know you don't want to load files from anywhere other than the USBkey you could set it to that directory. After that, you need to associate the dataref to the file, which you can do via OSC or rnbo.remote. In rnbo.remote you'd set the attribute "data_ref/test" (based on the name of your buffer in rnbo) to "sound1.wav" if that is the name of the file you want to load and that file exists in your datafiles directory.

consortium coop massif sonore's icon

Thank you, it work's :D
Is there a way to assign file to the buffer inside the rnbo patch (by sending OSC to localhost ) ?

Alex Norman's icon

There isn't a way for a rnbo patcher to send OSC back to itself, you'd have to write a script to do that, something like listening to a parameter from a patcher and then sending an OSC message based on that.

One thing you could consider is having a number of buffer objects all loaded with the files you want to play and then you could use multibuffer to select which to use, and you can do that within your patcher.

Sjoerd's icon

I work with multibuffer and multiple buffer~ objects.

Eventually, I want to be able to choose from 16 different samples.

However, when I work with multibuffer in RNBO, while trying to compile the patch and upload it to the RPi, the target export gets stuck in 'compiling'.

The samples are very long, ambient pieces close to one hour. But even without copying the sample dependencies, it takes a long time. It is a relatively small patch: choose one of 16 samples and loop.

Is there a better way to play local samples? How do you think I should best proceed?