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

FluidLoadFolder
ExtensionExtension

Load a folder of audio into a single buffer

Description

Given a path name, load every audio file in the path (using SoundFile: *collect), allocate a Buffer, and load the files top to tail into the buffer. Information about start stop points, channel counts and sample rates is then stored in FluidLoadFolder: index as a IdentityDictionary.

Class Methods

.new

Construct a new instance

Arguments:

path

A string pointing to a folder on disk

idFunc

A function that determines how the identifiers for the chunks are created; default is file name without path.

channelFunc

A funciton that controls what to do with differently wide files. Default behaviour is for loaded buffer to have as many channels as the widest file in the path, and for narrower files to repeat their channels across this buffer. The funciton is passed the channels for the current file, the maximum channel count, and the current index.

Instance Methods

.index

A IdentityDictionary containing the metadata on the loaded files

The keys of this dictionary are the identifiers produced by the idFunc passed to FluidLoadFolder: *new (or the default of the filename if nil). The value for each key is a further dictionary consisting of:

bounds
A two element array giving the start and end point of this files eventual position in the overall buffer (in samples).
sr
The sampling rate of the original file
numchans
Number of channels in the original file

.files

The list of files loaded

.buffer

The buffer in which the files are placed, end to end.

.play

Load the files.

Arguments:

server

The server on which to run

action

Function to execute on completion

Examples