Constructor
# new EDO(edo)
Creates a tuning context and system that exposes powerful functions for manipulating, analyzing, and generating music.
This is the main class of the project. At its center stand 7 collections (see "Namespaces" below) of functions.
- EDO.convert is a set of functions used to change between equivalent representations within the tuning context.
- EDO.count is a set of functions used to count stuff.
- EDO.get is a set of functions used to manipulate and generate stuff.
- EDO.is is a set of functions used for boolean truth statements.
- EDO.show is a set of functions used for visualization.
- EDO.midi is a set of functions used for importing and processing midi files.
- EDO.xml is a set of functions used for- importing and processing musicXML files.
- EDO.export is a set of functions used for exporting the output to various formats.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
edo |
number | 12 | The number of equal divisions of the octave. |
Example
//Basic usage:
let edo = new EDO(12) //create a new EDO context with 12 divisions.
//once the object has been created, you can access its functions.
edo.get.inversion([0,2,4,5,7,9,11]) //inverts the pitches
//returns [0, 2, 4, 6, 7, 9, 11]
edo.convert.ratio_to_interval(3/2)
//returns [7]
edo.count.pitches([0, 3, 3, 2, 4, 3, 4])
//returns [[3,3],[4,2], [2,1], [0,1]] (3 appears 3 times, 4 appears 2 times, etc.)
edo.is.subset([2,4],[1,2,3,4,5])
//returns true (the set [2,4] IS a subset of [1,2,3,4,5])
Namespaces
Methods
# scale(pitches) → {Scale}
Returns a new Scale Object with given pitches
Remark: "pitch classes" conform to the current tuning system used. 0-11 in 12EDO, 0-16 in 17EDO, etc.
Parameters:
Name | Type | Description |
---|---|---|
pitches |
Array.<Number> | a collection of pitch classes |
Returns:
- Type
- Scale