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

Re: [sc-users] NRT sample playback



You also need to have the buffer loaded in the Score:

(
g = [
    [0, [\b_allocRead, z = s.bufferAllocator.alloc(1), "sample.aif"]],
    [0, [\s_new, \NRTsample_test, 1000, 0, 0, \bufnum, z]],    
    [0.5, [\s_new, \NRTsample_test, 1001, 0, 0, \bufnum, z]], 
    [1, [\s_new, \NRTsample_test, 1003, 0, 0, \bufnum, z]],
    [2, [\c_set, 0, 0]] // finish
    ];
o = ServerOptions.new.numOutputBusChannels = 2; // stereo output
Score.recordNRT(g, "sample-test.osc", "sample_test.aiff", options: o); // synthesize
)

See if that works.

best,

Josh

On Dec 18, 2007, at 6:14 PM, Aaron McLeran wrote:

Hello, I am new to SC and am studying NRT playback.  I would like to be able to define a synthDef that plays back a sample like the following:

(
SynthDef("NRTsample_test",{ arg rate = 1, start = 0, bufnum = 0;   
    Out.ar(0,
        PlayBuf.ar(2, bufnum, BufRateScale.kr(bufnum)*rate, startPos: start, loop: 0);
    )
}).load(s);
)

z = Buffer.read(s, "sample.aif");  // load sample
a = Synth(\NRTsample_test, [\bufnum, z.bufnum]);  // play back

However, when I put this in my score, I don't get any errors. I just get silence.

Here is my score:

(
g = [
    [0, [\s_new, \NRTsample_test, 1000, 0, 0, \bufnum, z.bufnum]],   
    [0.5, [\s_new, \NRTsample_test, 1001, 0, 0, \bufnum, z.bufnum]],
    [1, [\s_new, \NRTsample_test, 1003, 0, 0, \bufnum, z.bufnum]],
    [2, [\c_set, 0, 0]] // finish
    ];
o = ServerOptions.new.numOutputBusChannels = 2; // stereo output
Score.recordNRT(g, "sample-test.osc", "sample_test.aiff", options: o); // synthesize
)

But I get no sound!  Can somebody tell me what I am doing wrong?

I am attaching an .rtf file of the code example...




<sample_test.rtf>_______________________________________________
sc-users mailing list
sc-users@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-users

******************************************

/* Joshua D. Parmenter

http://www.realizedsound.net/josh/


“Every composer – at all times and in all cases – gives his own interpretation of how modern society is structured: whether actively or passively, consciously or unconsciously, he makes choices in this regard. He may be conservative or he may subject himself to continual renewal; or he may strive for a revolutionary, historical or social palingenesis." - Luigi Nono

*/