I think all you need is a dac_loop_sample where it now calls dac_read_sample (to get the next input sample), and slightly smarter handling of the actual loop. I'll add it to my TODO list. (Grumble -- I think of Snd as an editor -- aren't there programs dedicated to looping?)