[sc-users] a beginner's question about NRT

Joshua Parmenter joshp at u.washington.edu
Sun Jul 2 19:42:59 PDT 2006


Just a quick look, here is probably what you need to do to fix it  
(see my comments). Look more at the NRT helpfile and the server- 
command-reference (these are the only things that can be in a Score).

SynthDef("peb",{arg bufnum; // bufnum is now an arg
	var b, trate, dur,tg,ins;
	// this can't be done in a synthdef... you need to use a serverCmd
	// Buffer is a language class, not a UGen, and synthdefs need UGens
//	b = Buffer.read(s, "INPUT.wav");
	trate = 3;
	dur = 10 / trate;
	tg = Dust.ar(trate);
	// b.bufnum won't work here... it needs to be an arg
//	ins = TGrains.ar(2, tg, b.bufnum, 1,
	ins = TGrains.ar(2, tg, bufnum, 1,
		// same here
//		40+Latch.ar(BufDur.kr(b.bufnum)*WhiteNoise.ar(0.1),tg),
		40+Latch.ar(BufDur.kr(bufnum)*WhiteNoise.ar(0.1),tg),
		dur, Latch.ar(WhiteNoise.ar(0.5),tg), 1, 2);
//	Out.ar(0,Pan2.ar(ins,0,1))
	Out.ar(0,ins); // TGrains is already outputting 2 channels... make  
sure INPUT.wav is mono!
}).load(s); // load it so the NRT server can use it


(
var x, o;
x = [
// add a b_allocRead for the buffer... here, it uses buffer 0...
[0, [\b_allocRead, 0, "INPUT.wav"],
// which is passed in as the bufnum arg to \peb
[0, [ \s_new, \peb, 1001, 0, 0, \bufnum, 0]],
[60, [\c_set, 0, 0]]
];
o = ServerOptions.new.numOutputBusChannels = 2;
Score.recordNRT(x, "q.osc", "OUTPUT.wav",
headerFormat: "WAV",
sampleFormat: "int24", options: o);

Hope that helps,

Josh


******************************************
Joshua Parmenter
joshp at u.washington.edu
Post-Doctoral Research Associate - Center for Digital Arts and  
Experimental Media
Raitt Hall - University of Washington
Seattle, Washington 98195

http://www.dxarts.washington.edu
http://www.realizedsound.net/josh/


On Jul 2, 2006, at 6:29 PM, iqeda takmi wrote:

> Hello everyone,
>
> I started to learn SC3 a few weeks ago.
>
> The following codes do not work well.
> Nothing is recorded... What is wrong?
>
>>>
>
> SynthDef("peb",{
> 	var b, trate, dur,tg,ins;
> 	b = Buffer.read(s, "INPUT.wav");
> 	trate = 3;
> 	dur = 10 / trate;
> 	tg = Dust.ar(trate);
> 	ins = TGrains.ar(2, tg, b.bufnum, 1,
> 40+Latch.ar(BufDur.kr(b.bufnum)*WhiteNoise.ar(0.1),tg),
> dur, Latch.ar(WhiteNoise.ar(0.5),tg), 1, 2);
> 	Out.ar(0,Pan2.ar(ins,0,1))
> };).writeDefFile;
>
>
> (
> var x, o;
> x = [
> [0, [ \s_new, \peb, 1001, 0, 0]],
> [60, [\c_set, 0, 0]]
> ];
> o = ServerOptions.new.numOutputBusChannels = 2;
> Score.recordNRT(x, "q.osc", "OUTPUT.wav",
> headerFormat: "WAV",
> sampleFormat: "int24", options: o);
> )
>
>>>
>
> Thank you for your help.
>
> --------------------------------------
> Let's start Yahoo! Auction  -  Free Campaign Now!
> http://pr.mail.yahoo.co.jp/auction/
> _______________________________________________
> sc-users mailing list
> sc-users at create.ucsb.edu
> http://www.create.ucsb.edu/mailman/listinfo/sc-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.create.ucsb.edu/pipermail/sc-users/attachments/20060702/fc90a34c/attachment.htm


More information about the sc-users mailing list