Audio project guidance - multitrack looper

Status
Not open for further replies.

dimitre

Well-known member
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/6249...n-audio-object?p=252844&viewfull=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/6360...e-using-Teensy?p=255500&viewfull=1#post255500

Thanks
 
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.
 
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;
}
 
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
 
Status
Not open for further replies.
Back
Top