NRT Render - Buffer / FX Out

Hi,

I have a two-part request…

1: How do I create access for a buffer offline?

~s1 = Buffer.readChannel(s,“…texture_warper1.wav”,channels:0);

a =Pbind(\instrument,\grainBuf,
\sndbuf,~s1,
\dur,0.125,
);
~aScore = a.asScore(~dur);
~aScore.render(“grain.aiff”,headerFormat:“AIFF”,options:o);

2: How do I capture bus audio offline? This stream is being routed to ~rb which is a bus containing a reverb synth.

c = Pbind(\instrument,\sineTone,
\dur, Pseq([0.125,Rest(15-0.125)],inf),
\out,~rb,
);
~cScore = c.asScore(~dur);
~cScore.render(“sineTone.aiff”, headerFormat:“AIFF”);

Both renders produce silence. I’ve successfully rendered other patterns in this manner.

Thanks,

MJ

  1. Check out Pproto’s help page. It cover use cases with both buffers and effects. Here is an example from there, about buffers, which I have modified slightly to run in NRT.

SynthDef(\help_playbuf, { | out=0, bufnum = 0, rate = 1, startPos = 0, amp = 0.1, sustain = 1, pan = 0, loop = 1|
    var audio;
    rate = rate * BufRateScale.kr(bufnum);
    startPos = startPos * BufFrames.kr(bufnum);

    audio = BufRd.ar(1, bufnum, Phasor.ar(0, rate, startPos, BufFrames.ir(bufnum)), 1, 1);
    audio = EnvGen.ar(Env.sine, 1, timeScale: sustain, doneAction: Done.freeSelf) * audio;
    audio = Pan2.ar(audio, pan, amp);
    OffsetOut.ar(out, audio);
}).writeDefFile; 
// I changed this from .add to .writeDefFile so that the NRT server finds this synthdef

Pproto({
    ~newgroup = (type: \group).yield;
    ~sf1 = (type: \allocRead, path: Platform.resourceDir +/+ "sounds/a11wlk01-44_1.aiff").yield;
},
    Pbind(*[
        instrument:    \help_playbuf,
        dur:        Pseg([0,0,0.25,0.5, 0.75, 1],10).linexp(0,1,0.01,2),
        legato:        4,
        startPos:    Pn(Pseg([0,1], 20), inf),
        rate:        Pwhite(1, 1).midiratio,
        loop:        0,
        group:        Pkey(\newgroup),
        bufnum:        Pkey(\sf1)
    ])
).asScore(1).render("testScore.wav");
// and I changed this from .play to .asScore(1).render(...) for obvious reasons :)
  1. You’ll notice that in examples about effects, everything happens on bus 0. This is because your NRT server will record only signals that reach its output busses (that is, 0 and 1 if you run stereo). If your reverb outputs to bus 0, 1, or both, it should get recorded.

Fantastic this is just what I needed, everything worked out great, thank you!