SuperCollider CLASSES (extension)
Libraries>BBCut

# BBCutBuffer

A buffer in BBCut2
Source: /Users/zzk/Library/Application Support/SuperCollider/downloaded-quarks/BBCut/classes/core/BBCutBuffer.sc
Inherits from: Buffer : Object
See also: BBCut

## Description

Holds data on a buffer including any segmentation (event positions). Derived from the Buffer class and has methods for choosing playback segments.

## Class Methods

### *new (filename, beatlength: 8, eventlist, action)

#### Arguments:

filename | File location of a soundfile to load. Default path is to the SC3 source folder.
beatlength | Number of beats in the soundfile, also used to estimate the source tempo in beats per second.
eventlist | Array giving a segmentation of the sound file measured in sample frames. The class can construct one for you if you pass in a granularity, ie 0.5 for eighth note cuts imposed throughout the soundfile length- see below. If left nil the default is an even segmentation in eighth notes.
action | A function to be evaluated when the buffer is done loading. This instance of BBCutBuffer is passed as an argument.

### *array (filenames, beatlengths, eventlists, action)

#### Arguments:

filenames | Array of sound file locations to load
beatlengths | Number of beats in the soundfile, also used to estimate the source tempo in beats per second.
eventlists | Array of Arrays of event positions.
action | A function to be evaluated when all buffers are done loading. This instance of BBCutBuffer is passed as an argument.

### Inherited class methods

### Undocumented class methods

### *defaultPAT

### *defaultPAT = value

## Instance Methods

### Inherited instance methods

### Undocumented instance methods

### -beatlength

### -beatlength = b: 4

### -bps

### -bps = value

### -chooseoffset (block, offsetparam: 0, beatorframe: 0)

### -convertoffset (block, beatorframe: 0)

### -eventlengths

### -eventpats

### -events = eventlist

### -eventstarts

### -findevents (start, dur)

### -groovepos

### -length

### -length = value

### -onsetsinbeats

### -quantised

### -setgroove (groovefunc)

### -timedeviations

### -trimevents (start, dur, input, pre, post, tempo)

## Examples

    //run one line at a time
    f= BBCutBuffer(Platform.resourceDir +/+ "sounds/break.aiff",8);

    Post << [\length,f.length, \beatlength, f.beatlength, \events, f.eventstarts] << nl;

    f= BBCutBuffer.array([Platform.resourceDir +/+ "sounds/break.aiff",Platform.resourceDir +/+ "sounds/break2.aiff"],[8,4],[[0,10000],[3500,6700,9000]]);

    f.do({ arg val; Post << [\length,val.length, \beatlength, val.beatlength, \events, val.eventstarts] << nl;});

    //will only select playback positions from the events list given above, using an offset choice function
    (
    BBCut2(CutGroup([CutBuf1(f[1],{arg buffer; buffer.eventstarts.choose}), CutBPF1(1000,drqfunc:0.5)]), ChooseCutProc(0.125,4)).play(2)
    )

    //change the event positions allowed
    f[1].events_([10000,20000,40000]);

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