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

FluidProcessSlices
ExtensionExtension

Utility for batch processing slices

Description

This class abstracts some of the boilerplate involved in batch processing a sequence of segments in a Buffer on the server. It does this by iteratively running a user supplied function and using slice point information passed as an IdentityDictionary (see FluidLoadFolder: -index for details on the format of this).

Class Methods

.new

Creates a new instance

Arguments:

featureFunc

 A function that will perform some processing on a section of a buffer.

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.

The functions is passed the following arguments

src
The source Buffer containing the audio to process
start
The start frame of the section to process, in samples
num
The number of frames to process, in samples
data
  An Association of the identifier for this segment, with an IdentityDictionary of useful extra data:
sr
The original sample rate of the segment
numchans
The original channel count of the segment
voice
By default -play will run multiple jobs in parallel dependning on the tasks argument. This contains the task number, which allows you to maintain separate set of resources (e.g. temporary Buffers) for each task.
index
The absolute count of slices processed.

An example function that records statistics about the pitch of a segment in to a FluidDataSet could look like

Instance Methods

.play

Run the featureFunction iteratively over segments of a Buffer, specified by an IdentityDictionary

Arguments:

server

The Server on which to process

sourceBuffer

The source Buffer containing the audio to process

bufIdx

An IdentityDictionary specifying identifiers, boundaries, sample rate and channel count for the segment. See FluidLoadFolder: -index for details.

action

A function to run when processing is complete. This gets passed the same Association as the processing function

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.

.featureFunc

Return the function uses by this instance.

Examples