is

EDO# is

A collection of functions that return a boolean

Methods

# (static) element_of(arr, bigger_arr) → {Boolean}

Returns True if arr is an element in an array of arrays (bigger_arr)

Parameters:
Name Type Description
arr Array.<Number>

a collection of pitches (not necessarily pitch classes)

bigger_arr Array.<Array.<Number>>

an array of arrays containing a collection of pitches (not necessarily pitch classes)

Source:
Returns:
Type
Boolean
Examples
let edo = new EDO(12) // define a tuning system
edo.is.element_of([2,4],[[1,2,3,4],[1,2,4]])
//returns false (the set [2,4] is NOT equal to [1,2,3,4] or to [1,2,4])
let edo = new EDO(12) // define a tuning system
edo.is.element_of([2,4],[[1,2,3,4],[1,2,4],[2,4]])
//returns true

# (static) rotation(collection1, collection2) → {Boolean}

Returns true the two given collections of pitches are a rotation of one another.

Parameters:
Name Type Description
collection1 Array.<Number>

a collection of pitches (not necessarily pitch classes)

collection2 Array.<Number>

a collection of pitches (not necessarily pitch classes)

Source:
Returns:
Type
Boolean
Example
let edo = new EDO(12) // define a tuning system
edo.is.rotation([0,2,4,5,7,9,11],[2,4,5,7,9,11,0])
//returns true

# (static) same(arr1, arr2) → {Boolean}

Returns True if arr1 equals arr2 in contents and in order.

Parameters:
Name Type Description
arr1 Array.<Number>

a collection of pitches (not necessarily pitch classes)

arr2 Array.<Number>

a collection of pitches (not necessarily pitch classes)

Source:
Returns:
Type
Boolean
Examples
let edo = new EDO(12) // define a tuning system
edo.is.same([2,4],[4,2]])
//returns false
//Also supports more complicated structures
let edo = new EDO(12) // define a tuning system
edo.is.same([2,[4,[1,2,3]]],[2,[4,[1,2,3]]])
//returns true

# (static) subset(thing, thing2, track_quantities) → {Boolean}

Returns true if some collection of pitches (thing) is a subset of another collection of pitches (thing2)

Parameters:
Name Type Description
thing Array.<Number>

a collection of pitches (not necessarily pitch classes)

thing2 Array.<Number>

a collection of pitches (not necessarily pitch classes)

track_quantities Boolean

If true, the number of quantities needs to match as well. So every item will only be counted once.

Source:
Returns:
Type
Boolean
Example
let edo = new EDO(12) // define a tuning system
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])

edo.is.subset([2,2,4],[1,2,3,4,5])
//returns true (the set [2,4] IS a subset of [1,2,3,4,5])

edo.is.subset([2,2,4],[1,2,3,4,5],track_quantities=true)
//returns true (the set [2,2,4] is NOT a subset of [1,2,3,4,5])

edo.is.subset([2,2,4],[1,2,3,2,4,5],track_quantities=true)
//returns true (the set [2,2,4] IS a subset of [1,2,3,2,4,5])

# (static) transposition(collection1, collection2) → {Boolean}

Returns true the two given collections of pitches are a transposition of one another.

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

Parameters:
Name Type Description
collection1 Array.<Number>

a collection of pitches (not necessarily pitch classes)

collection2 Array.<Number>

a collection of pitches (not necessarily pitch classes)

Source:
Returns:
Type
Boolean
Example
let edo = new EDO(12) // define a tuning system
edo.is.transposition([0,2,4,5,7,9,11],[5,7,9,10,0,2,4]) //C major and F major
//returns true