Create a Loopstation

Hi everyone, I urgently need to understand how to create a kind of loopstation, on supercollider. In short, I have to take the signal of my voice as input and then I would like to put it in an infinite loop, freely deciding when to deactivate the loop.
Is there any code out there that does something similar? Thank you so much!

This video from Eli Fieldsteel shows how to create a looperpedal a la line 6


There is also this:

Maybe more than what you asked for, but you can probably find something useful there.