HarmonicMetric:
Filter:
DissonanceLib/Classes (extension) | DissonanceLib

HarmonicMetric
ExtensionExtension

Abstracts different harmonic metrics.

Switches between harmonic measures in SequenceableCollection: -rationalize and in classes such as Dissonance and PitchSet.

Description

This class is used in Dissonance and PitchSet in order to classify and analyze the generated intervals according to different harmonic metrics. The ones included are the most useful (Tenney's Harmonic Distance, Barlow's Harmonicity and Euler's Gradus Suavitatis) but others can be added to the class. See numberExtras for more info on the definition of the metrics.

Class Methods

.new

metric - A symbol. Can be \harmonicity, \harmonicDistance or \gradusSuavitatis. Default is \harmonicity.

Instance Methods

.type

Instance Variable. The current type of harmonic metric. Can be changed.

.value

Give the values of the harmonic metric for an array of [p, q] ratios. ratios - A collection of ratios or a single [p,q] ratio.

.mostHarmonic

Returns the most harmonic ratio from the collection according to the current type of metric. ratios - A collection of ratios.

.leastHarmonic

Same as above but for the least harmonic of a ratio collection. ratios - A collection of ratios.

.order

Order the collection of ratios according to the current harmonic metric type.

.asString

Allows the representation of an instance object printout its type. It is not used on its own.