hi there. newbie here.

i'm trying to build a kind of mellotron/looping sample instrument.
the idea is to have twelve loops running continuously, and to map a single octave keyboard to twelve volume sliders, so with a key press you hear the loop where it is at that moment in time (aka no relaunch of the sample.)

i tried doing this with a Robertsonics Wav Trigger but i had some issues where i bumped into the limitations of the hardware. so i'm giving it a go on the Bela using Pd, since i'm (sort of) okay with Pd as a platform. i'm no expert by any means, but i can mostly get Pd to do what i need 🙂

i have a basic proof-of-concept Pd patch that works - i have 4 loops running from [readsf~] objects and i'm controlling 4 volume sliders with hardcoded attack and decay ramps (for now.)
(i already downloaded the Dynamic Load Files patch, so i'm prepared for further expansion, hah.)

now, the problem 🙂
i'm running everything off the eMMC, but ideally i would like the sample files to be on an external SD card, for several reasons:
- the loops i plan to use are rather large audiofiles (longest is +-10 minutes)
- i'm hoping to implement a Wav Trigger style sample naming system that allows for multiple soundbanks, limited only by SD card capacity
- that gives me the option of having multiple SD cards with different sample sets.

i know Pd wants to see the samples in the root directory, so i don't know how to go about making this work.
i looked into 'accessing the other card' but i couldn't quite get my head around making that work with Pd (or otherwise.)

any pointers would be greatly appreciated.

This can be done, however I think the SD card may have to be formatted in a special way to ensure there are no issues at boot. I will have to look at my notes/sample SD card when I can find them. The way to access the files would then be to specify the full path to the file (e.g.: /mnt/sdcard/samples/mysample.wav). It is also possible that you can use Pd's [declare -stdpath /mnt/sdcard/samples/] so that you only need the filename.

hey giuliomoro,
thanks for that!

(what do you mean by 'formatting in a special way'?)

i assume the declare object adds a standard read path to Pd?
will it remember that (aka run once) , or do i use a loadbang and declare at every startup?
and this would overrule the 'Pd needs to read files from the root directory'?

if so, then using [declare] would probably be the most convenient option..

    Remork assume the declare object adds a standard read path to Pd?
    will it

    Yes. Check the help file in Pd. It works for abstractions, but I am not 100% sure it applies for audio files as well, that's why I suggest you test it.

    Remork (what do you mean by 'formatting in a special way'?)

    It's complicated. Let me get back to you.

    my laptop, you mean? OS X Sierra.
    or did you mean the Beaglebone? because i wouldn't know 🙂

    Right, so I have done a few tests and it seems you can simply use macos's Disk Utility to format the SD card as a single FAT32 partition and there you go.
    The SD card has to be inserted in the reader before you power on the board.

    I wrote some more instructions here.

      giuliomoro
      that was a whole lot less complicated than i expected 🙂
      thanks for checking that!

      i'll see when i can run some tests - new year's eve first.
      have a good one!

      5 days later

      hey giuliomoro

      i'm following your instructions, using mac's terminal.
      i got so far as mounting and accessing the SD card i want to use..
      it's only got one file on it, but i see that listed in Terminal so that appears to work.

      however, i'm stumped at the next step:

      " - save the configuration so that it mounts automatically, on boot or on hotplug:
      edit /etc/fstab and add the following line:
      /dev/sda1 /mnt/usb auto defaults,nofail 0 2 "

      (or, in my case: '/dev/mmcblk0p1 mnt/sd auto defaults,nofail 0 2' ...?)

      i have absolutely no clue how to 'edit /etc/fstab', and what i come up with through the search on the forum or google only makes me more confused.
      i tried just running that last line in Terminal, but i get a 'mmcblk0p1: Permission Denied' message. thought i'd try 🙂

      i'm sure it's something relatively simple that i'm missing, but i'm lost here.
      any chance of some pointers, kindergarten style?

        Remork try

        nano etc/fstab

        nano is an editor that runs in terminal.

        that. is . amazing.

        nano /etc/fstab
        works!

        i added
        /dev/mmcblk0p1 /mnt/sd auto defaults,nofail 0 2

        and tried unmounting and mounting the SD card.
        all seems fine.

        now for a reboot..

        Well - it's still amazing after the reboot 🙂

        the nano hint was a lifesaver.
        thanks a million!

        so i can now run a testpatch, playing back audio from an external SD card.
        that's insane. haha 😛

        next thing to tackle would be installing some externals/libraries..
        i've got my _main.pd patch just about ready to go, but i'm using some externals from the HCS lib -
        [folder_list] and [debounce], for starters.
        i can't get those to play nicely yet, but i'll tag that onto this thread..
        https://forum.bela.io/d/101-compiling-puredata-externals/108

        for those out there that are trying to do the same thing, just to be completely clear:
        i'm sending [open /mnt/sd/sample01.wav( messages to [readsf~], and that works fine.

        topic can be closed, i guess?