Tone.Pattern

↳ EXTENDS Tone.Loop

Tone.Pattern arpeggiates between the given notes in a number of patterns. See Tone.CtrlPattern for a full list of patterns.

CONSTRUCTOR

new Tone.Pattern (
callback
,
values
)
callback

The callback to invoke with the event.

type: function
values

The values to arpeggiate over.

type: Array

DEFAULTS

{
pattern : Tone.CtrlPattern.Type.Up ,
callback : Tone.noOp ,
values : []
}

EXAMPLE

var pattern = new Tone.Pattern(function(time, note){
  //the order of the notes passed in depends on the pattern
}, ["C2", "D4", "E5", "A6"], "upDown");
 

Members

.values

Array #

The array of events.

</>

.index

Positive #

The current index in the values array.

</>

.pattern

String #

The pattern type. See Tone.CtrlPattern for the full list of patterns.

</>

.value

* READONLY #

The current value of the pattern.

</>
inherited from Tone.Loop

.interval

Time #

The time between successive callbacks.

EXAMPLE

loop.interval = "8n"; //loop every 8n
 
</>
inherited from Tone.Loop

.mute

Boolean #

Muting the Loop means that no callbacks are invoked.

</>
inherited from Tone.Loop

.callback

function #

The callback to invoke with the next event in the pattern

</>
inherited from Tone.Loop

.playbackRate

Time #

The playback rate of the loop. The normal playback rate is 1 (no change). A playbackRate of 2 would be twice as fast.

</>
inherited from Tone.Loop

.probability

NormalRange #

The probably of the callback being invoked.

</>
inherited from Tone.Loop

.progress

NormalRange READONLY #

The progress of the loop as a value between 0-1. 0, when the loop is stopped or done iterating.

</>
inherited from Tone.Loop

.humanize

Boolean or Time #

Random variation +/-0.01s to the scheduled time. Or give it a time value which it will randomize by.

</>
inherited from Tone.Loop

.state

String READONLY #

The state of the Loop, either started or stopped.

</>
inherited from Tone.Loop

.iterations

Positive #

The number of iterations of the loop. The default value is Infinity (loop forever).

</>

Methods

.dispose ( )

#
↪ returns Tone.Pattern

this

Clean up

</>
inherited from Tone.Loop

.cancel ( )

#
time

The time after which events will be cancel.

default: 0
↪ returns Tone.Loop

this

Cancel all scheduled events greater than or equal to the given time

</>
inherited from Tone.Loop

.start ( )

#
time

When to start the Loop.

optional
↪ returns Tone.Loop

this

Start the loop at the specified time along the Transport’s timeline.

</>
inherited from Tone.Loop

.stop ( )

#
time

When to stop the Loop.

optional
↪ returns Tone.Loop

this

Stop the loop at the given time.

</>
docs generated Sep 15 2019