SuperCollider CLASSES (extension)
Libraries>BBCut

# CutStream1

BBCut2 with live input
Source: /Users/zzk/Library/Application Support/SuperCollider/downloaded-quarks/BBCut/classes/cutsynths/CutStream1.sc
Inherits from: CutSynth : Object
See also: BBCut

## Description

Playback for a stream of audio which can be cut-up. The stream can be any bus on the Server, so might be a file streamed off disk, a current audio input or some synthesised data.

Each grain may have associated parameters for enveloping and dutycycle (ratio of duration to inter-onset-interval).

Note that CutStream1 uses In.ar rather than InFeedback.ar, for reaction speed, so execution order is important. you cannot cut-up a stream created later in the execution order. Change the SynthDefs in the class file to InFeedback if you want no execution order worries, at the expense of an audio block's delay (usually 64 samples).

## Class Methods

### *new (inbus, bbcutbuf, dutycycle, atkprop, relprop, curve)

#### Arguments:

inbus | Bus on the Server to be cut-up.
bbcutbuf | A Server side buffer must exist for the use of the UGen- by default one is allocated for you.
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

### -bbcutbuf

### -bbcutbuf = value

### -free

### -inbus

### -inbus = value

### -initCutStream1 (ib, bcb, dc, ap, rp, c)

### -renderBlock (block, clock)

### -setup

## Examples

    s=Server.default;

    a=BBCut2(CutStream1.new).play;

    a.end;

    //dutycycle and envelope manipulations of first audio in channel
    (
    var buf, clock;

    clock= ExternalClock(TempoClock(2.1));

    clock.play;

    Routine.run({

    buf= BBCutBuffer.alloc(s,44100,1);

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

    BBCut2(CutStream1(s.options.numOutputBusChannels, buf, 0.5, 0.001, 0.5, -4), WarpCutProc1.new).play(clock);
    });

    )

    //dutycycle and envelope manipulations cutting up a stream being synthesised
    (
    var buf, clock, synthgroup, bbcutgroup, synthbus;

    clock= ExternalClock(TempoClock(2.1));

    synthgroup= Group.head(Node.basicNew(s,1));
    bbcutgroup= Group.after(synthgroup);

    synthbus= Bus.audio(s,1);

    Routine.run({

    SynthDef(\sourcesound,{Out.ar(synthbus.index,Gendy1.ar(1,3,0.2,0.5,LFNoise1.kr(1,100,300),550,0.05,0.07))}).play(synthgroup);
    buf= BBCutBuffer.alloc(s,44100,1);

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

    BBCut2(CutGroup(CutStream1(synthbus.index, buf, 0.75, 0.01, 0.5, -4),bbcutgroup), WarpCutProc1.new).play(clock);
    });

    clock.play;
    )

    //source on its own for comparison
    SynthDef(\sourcesound,{Out.ar(0,Gendy1.ar(1,3,0.2,0.5,LFNoise1.kr(1,100,300),550,0.05,0.07)*0.1)}).play;

    //cutup of stereo sound- note use of stereo Bus and creation of stereo buffer, CutGroup last argument is numChannels
    (
    var buf, clock, synthgroup, bbcutgroup, synthbus;

    clock= ExternalClock(TempoClock(2.1));

    synthgroup= Group.head(Node.basicNew(s,1));
    bbcutgroup= Group.after(synthgroup);

    synthbus= Bus.audio(s,2);

    Routine.run({

    SynthDef(\sourcesound,{Out.ar(synthbus.index,0.25*Gendy1.ar(1,3,0.2,0.5,LFNoise1.kr([1.1,1.3],100,300),[650,750],0.05,0.07))}).play(synthgroup);
    buf= BBCutBuffer.alloc(s,44100,2);

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

    BBCut2(CutGroup(CutStream1(synthbus.index, buf, 0.75, 0.01, 0.5, -4),bbcutgroup,nil,2), WarpCutProc1.new).play(clock);
    });

    clock.play;
    )

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