esluyter / super-bufrd

UGens for accessing long buffers with subsample accuracy
GNU General Public License v3.0
26 stars 3 forks source link

SuperBufWr #19

Open elgiano opened 4 years ago

elgiano commented 4 years ago

Example code:

b = Buffer.alloc(s,s.sampleRate*3600*2);
(
{
    var start = 3600, superStart = 3601;
    var in = SinOsc.ar(10);
    BufWr.ar(in, b, 
        Phasor.ar(0, 1, start*BufSampleRate.ir(b), (start+1)*BufSampleRate.ir(b))
    );
    SuperBufWr.ar(in, b, 
        SuperPhasor.ar(0, 1, 
            superStart*BufSampleRate.ir(b), (superStart+1)*BufSampleRate.ir(b)
        )
    );
    Line.kr(0,1,0.5,doneAction:2);
}.play;
)
// plot both (zoomed in)
(
{
    var start = [3600,3601];
    PlayBuf.ar(1,b,1,0,start*BufSampleRate.ir(b))
}.plot(0.001);
)