Core of a Multitrack Looper

cebersp

Well-known member
Hi,
this seems to be working now so it might be useful for others... It is the core of an 8-track monaural looper using Teensy4.1 and it's Audio Adaptor with Line input and output.
I have tested it with Guitar signals coming from a multi effect (Zoom G11) in Send-Return dealing with impedance.

The AudioLibrary Setup is very straight forward.
ADC -> (Peak Detect + Queue1)
Queue2 -> DAC
So there are 2 audio queues. One is used to sample audio into the track. The tracks are summed into the second one to be played.

It holds all track data in one file using 5 64k buffers. It is essential to use a fast SD-card "A2 V30": Sandisk Extreme A2 V30. (64GB)
(I have learned, that wear of the SD card is handled by the controller inside the card.)
File handling is done by the sketch, not by the audio library, which is said not to support ExFAT.

64k Buffers 0 and 1 always hold the start of the loop to be able to switch to the start instantly. No need to read these from the SD-card.
Buffers 2...4 are used rolling: ReadSD - Work - WriteSD

The looper works with the threads library. It's time slices are cut down to 200 microseconds to have only one audiobuffer of 128 samples in the queue.

blinkThread: Just a heartbeat blinky.

neoThread: User Interface -very basic!!!. Strip of 12 NeoPixels, with colours showing the status of the tracks.

footThread: User Interface - very basic!!!. 2 Foot Switches. To start a new loop, use the reset button. :)
* Footswitch B: Arm for Recording with beginning of next Loop, If Track 0: Stop Recording
* Footswitch A Short Press : Toggle Playback of Channel
* Footswitch A Long Press: Activate next Track

doQueue: Read and write the audio queues.

fileThread: Read and write 64k buffers to/from the work file

Communication between the threads works via global variables.

As mentioned, the user interface is very basic, no bloatware here. Feel free to improve it!

While I had problems with noise in the past when I was including a preamp, this setup here seems to work without noise.

Thanks for the great libraries!!!!
Comments, suggestions?
Have fun, Christof
 

Attachments

  • MultiLoopC-220126a.zip
    4.8 KB · Views: 52
I have not found out why, but my meanwhile more elaborate looper had problems with larger loops. Writing stalled at some point.
I found, that it works if I format that 64GB card with 64k block size instead of standard 128k block size.
 
Back
Top