flooper2
Function-table-based crossfading looper.
This opcode implements a crossfading looper with variable loop parameters and three looping modes, optionally using a table for its crossfade shape. It accepts non-power-of-two tables for its source sounds, such as deferred-allocation GEN01 tables, with one or two channels.
Syntax
asig1[,asig2] flooper2 kamp, kpitch, kloopstart, kloopend, kcrossfade, ifn \
[, istart, imode, ifenv, iskip]
Initialization
_ifn _ -- sound source function table number, generally created using GEN01
_istart _ -- playback start pos in seconds
_imode _ -- loop modes: 0 forward, 1 backward, 2 back-and-forth [def: 0]
_ifenv _ -- if non-zero, crossfade envelope shape table number. The default, 0, sets the crossfade to linear.
_iskip _ -- if 1, the opcode initialisation is skipped, for tied notes, performance continues from the position in the loop where the previous note stopped. The default, 0, does not skip initialisation
Performance
asig1[, asig2] -- output sig (mono or stereo).
kamp -- amplitude control
kpitch -- pitch control (transposition ratio); negative values are not allowed.
kloopstart -- loop start point (secs). Note that although k-rate, loop parameters such as this are only updated once per loop cycle.
kloopend -- loop end point (secs), updated once per loop cycle.
_kcrossfade _ -- crossfade length (secs), updated once per loop cycle and limited to loop length.
Mode 1 for _imode _ will only loop backwards from the end point to the start point.
Examples
The example above shows the basic operation of flooper2. Pitch can be controlled at the k-rate, as well as amplitude and loop parameters. The example assumes table 1 to contain at least 5.05 seconds of audio (4 secs loop duration, starting 1 sec into the table, using 0.05 secs after the loop end for the crossfade). Looping is in mode 0 (normal forward loop).
Here is another example of the flooper2 opcode. It uses the file flooper2.csd and fox.wav.
See also
Credits
Author: Victor Lazzarini
July 2006
New plugin in version 5
July 2006.