Harmony:
Filter:
superharmony/Classes (extension) | Chords | Harmonies | Tonalities

Harmony
ExtensionExtension

Representation of a chord with its harmonic content.

Description

Defines a chord as an array of numbers toghether with its harmonic content, including its chord type, base and inversion.

Part of superharmony, a library with utilities for tonal analysis of chords.

Class Methods

.new

Creates a new Harmony instance, it takes an array of integer numbers. Can be called with the shorthand notation

.create

Creates a four voice harmony instance from the fundamental note and chord type from the list in ChordsDefinition where you can select triads, sevenths and ninth chords among others. For example

Arguments:

Fundamental note of the chord as an integer number.

Type of chord, see ChordsDefinition for available types.

Instance Methods

Accessing

.equivalent

Checks if two chords have the same chord and type, regardless of number of voices and order or octave.

.fundamental

Fundamental interger value of a chord.

.fundamentalString

Fundamental string value of a chord.

.harmonyTypeStr

String value of the harmony type

.inversion

Numerical value of the inversion of the chord, CM in root value would be [0,4,7] would have value 0, first inversion [4,7,12] would have value 1, and so on.

.inversionStr

String value of the inversion of the chord, CM in root value would be [0,4,7,11] would have value "7" as a seventh chord in root position, first inversion [4,7,12] would have value "6,5". Other inversions would have "6,4", "4,3", "2". This method works for triads and seventh chords.

.notesHarmony

Array with the sorted notes in the harmony.

.notesSimplified

Array with simplified version of the array of notes. Notes are converted to pitch class module 12, duplicates are removed and elements are sorted ascending.

.nameHarmonyNoInversionStr

String with fundamental letter value an type of chord string value

.nameHarmonyString

String with fundamental letter value an type of chord string value with inversion string added.

.notesInterval

Degree of each chord with respect to chord type, for example for C Major seventh chord [0,4,7,11], 0 would be the fundamental 1, 4 would be the and interval of third, 7 an interval of fifth and 11 the seventh interval.

.print

Prints information about the harmony: Fundamental string, type, inversion, notes, simplified notes and interval types

.printSimple

Prints simplifiedinformation about the harmony: Fundamental string, type and inversion.

Examples

Creating a chord

Authors

Cristian Banuelos, 2022.