Reference p5.SoundLoop

p5.SoundLoop

SoundLoop

Examples

Syntax

p5.SoundLoop(callback, [interval])

Parameters

callback
Function:

this function will be called on each iteration of theloop

interval
Number|String:

amount of time (if a number) or beats (if a string, following Tone.Time convention) for each iteration of the loop. Defaults to 1 second.

Fields

bpm

Getters and Setters, setting any paramter will result in a change in the clock's frequency, that will be reflected after the next callback beats per minute (defaults to 60)

timeSignature

number of quarter notes in a measure (defaults to 4)

interval

length of the loops interval

iterations

how many times the callback has been called so far

musicalTimeMode

musicalTimeMode uses Tone.Time convention true if string, false if number

maxIterations

Set a limit to the number of loops to play. defaults to Infinity

Methods

start

Start the loop

stop

Stop the loop

pause

Pause the loop

syncedStart

Synchronize loops. Use this method to start two or more loops in synchronization or to start a loop in synchronization with a loop that is already playing This method will schedule the implicit loop in sync with the explicit master loop i.e. loopToStart.syncedStart(loopToSyncWith)

Notice any errors or typos? Please let us know. Please feel free to edit lib/addons/p5.sound.js and open a pull request!

Related References