FluidSliceCorpus:
Filter:
FluCoMa/Classes (extension) | Libraries > FluidCorpusManipulation

FluidSliceCorpus
ExtensionExtension

A utility for batch slicing of a corpus

Description

A utility class that abstracts the boiler plate code involved with batch slicing a buffer containing distinct chunks of audio (a 'corpus' for these purposes).

Whilst this class is designed to be used most easily in conjunction with FluidLoadFolder, it doesn't have to be. However, it does expect to be passed an IdentityDictionary of a particular format (see description below).

The actual mechanism for doing the slicing is provided by the user, in the form of a function that will form part of a larger Synth (see below).

Class Methods

.new

Create a new instance with the specified slicing and labelling behaviour.

Arguments:

sliceFunc

 A function that does the slicing, returning a UGen. This function is passed the following arguments:

src
The source Buffer for slicing
start
The frame to start slicing from, in samples
num
The number of frames to slice, in samples
dst
The destination Buffer into which to write slice indices

This configuration assumes that you are using one of the FluidCorpusManipulation buffer-based slicing objects, or at least following their conventions, notably:

  • slice points are written into a buffer as sample positions.
  • If no slices are found, then a single value of -1 is written instead
WARNING: This function must return a UGen that sets a done flag (see Done), in order for the iteration and housekeeping to work. All FluidBuf* objects do this.

A concrete example of a sliceFunc could be:

idFunc

 

WARNING: Not yet implemented

Override the default labelling behaviour for slices. The default is to append the original identifier with -<slice number> counting from 1.

Instance Methods

.sliceFunc

Retreive the slicing function used by this instance.

.play

Run the slicing function over each entry in the supplied index dictionary

Arguments:

server

The Server on which to execute

sourceBuffer

The Buffer containing the audio to slice

bufIdx

 An IdentityDictionary that details identifiers and start-end positions for each chunk in the source buffer. See FluidLoadFolder: index

action

A function that runs on complettion, will be passed the IdentityDictionary from index as an argument.

tasks

 The number of parallel processing tasks to run on the server. Default 4. This should probably never be greater than the number of available CPU cores.

.index

A IdentityDictionary containing information about the position of each discovered slice, using identifiers based on those passed into play (see labelling). This dictionary copies all other entries from the source dictionary on a per-key basis (so you can store arbitary stuff in there should you wish, and it will remain assciated with its original source chunk).

Examples