REF / Music API / Rhythm

Ascene . Agraph . Aengine . Anode
Songbook . Song
WSLoader . Sound Loaders
Random . Rhythm . TimeKeeper
MIDI . OSC . HID . Piano
Plot . Envelope . Util
Music Theory with Tonal

right-click to navigate to page sections


Rhythm offers a small collection of utility functions for describing rhythm. We adopt the same convention as Tonal.js for patterns. A pattern is a binary array (ones and zeros) where 1 represents a rhythmic event (a whack) and 0 represents a rest. Many of these functions are implemented by Tonal but collected here for convenience.

API

These functions reside within the Rhythm namespace.

Function Description
Arp(index) Return one of 15 (0-14) predefined 16-step patterns. Used in synth arpeggiators.
Euclid(steps, beats) Generates a Euclidian rhythm pattern.
Binary(a, ...) Create a rhythm pattern from a number or concatenation of numbers in binary form.
Hex(a) Create a rhythmic pattern using an hexadecimal numbers.
Random(length,threshold=.5) Create a random rhythm pattern with a specified length.
Probability(thresholds) Create a rhythm pattern based on the given probability thresholds.
Rotate(pattern, steps) Circularly rotate a pattern right.