Scale supports arbitrary octave divisions and ratios, and (in conjunction with Tuning) can generate pitch information in various ways, including as input to Patterns.
*major, *minor, *dorian, *chromatic, *todi, *hijaz, *partch_o1, etc.
Creates a scale from the library stored in the instance variable "all". Each scale comes with an appropriate default Tuning, but alternate tunings can be specified at creation time:
If the tuning size does not match the scale's -pitchesPerOctave, a warning will be thrown, and the scale will use its default tuning.
For a complete list of available scales, execute
The scale repository, to which new scales can be added.
Access from the scale repository.
Creates a random scale from the library, constrained by size and pitchsPerOctave if desired.
Creates a Scale from scratch. degrees should be an array of Integers or scale name. If pitchesPerOctave is nil, will guess the most appropriate number based on degrees. tuning can be an instance of Tuning or a symbol; if nil, will be equal temperament of pitchesPerOctave. Specify descDegrees if the Scale should play differently when descending than when ascending; otherwise it should be nil.
Returns a chromatic scale for a specific tuning.
Sets or gets the tuning of the Scale.
inTuning |
can be either an instance of Tuning or a symbol matching a library tuning. |
Returns a tuned array of semitone values. -as(Array) is equivalent; -as(List) returns it as a list, etc.
Returns a tuned array of cent values.
Returns a tuned array of ratios.
Converting. For example as(Array)
, as(List)
and as(LocalBuf)
which is useful for server-side work.
Returns the length of the scale.
Returns the size of the pitch class set from which the tuning is drawn.
Usually 12, but may be different if the current tuning has a stretched or compressed octave. Needed for degreeToKey.
but note:
These access the array generated by semitones.
Returns a frequency based on current tuning and rootFreq argument.
Returns a ratio based on current tuning.