Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (
- ~rios = Buffer.read(s, "C:/Users/tania/Documents/Naciente/Rendered/
- Naciente Edit 1 Export 1.wav");
- SynthDef(\riofilto,{|out, bufnum, gate = 1, amp = 0.70, rate1 = 1,rate2 = 2, rever = 0.9,filterBin = 0|
- var in, chain,phaseA,phaseB,env , inA, chainA, inB, chainB,
- chainC,salida;
- phaseA = Phasor.ar(0, BufRateScale.kr(~rios) * rate1, 0,
- BufFrames.kr(~rios));
- phaseB = Phasor.ar(0, BufRateScale.kr(~rios) * rate2, 0,
- BufFrames.kr(~rios));
- inA = BufRd.ar(2, ~rios,phaseA);
- inB = BufRd.ar(2, ~rios,phaseB);
- chainA = FFT(LocalBuf(2048), inA);
- chainB = FFT(LocalBuf(2048), inB);
- chain = PV_Add(chainA, chainB);
- chain = PV_BrickWall(chain,filterBin);
- salida = IFFT(chain).dup;
- 2.do{
- salida = AllpassN.ar(salida,0.3,[0.091.rand,0.091.rand],rever)
- };
- env = EnvGen.kr(Env.asr(1,1,4),gate, doneAction:2);
- Out.ar(0,salida*env)*amp
- }).add
- )
- ~synFiltRio = Synth(\riofilto)
- ~synFiltRio.set(\rate1,0.12,\rate2,212.25)
- ~synFiltRio.set(\gate,0)
- (
- ~w = Window.new("Ventana", Rect(110,110,700,600),true,true).front;
- ~w.layout = HLayout(~w1 =CompositeView(~w).background_(Color.black));
- ~b = {Button(~w)}!1;
- ~d= {Slider(~w)}!4;
- ~f = { StaticText (~w)}!4;
- ~w1.layout = VLayout(HLayout(*~b),HLayout(*~d),HLayout(*~f));
- ~b[0].states_([
- ["Rio", Color.red,Color.black],
- ["stop", Color.black,Color.green],
- ]);
- ~b[0].action_({ arg butt;
- switch( butt.value,
- 1, {~synFiltRio = Synth(\riofilto)},
- 0,{~synFiltRio.set(\gate,0)}
- )
- });
- //--------sliders---------------------------
- ~d[0].action_({ arg sl;
- ~synFiltRio.set(\rate1, sl.value.linlin(0,1,0.1,150).postln)
- });
- ~d[1].action_({ arg sl;
- ~synFiltRio.set(\rate2, sl.value.linlin(0,1,0.1,150).postln)
- });
- ~d[2].action_({ arg sl;
- ~synFiltRio.set(\filterBin, sl.value.linlin(0,1,-1.0,1.0).postln)
- });
- ~d[3].action_({ arg sl;
- ~synFiltRio.set(\rever, sl.value.linlin(0,1,0.9,3.0).postln)
- });
- ~d[4].action_({ arg sl;
- ~wavT5.set(\amp, sl.value.linlin(0.0,1.0, 0.0,4.0))
- });
- ~f[0].string = "rate 1";
- ~f[0].background = Color.white;
- ~f[1].string = " rate 2";
- ~f[1].background = Color.white;
- ~f[2].string = " filtro Low-High";
- ~f[2].background = Color.white;
- ~f[3].string = " rever";
- ~f[3].background = Color.white;
- )
- ´
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement