LoopController
Defined in: packages/pleco-xa/src/loop/primitives.js:183
Pleco-XA Loop Controller — dynamic loop manipulation with configurable constraints. Pure state, environment-agnostic, result-object API. Positions are normalized 0..1 over the buffer duration.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new LoopController(
options?):LoopController
Defined in: packages/pleco-xa/src/loop/primitives.js:184
Parameters
Section titled “Parameters”options?
Section titled “options?”Returns
Section titled “Returns”LoopController
Properties
Section titled “Properties”audioBuffer
Section titled “audioBuffer”audioBuffer:
AudioBuffer
Defined in: packages/pleco-xa/src/loop/primitives.js:186
currentLoop
Section titled “currentLoop”currentLoop:
object
Defined in: packages/pleco-xa/src/loop/primitives.js:187
end:
number=1
start:
number=0
minLoopDuration
Section titled “minLoopDuration”minLoopDuration:
any
Defined in: packages/pleco-xa/src/loop/primitives.js:185
Methods
Section titled “Methods”doubleLoop()
Section titled “doubleLoop()”doubleLoop():
any
Defined in: packages/pleco-xa/src/loop/primitives.js:246
Double the current loop duration (symmetric to halfLoop). The end is clamped to the buffer end (1.0); if the loop is already at the maximum extent, the call fails with a reason.
Returns
Section titled “Returns”any
- { success: boolean, loop: Object, reason?: string, clamped?: boolean }
getCurrentLoop()
Section titled “getCurrentLoop()”getCurrentLoop():
any
Defined in: packages/pleco-xa/src/loop/primitives.js:316
Get current loop boundaries
Returns
Section titled “Returns”any
- { start: number, end: number }
halfLoop()
Section titled “halfLoop()”halfLoop():
any
Defined in: packages/pleco-xa/src/loop/primitives.js:213
Halve the current loop duration
Returns
Section titled “Returns”any
- { success: boolean, loop: Object, reason?: string }
moveLoopForward()
Section titled “moveLoopForward()”moveLoopForward():
any
Defined in: packages/pleco-xa/src/loop/primitives.js:275
Move loop forward by its current duration
Returns
Section titled “Returns”any
- { success: boolean, loop: Object, reason?: string }
resetLoop()
Section titled “resetLoop()”resetLoop():
any
Defined in: packages/pleco-xa/src/loop/primitives.js:303
Reset loop to full audio duration
Returns
Section titled “Returns”any
- { success: boolean, loop: Object }
setAudioBuffer()
Section titled “setAudioBuffer()”setAudioBuffer(
audioBuffer):void
Defined in: packages/pleco-xa/src/loop/primitives.js:205
Set audio buffer for loop calculations
Parameters
Section titled “Parameters”audioBuffer
Section titled “audioBuffer”AudioBuffer
Web Audio API AudioBuffer
Returns
Section titled “Returns”void
setLoop()
Section titled “setLoop()”setLoop(
start,end):any
Defined in: packages/pleco-xa/src/loop/primitives.js:326
Set custom loop boundaries
Parameters
Section titled “Parameters”number
Start position (0-1)
number
End position (0-1)
Returns
Section titled “Returns”any
- { success: boolean, loop: Object, reason?: string }
setMinLoopDuration()
Section titled “setMinLoopDuration()”setMinLoopDuration(
durationSeconds):void
Defined in: packages/pleco-xa/src/loop/primitives.js:194
Set minimum loop duration
Parameters
Section titled “Parameters”durationSeconds
Section titled “durationSeconds”number
Minimum loop duration in seconds (e.g. 0.001 for 1ms)
Returns
Section titled “Returns”void