[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [sc-users] RE: reverse reverb in real time



Oh great I can't wait to give this a go. Thanks! :)

> Date: Mon, 22 Dec 2014 12:30:33 -0700
> From: eli.fieldsteel@xxxxxxxxxx
> To: sc-users@xxxxxxxxxxxxxxxx
> Subject: [sc-users] RE: reverse reverb in real time
>
> This is what I was imagining, though I'm sure there is room for improvement:
>
> s.options.memSize = 2.pow(20); //a safe choice when using large
> auto-allocated delay buffers
> s.reboot;
>
> //load buffers one at a time
> b = Buffer.read(s, Platform.resourceDir +/+ "sounds/a11wlk01.wav");
> c = Buffer.alloc(s, b.numFrames + (s.sampleRate+6), 2); //size = sound +
> reverb time + an extra second
>
> (
> //signal routing busses
> ~reverbBus = Bus.audio(s, 2);
> ~delayBus = Bus.audio(s, 2);
>
> //source sound
> SynthDef.new(
> \input,
> {
> arg amp=0.5, out=0;
> var sig;
>
> //or SoundIn, maybe
> sig = PlayBuf.ar(1!2, b.bufnum);
>
> sig = sig * amp;
> Out.ar(out, sig);
> }).add;
>
> //simple reverb
> SynthDef.new(
> \reverb,
> {
> arg amp=1, out=0, in=0;
> var sig;
> sig = In.ar(in, 1);
> sig = sig.blend(GVerb.ar(sig, 99, 5), 0.5);
> sig = sig * amp;
> Out.ar(out, sig);
> }).add;
>
> SynthDef.new(
> \reversedelay,
> {
> arg amp=1, out=0, in=0;
> var input, sig, readptr;
> input = In.ar(in, 2);
>
> //write the incoming reverb'd signal to a buffer, and stop at the end
> RecordBuf.ar(input, c.bufnum, loop:0);
>
> //LFTri used for oscillating backward/forward playback
> readptr = LFTri.ar(SampleRate.ir/BufFrames.ir(c.bufnum)/2, 3).range(0,1);
> readptr = 1 - readptr; //reverse
> readptr = (readptr * BufFrames.ir(c.bufnum)).round; //scale by numFrames
>
> //delay by number of frames in captured reverb buffer
> readptr = DelayN.ar(readptr, BufDur.ir(c.bufnum), BufDur.ir(c.bufnum));
>
> sig = BufRd.ar(2, c.bufnum, readptr);
> sig = sig * amp;
> Out.ar(out, sig);
> }).add;
> )
>
> //play -- sound will begin after initial reverb sound is recorded
> (
> s.bind({
> Synth.new(\input, [\out, ~reverbBus]);
> Synth.new(\reverb, [\in, ~reverbBus, \out, ~delayBus], s, \addToTail);
> Synth.new(\reversedelay, [\in, ~delayBus, \out, 0], s, \addToTail);
> })
> )
>
> //stop
> s.freeAll;
>
>
>
> --
> View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/reverse-reverb-in-real-time-tp7615406p7615432.html
> Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.
>
> _______________________________________________
> sc-users mailing list
>
> info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
> archive: https://listarc.bham.ac.uk/marchives/sc-users/
> search: https://listarc.bham.ac.uk/lists/sc-users/search/