Set up a live coding looper for a guitar in live_audio

Hi all, I’d like to use with_fx :record in order to record a portion of a live_audio stream, let’s say 4 sec, and being able to playback that portion within a Live_loop and modifying it on the fly.
I have tried, with no success, to set it up but I am sure I am not getting something, possibly in relation with with_fx :record… Does anyone like to help me out? Is it even possible? Thnx in advance!

Hi @ETOL,

have a look at this script.

It is quite some time ago that I coded that so some clearing work will be needed - especially because the configuration is way to complicated. Also it provides 4 tracks and replay loops (and not just one so the loops will be dynamically created).

But it works and so it might be of some help for you.

I’ve done some stuff with this in the past, but with bass instead of guitar: https://brightonruby.com/2017/dont-drop-the-bass-xavier-riley/

Code here: https://gist.github.com/xavriley/5d3fc4536b0cd290717e2970f84a0907

Also code here: https://gist.github.com/xavriley/b5f925daa1195dc6ef686297a3016c3d

Edit: Also make sure that your microphone has permissions if you’re using a mac: https://github.com/samaaron/sonic-pi/issues/2331

Thank you both! I had a look at the code and wow!! I will study both. By the way, I am not using touch OSc and neither I am playing the guitar. What I am doing is live coding fx while my partner plays guitar. Hence I will need the simplest and quickest way to do it, on-the fly… But thank you both none the less. I will go through the code and workout something! I hope…