Class: Rhythm

Rhythm

A Rhythm generates {time, intensity, duration} tuples (intensity and duration optional depending on constructor properties).

Constructor

new Rhythm(rhythm, options)

Parameters:
Name Type Description
rhythm String | Iterable

either a String or Iterable of delta-start times

If it's a String, it can contain the following characters:

  • "X" - accented note
  • "x" - normal note
  • "=" - tie
  • "." - rest Each character's duration is a 'time unit' that is the duration of the rate option.

If it's a Iterable of delta-start times, it represents the time between each note (and the start of sequence for the first note). The times are are relative to the rate option.

Iterable
options Object
Properties
Name Type Attributes Default Description
rate Number <optional>
1/4

rate the number of beats each 'time unit' represents (e.g. 1/4 is a quarter of one beat, which is a sixteenth note in common time signatures)

Source:

Methods

(static) distribute(pulses, total, options)

Generates a Rhythm by evenly distributes the given number of pulses into the given total number of time units. Very similar to a "Euclidean rhythm".

Parameters:
Name Type Description
pulses number
total number
options

accepts the same options as the constructor, plus a rotation option

Source:
See: