to

Scale# to

A collection of functions that convert data from one representation to another

Methods

# (static) cents() → {Array.<Number>}

Returns the scale's representation in cents [0,100,300, etc.]

Source:
Returns:
Type
Array.<Number>
Example
let edo = new EDO(12) //define context
let scale = edo.scale([0,2,4,5,7,9,11]) //new Scale object
scale.to.cents() //returns [0,200,400,500,700,900,1100]

# (static) EDO(new_edoopt) → {Scale}

Returns the current scale in the specified edo (if it exists in it). If this scale cannot be expressed in the desired tuning, the fundtion will return undefined.

Parameters:
Name Type Attributes Description
new_edo Number <optional>

The number of equal divisions of the target tuning system

Source:
Returns:
Type
Scale
Example
let edo = new EDO(12) //define context
let scale = edo.scale([0,2,4,5,7,9,11]) //new Scale object
scale.to.EDO(24) //returns a Scale Object corresponding to [0, 4, 8, 10, 14, 18, 22] in 24EDO

# (static) steps(cacheopt) → {Array.<Number>}

Instead of pitch-classes, this returns the scale represented by intervals (steps between notes)

Remark: "steps" and "pitch classes" conform to the current tuning system used. E.g., 0-11 occupy 1 octave in 12EDO, 0-16 in 17EDO, etc.

Parameters:
Name Type Attributes Description
cache Boolean <optional>

when true, the result is cached for future retrieval

Source:
Returns:
Type
Array.<Number>
Example
let edo = new EDO(12) //define context
let scale = edo.scale([0,2,4,5,7,9,11]) //new Scale object
scale.to.steps() //returns [2,2,1,2,2,2,1]