Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: Audio project guidance - multitrack looper

  1. #1
    Member dimitre's Avatar
    Join Date
    Aug 2016
    Location
    São Paulo
    Posts
    84

    Audio project guidance - multitrack looper

    Hello, some years ago I've built a nice project using a serial flash chip and Teensy 3.x
    It was a different kind of looper with three different recordable tracks.
    I was using the play_serialflash_raw.cpp with some modifications to have the ability of looping audio and seeking arbitrary position. fork here:
    https://github.com/dimitre/Audio

    I had some performance issues because of Flash slow erasing and the fact the library has to erase the entire drive at once (something between 30 / 40 seconds for the drive size)
    Now I've got Teensy 4.1 and new audio board, and two PSRAM chips, finally I'm going to be able to have a nice performance for this usage.

    Questions:
    I was using the nice play_serialflash_raw object to record and play but I suppose it doesn't support PSRAM instead of Flash right?
    I've noticed the LittleFS recent changes which support PSRAM, but from what I've seen there is no Audio Library object.
    In the other hand I don't need a filesystem because I can record directly in available PSRAM and playback there too using a custom object and one EXTMEM array like this example here
    https://forum.pjrc.com/threads/62491...l=1#post252844

    I think my first try will be using a new Audio Object, based on delay object or @houston Reverser here
    https://forum.pjrc.com/threads/63608...l=1#post255500

    Thanks

  2. #2
    Senior Member houtson's Avatar
    Join Date
    Aug 2015
    Location
    Scotland
    Posts
    201
    Hi,

    I've not used PSRAM but from what I understand that approach with EXTMEM should work.

    As long as you are not looking to 'save' you loops that approach with an array sounds good.

    It should make setting looping points etc easy. It would also make it easier to add other stuff, set playback speed/tempo, undo and that sort of thing.

    I'm far from an expert but would encourage you to have a go at your own custom object - be great to see what you come up with.

    Cheers Paul.

  3. #3
    Member dimitre's Avatar
    Join Date
    Aug 2016
    Location
    São Paulo
    Posts
    84
    Thanks @houston, I've finally took some time to program my custom object and your example was great for that.
    One quick doubt there:
    Maybe you should stop writing to the buffer if your buffer_filled is true, not to exceed the array.

    I've noticed maybe you should stop writing to the buffer if your buffer_filled = true, not to exceed the array sample_delay_line.
    something like:
    Code:
    if (!buffer_filled) {
    	sample_delay_line[write_index++] = *block_pointer;
    }

  4. #4
    Senior Member houtson's Avatar
    Join Date
    Aug 2015
    Location
    Scotland
    Posts
    201
    Hi @dimitre

    In the example it is a circular buffer designed to process a continuous stream of audio so when it gets to the end it just wraps around to the start again.

    In this example - buffer_filled - is just making sure there is enough data to start reversing the audio as it needs at least half the buffer filled or it will run out.

    If you're interested have a look at this tutorial on circular buffers it's for a different board (a BELA audio board) but it explains the concept very well.

    Cheers Paul

  5. #5
    Member dimitre's Avatar
    Join Date
    Aug 2016
    Location
    São Paulo
    Posts
    84
    Great!
    thanks for the tip and link @houston.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •