Marius4560
Member
Hi 
I am working on a university project - a loop pedal with generative drum rythms. It is going really well, but I have a small problem.
The first loop I record sounds exactly as it should. No glitch or anything. If I remove that recording, and begin to record a new loop, the sound starts glitching. Here is a video with a demonstration of the issue.
If I restart the Teensy, it works as intended again for the first recording, but not the second and beyond. I have tried to turn of all timers, and other actions, but the problem still persist. The code for recording is based on the Recorder example code in the Audio library. https://github.com/PaulStoffregen/Audio/blob/master/examples/Recorder/Recorder.ino
I measured the time (using the commented out usec variable), and it also looks great - as good time measurements for the second recording as for the first recording.
Here is the class in my code, that takes care of everything related to this:
https://github.com/MariusIrgens/LoopPedal/blob/master/LoopPedal/Looper.h
https://github.com/MariusIrgens/LoopPedal/blob/master/LoopPedal/Looper.cpp
And here is my repo main page - it has some more pictures and information:
https://github.com/MariusIrgens/LoopPedal
I tried a couple of different SD cards: a 4 GB Kingston SDHC (older one), and a Verbatim pro microSDHC 600x with 32GB - both have the same issue. Here is the SD card I am using in the demo:

I thought it should be fast enough, right? Why is this only happening on the second recordingMaybe there is something wrong in my code? Can anyone give me some advice on this? It is driving me insane
I am working on a university project - a loop pedal with generative drum rythms. It is going really well, but I have a small problem.
The first loop I record sounds exactly as it should. No glitch or anything. If I remove that recording, and begin to record a new loop, the sound starts glitching. Here is a video with a demonstration of the issue.
If I restart the Teensy, it works as intended again for the first recording, but not the second and beyond. I have tried to turn of all timers, and other actions, but the problem still persist. The code for recording is based on the Recorder example code in the Audio library. https://github.com/PaulStoffregen/Audio/blob/master/examples/Recorder/Recorder.ino
I measured the time (using the commented out usec variable), and it also looks great - as good time measurements for the second recording as for the first recording.
Here is the class in my code, that takes care of everything related to this:
https://github.com/MariusIrgens/LoopPedal/blob/master/LoopPedal/Looper.h
https://github.com/MariusIrgens/LoopPedal/blob/master/LoopPedal/Looper.cpp
And here is my repo main page - it has some more pictures and information:
https://github.com/MariusIrgens/LoopPedal
I tried a couple of different SD cards: a 4 GB Kingston SDHC (older one), and a Verbatim pro microSDHC 600x with 32GB - both have the same issue. Here is the SD card I am using in the demo:

I thought it should be fast enough, right? Why is this only happening on the second recordingMaybe there is something wrong in my code? Can anyone give me some advice on this? It is driving me insane