Hello,
I’m very new to SC and trying to use AudioIn to trigger a synth. My idea is to have an audio input, record it in a buffer, and then play it back in a pattern (it can be any synth, but in this case, i’m using Tgrain from the example )
Please let me know what buffer I have to use instead of .alloc
d= Buffer.alloc(s,44100*20.0,2);
(
SynthDef(\audioPure, {
arg in=0, out=0,deltime=0.7, mix = (-0.5), amp=3 ,record=1;
var sig, delay,rec;
sig= AudioIn.ar(1) *amp;
rec = RecordBuf.ar(sig, d, run:record, loop:1);
CombC.ar(rec,0.4,0.3,2,mul:5.0);
}).send(s);
)
(
{
var trate, dur, rate;
trate = MouseY.kr(2,200,1);
dur = 4 / trate;
rate = Dseq([10, 1, 1, 0.5, 0.5, 0.2, 0.1], inf);
TGrains.ar(2, Impulse.ar(trate), PlayBuf.ar(2,d), rate, MouseX.kr(0,BufDur.kr(b)), dur, Dseq([-1, 1], inf), 0.1, 2);
}.scope(zoom: 4);
)