Record into buffer automatically by onset detection (similar to arbhar)

Martin Hooke's icon

Hi there,

i'm working on some sort of granular for which i would like gen to listen to in1 and when it reaches above a certain level starts recording for a set amount of time into the buffer (let's say 3 seconds) and do this constantly.

all inside of gen~

any good resources for this? thanks!