SuperCollider CLASSES (extension)
Libraries>BBCut

# CutBuf2

BBCut2 buffer playback with modulatable grain parameters
Source: /Users/zzk/Library/Application Support/SuperCollider/downloaded-quarks/BBCut/classes/cutsynths/CutBuf2.sc
Inherits from: CutSynth : Object
See also: BBCut

## Description

Playback for a buffer, with individual grains spawned for each cut. Each grain may have associated parameters for playback speed, enveloping and dutycycle (ratio of duration to inter-onset-interval).

## Class Methods

### *new (bbcutbuf, offset, pbsfunc, dutycycle, atkprop, relprop, curve)

All of the arguments apart from bbcutbuf can have more complex objects than SimpleNumbers passed in. You can pass in anything which responds to value (like a Function) or even objects which respond to the updateblock method such as CutPBS1 (see examples below).

#### Arguments:

bbcutbuf | An instance of BBCutBuffer representing the buffer to be cut-up.
offset | A parameter to be passed to any cut playback position determining routine. The default chooseoffset method is in BBCutBuffer and the parameter is a single number from 0.0 to 1.0 giving the chance of a jump to a random event in the source.
pbsfunc | Playback speed (rate) control for each cut. This can be a constant, or some other object that responds to .value, which is called for every repeat in a block. The first argument is the repeat number in the block, and the second argument is the block itself. If pbsfunc responds to .updateblock, that will also be called every block with the current block passed as an argument.
dutycycle | Ratio of duration to inter-onset-interval (IOI). 0.5 would mean that the duration of grains is only half the length between cut start times.
atkprop | Enveloping parameter for attack speed. Rated as a proportion of the overall envelope (0.0 to 1.0)
relprop | Enveloping parameter for release speed. Rated as a proportion of the overall envelope (0.0 to 1.0)
curve | Envelope curve

### Inherited class methods

## Instance Methods

### Inherited instance methods

### Undocumented instance methods

### -atkprop

### -atkprop = value

### -bbcutbuf

### -bbcutbuf = value

### -curve

### -curve = value

### -dutycycle

### -dutycycle = value

### -initCutBuf2 (bcb, off, pf, dc, ap, rp, c)

### -offset

### -offset = value

### -pbsfunc

### -pbsfunc = value

### -relprop

### -relprop = value

### -renderBlock (block, clock)

### -setup

## Examples

    (
    var sf, clock;

    s=Server.default;

    clock= ExternalClock(TempoClock(2.1)).play;

    Routine.run({

    sf= BBCutBuffer(Platform.resourceDir +/+ "sounds/break.aiff",8);

    s.sync; //this forces a wait for the Buffer to load

    BBCut2(CutBuf2(sf,0.3), BBCutProc11.new).play(clock);
    });

    )

    //dutycycle and envelope manipulations, CutPBS1 instance used to control repitching of rolls
    (
    var sf, clock;

    clock= ExternalClock(TempoClock(2.1)).play;

    Routine.run({

    sf= BBCutBuffer(Platform.resourceDir +/+ "sounds/break.aiff",8);

    s.sync; //this forces a wait for the Buffer to load

    BBCut2(CutBuf2(sf,0.3, CutPBS1(0.97,{1.rand2}), 0.5, 0.001, 0.5, -4), WarpCutProc1.new).play(clock);
    });

    )

    //showing passing of functions, the block argument passed to the dutycycle function is a BBCutBlock object
    (
    var sf, clock;

    clock=ExternalClock(TempoClock(3.3)).play;

    Routine.run({

    sf= BBCutBuffer(Platform.resourceDir +/+ "sounds/break2.aiff",4);

    s.sync; //this forces a wait for the Buffer to load

    BBCut2(CutBuf2(sf,0.3, {rrand(0.9,1.1)}, {arg i, block; var ioi; ioi= block.iois[i]; ioi.min(0.75)/ioi},{exprand(0.001,0.5)}), ChooseCutProc({[0.5,1.0,1.25].choose},{rrand(1,4)})).play(clock);
    });

    )

    (
    var sf, clock;

    clock=ExternalClock(TempoClock(3.3)).play;

    Routine.run({

    sf= BBCutBuffer(Platform.resourceDir +/+ "sounds/break2.aiff",4);

    s.sync; //this forces a wait for the Buffer to load

    BBCut2(CutBuf2(sf, relprop:0.8, curve:{rrand(-16,-1)}), ChooseCutProc({[0.5,1.0,0.25].choose},{rrand(1,4)})).play(clock);
    });

    )

helpfile source: /Users/zzk/Library/Application Support/SuperCollider/downloaded-quarks/BBCut/HelpSource/Classes/CutBuf2.schelp
link::Classes/CutBuf2::
sc version: 3.8.0