Generating NRT Score from Routine

Hi!

I was playing around inserting short synthesis code inside { }.play functions, scheduling them with fork, do, loop and wait. Eventually, the draft became a full piece.

Is there a shortcut to convert the main Routine into a NRT Score and then properly render the soundfile? Something like .asScore works for Patterns.

Here is a an example:

(
{
	5.do({
		1.wait;
		
		2.do({
			play({
				var nPartials = rrand(3,16), nChans = rrand(1,5), n = nPartials * nChans;
				Out.ar(0, Splay.ar(Klang.ar(`[ { { rrand(200.0, 4000.0) } ! nPartials } ! nChans, nil, nil ], 1, 0))
					* EnvGen.kr(Env.sine(16), 1, 0.04, doneAction: Done.freeSelf));
			});
			8.wait;
		});
		
		play{( BPF.ar(WhiteNoise.ar(0.25), freq: rrand(100, 3000), rq: 0.25) + Dust.ar(rrand(50, 600)) ) * EnvGen.kr(Env([0,1,1,0],[0.1,24,0.1]), 1, 0.5, doneAction: Done.freeSelf)};
		
	});
	
	
	3.wait;
	
	
	3.do({
		play{ RLPF.ar(LFSaw.ar({rrand(50,100)}!5), {rrand(300,900)}!5, 0.5, mul: 1/5) * EnvGen.kr(Env([0,1,1,0],[4.0,16,4.0]), 1, 1.0, doneAction: Done.freeSelf)};
		9.wait;
		
		play{( BPF.ar(WhiteNoise.ar(0.5), freq: {rrand(100, 3000)}!5, rq: 0.125, mul: 1/3).sum + Dust.ar(rrand(50, 100), 0.5) ) * EnvGen.kr(Env([0,1,1,0],[0.1,24,0.1]), 1, 0.5, doneAction: Done.freeSelf)};
	});
	
	
}.fork;
)

Thanks a lot in advance!

1 Like