Best way to share audio files between patches?


#1

I’ve been working on some patches that can read/write audio files to a shared folder (which I think is a good way to be able to let patches interact without needing to run simultaneously, kinda like the OP-1 tape recorder).

I’ve been using the ‘folder_list’ external to find all the wav files at the relative path …/…/Samples (which will be a folder in the root of the USB drive if the patch is in the Patches folder.
The nested folder in 3.0+ complicate this a bit as the root of the USB drive could be any number of directories up.
I’m thinking of changing this so the samples folder is in the same folder as the patches (so you could have different sets of samples for different patch subfolders, this limits the sharing to patches in the same folder though and the samples folder will appear in the patch menu).

I could also try using an absolute path (though it might cause problems if using the internal SD card), or maybe I could keep trying to go up directories (like …/Samples,…/…/Samples …/…/…/Samples) trying to find a folder with wavs in it.

Wondering if anyone has any preferences or ideas. I’ll also be making on some abstractions that should make it easy to add this to other patches ( and I’ll probably add the ability to record or play shared audio to some older patches) .


Recording to samplers in 1008
#2

I thought there was a folder named ‘media’ at root for this?


#3

Sounds like an awesome idea.


#4

you can put a media folder at the root level of drive (next to Patches folder):

/Patches
/Media

Then in the Media folder put a Samples folder or anything else you want to share.

This folder gets automatically linked to /tmp/media, so in your patch you just reference /tmp/media. The advantage of this is no relative paths (as you noticed will break if you have patches nested in sub folders), and it will work regardless of SD card or USB (the OS will link whichever one is being used)


Sampling functionality/limitations?
#5

That’s perfect. I’ll probably use /tmp/media/samples.


#6

Just getting started with Organelle, but have a lot of linux behind me. I don’t know (yet) how much Organelle works most linux systems, but on most, the “/tmp” directory and everything in it is lost when you reboot. If you’re OK with that for your audio file storage, then great. Otherwise, you’ll need to find someplace else to store the data. Also, FWIW, “/tmp” is a memory based file system, so putting things into it occupies some of the RAM of the system, which takes away RAM available for other apps and for system use.

Hope this is helpful,
–Joe


#7

This is true, however in this case /tmp/media is merely a symlink to /usbdrive/media or /sdcard/media (depending on storage being used, usb if a drive is inserted, sd otherwise). The symlink is created when a patch is started.