• AudioSolved
  • 8 chan multitrack audio file loop from SD card with PD patch

I just received the bela multichannel extender all the way in Tromsø and looking to playback an 8 track multichannel wavfile from the SD card on loop for an exhibition. First time user, not a lot of experience and can't mess around accidentality damaging the board as we open in less than a month. Would greatly appreciate the help!

  1. Is it capable of reading an 8-channel wav file or better make them into 4 separate stereo files?
  2. Is there a filesize limit for reading/looping seamlessly from the SD?
  3. Do I just flash the SD card with the audio file?
  4. Can I access the file through a PD patch? Is there an example file for this?

As a starting point I re-created the attached patch (basic stereo file looper from internal memory) from this video.

main.pd
3kB

Thanks so much!

sure you can do this in Pd using [readsf~] . You can set it to 8 channels and read a single multi-channel files. When you send the [open( message to [readsf~] you need to then wait a while (100 ms suffice in most cases) for it to preload the file before you can send it a [start( to start playing it. If you need seamless looping the best option is to use two [readsf~] instances and send a [open( to one at the same time as you send a [start( to the other, then swap when you receive a bang out of the last outlet of the playing one. This way at all times one will be preloading the file and the other one will be playing and you get uninterrupted loop playing out of their combination.

Something like this should work

The file needs to be in the project folder, you can upload it there via the IDE.

  • AQNE replied to this.

    giuliomoro

    Thank you for the immediate and thorough response, this is such a golden ticket!! I am sure many will use this for their exhibition work.

    The file needs to be in the project folder, you can upload it there via the IDE.

    Does this mean the project folder is stored on the SD card?

      AQNE Does this mean the project folder is stored on the SD card?

      yes

      a month later

      Any idea if there is a maximum file size for uploading on the SD? I am trying to upload one 2GB 7 multitrack file and keep getting an upload error. Or is it better to upload cut up the file in several "chapters" and alter the PD file?

      I am using the Bela IDE in Firefox

      2GB may well not fit on the SD card / eMMC. Type df -h . in the console at the bottom of the IDE and that should tell you the available disk space.

      If you are working off an SD card you should try to resize the filesystem to take up the full space available on the SD card: https://learn.bela.io/using-bela/bela-techniques/managing-your-sd-card/#resizing-filesystems-on-an-existing-sd-card . If you are using the eMMC (Bela Starter Kit's default configuration), then you'll need to get an SD card to start with.

      Thanks, I now managed to extend the partition and upload the 2.15GB 7 channel audio file along with the Pd example you proposed earlier.

      When pressing build + run I am receiving a continues stream of messages:
      error: dsp: myfile.wav: No such file or directory
      Your code is printing to the console too quickly. Check your audio thread for print messages.
      Underrun detected: 21 blocks dropped
      Makefile:613: recipe for target 'runide' failed
      make: *** [runide] Terminated
      error: dac~: bad vector size
      CPU is ±50-68%

      I tried to alter the blocksize in the settings menu to 64 and up to 4096, but it didn't help. I added

      The audiofile was uploaded within the same project. Is it an issue that it has 7 channels? Or something related to deleting and remaking the 2nd partition?

      I tried the patch before with a short 8channel test file and it worked.

        AQNE error: dac~: bad vector size

        You cannot have a [block~ 64] in a (sub-)patch with the dac~ : dac~ can only be in a (sub-)patch which runs at the default blocksize which is 16 on Bela. On the other hand, the "blocksize" you set in the settings is similar to Pd's "delay' and so can be arbitrarily large.

        error: dsp: myfile.wav: No such file or directory

        Is the filename correct? Maybe a screenshot of the project explorer in the IDE would help.

        If this is all that there is in your patch, I struggle to see how you'd get anywhere close to that CPU usage

        • AQNE replied to this.

          giuliomoro You cannot have a [block~ 64] in a (sub-)patch with the dac~ : dac~ can only be in a (sub-)patch which runs at the default blocksize which is 16 on Bela. On the other hand, the "blocksize" you set in the settings is similar to Pd's "delay' and so can be arbitrarily large.

          Thanks for the quick replies! Okay, I have removed this section and kept what is in the screenshot below:

          And the settings:

          I have now cut the file in half, and use the player to alternate. Connecting to speakers soon to checker whether it actually plays/sounds good.

          I struggle to understand what brakes there .... it seems to be some Pd issue ... anyhow the workaround you found seems to be perfect, if it's a workable solution for you.