« Return to Thread: NRT Buffer Filling

Re: NRT Buffer Filling

by David Etlinger :: Rate this Message:

Reply to Author | View in Thread

~score.add( [0,
    [\b_alloc, ~blackman.bufnum, size ],
    [\b_setn, ~blackman.bufnum, 0, size, sig].flatten
] );

stwbass wrote:
I'm wondering if there is an easy way and/or how one would fill a Buffer
with something like the following for NRT use.

(
//Blackman Window
var sig, size, alpha, a0, a1, a2;
size = 2048;
alpha = 0.16;
sig = Signal.newClear(size);

a0 = 0.5*(1-alpha);
a1 = 0.5;
a2 = alpha*0.5;

sig.waveFill( { arg x, i; a0 - (a1*cos( (2*pi*x)/(size-1) ) ) + (a2*cos(
(4*pi*x)/(size-1) ) )}, 0, size );
~blackman = Buffer.sendCollection(s, sig, 1);
)


I'm not sure how this is done with the \b_alloc messages and such.

Thanks very much,
sw



--
Scott Worthington
stwbass@gmail.com
www.scottworthington.com

 « Return to Thread: NRT Buffer Filling