Skip to content

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.

new LoopController(options?): LoopController

Defined in: packages/pleco-xa/src/loop/primitives.js:184

LoopController

audioBuffer: AudioBuffer

Defined in: packages/pleco-xa/src/loop/primitives.js:186


currentLoop: object

Defined in: packages/pleco-xa/src/loop/primitives.js:187

end: number = 1

start: number = 0


minLoopDuration: any

Defined in: packages/pleco-xa/src/loop/primitives.js:185

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.

any

  • { success: boolean, loop: Object, reason?: string, clamped?: boolean }

getCurrentLoop(): any

Defined in: packages/pleco-xa/src/loop/primitives.js:316

Get current loop boundaries

any

  • { start: number, end: number }

halfLoop(): any

Defined in: packages/pleco-xa/src/loop/primitives.js:213

Halve the current loop duration

any

  • { success: boolean, loop: Object, reason?: string }

moveLoopForward(): any

Defined in: packages/pleco-xa/src/loop/primitives.js:275

Move loop forward by its current duration

any

  • { success: boolean, loop: Object, reason?: string }

resetLoop(): any

Defined in: packages/pleco-xa/src/loop/primitives.js:303

Reset loop to full audio duration

any

  • { success: boolean, loop: Object }

setAudioBuffer(audioBuffer): void

Defined in: packages/pleco-xa/src/loop/primitives.js:205

Set audio buffer for loop calculations

AudioBuffer

Web Audio API AudioBuffer

void


setLoop(start, end): any

Defined in: packages/pleco-xa/src/loop/primitives.js:326

Set custom loop boundaries

number

Start position (0-1)

number

End position (0-1)

any

  • { success: boolean, loop: Object, reason?: string }

setMinLoopDuration(durationSeconds): void

Defined in: packages/pleco-xa/src/loop/primitives.js:194

Set minimum loop duration

number

Minimum loop duration in seconds (e.g. 0.001 for 1ms)

void