Hello, I’m trying out a new way of using SoundIn with streams/patterns/events.
I’m very far behind from what I want so here is the newb code I just did and I already get stuck. The Pbind code is based on Eli’s tutorial.
My idea is that I want to create one or two Synthdef(s) and control the AudioIn in patterns( using any P’s family) and be able to change the timbre/effects/sustains etc of an Audio Input. Any help will be much appreciated.
Thank you so much for your time.
~b3 = Buffer.alloc(s, 44800*0.6,2);
(
SynthDef(\hubSine, { | out =0, freq= 0.0, phase = pi, atk = 0.5, rls= 0.5, pan-0, amp=0.0, gate=1, outBus = 0, level = 1, run =1, loop= 1|
var sig, rec,play;
sig = SoundIn.ar(\micIn.kr(0)* level);
//sig = sig + CombL.ar(sig, 2, [atk, rls],0.7);
sig = sig + CombC.ar(sig, 1, SinOsc.ar(0.015).range(0.5, 1) * [0.13, 0.17], 7);
rec = RecordBuf.ar(sig,~b3,\offset.kr(0),\reclev.kr(1).varlag(0.3),\prelev.kr(-2.dbamp).varlag(0.3), run,loop);
play = PlayBuf.ar(2, ~b3.bufnum,loop:1);
play = HPF.ar(play,80);
play = LPF.ar(play, 12000);
Out.ar(outBus,XFade2.ar(play, play*0.2,level:level));
}).add;
)
d= Synth(\hubSine);
(
~note = 40;
~pat = Pbind(
\instrument, \hubSine,
\dur, Pexprand(0.02,1),
\atk, Pexprand(0.5,2),
\sus, 0,
\rel, 4,
\relcrv, -2,
\freqdev, Pwhite(-0.2, 0.2),
\midinote, Pfunc({~note}), //Pfunc to the rescue
#[harmonic,amp], Pfunc({
var h, a;
h = exprand(1,40).round(1);
a = h.lincurve(1,40,1,0.02,-8) * 0.03;
[h,a];
}),
);
~pat.play;
)
~note = 52; // changable
~pat.stop;