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.]
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) 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 | Default | Description |
---|---|---|---|---|
cache |
Boolean |
<optional> |
false | when true, the result is cached for future retrieval |
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]