Class: Chord

music21.chord. Chord

new Chord(notes)

Chord related objects (esp. music21.chord.Chord) and methods.

Parameters:
Name Type Argument Description
notes Array.<(string|music21.note.Note|music21.pitch.Pitch)> <optional>

an Array of strings
(see music21.pitch.Pitch for valid formats), note.Note, or pitch.Pitch objects.

Properties:
Name Type Argument Default Description
length number

the number of pitches in the Chord (readonly)

pitches Array.<music21.pitch.Pitch>

an Array of Pitch objects in the chord. (Consider the Array read only and pass in a new Array to change)

isChord Boolean <optional>
true
isNote Boolean <optional>
false
isRest Boolean <optional>
false
Source:

Extends

Methods

<static> Chord#add(notes, runSort) → {music21.chord.Chord}

Adds a note to the chord, sorting the note array

Parameters:
Name Type Default Description
notes string | music21.note.Note | music21.pitch.Pitch

the Note or Pitch to be added or a string defining a pitch.

runSort boolean true

Sort after running (default true)

Source:
Returns:

the original chord.

Type
music21.chord.Chord

<static> Chord#bass() → {music21.pitch.Pitch}

Gets the lowest note (based on .ps not name) in the chord.

Source:
Returns:

bass pitch

Type
music21.pitch.Pitch

<static> Chord#canBeTonic() → {Boolean}

Returns true if the chord is a major or minor triad

Source:
Returns:
Type
Boolean

<static> Chord#cardinality() → {number}

Counts the number of non-duplicate pitch MIDI Numbers in the chord.

Call after "closedPosition()" to get Forte style cardinality disregarding octave.

Source:
Returns:
Type
number

<static> Chord#getChordStep(chordStep, testRoot) → {music21.pitch.Pitch|undefined}

Returns the Pitch object that is a Generic interval (2, 3, 4, etc., but not 9, 10, etc.) above
the .root()

In case there is more that one note with that designation (e.g., [A-C-C#-E].getChordStep(3))
the first one in .pitches is returned.

Parameters:
Name Type Argument Description
chordStep Int

a positive integer representing the chord step

testRoot music21.pitch.Pitch <optional>

the Pitch to use as a temporary root

Source:
Returns:
Type
music21.pitch.Pitch | undefined

<static> Chord#inversion() → {number}

Returns the inversion of the chord as a number (root-position = 0)

Unlike music21 version, cannot set the inversion, yet.

TODO: add.

Source:
Returns:
Type
number

<static> Chord#isMajorTriad() → {Boolean}

Source:
Returns:
Type
Boolean

<static> Chord#isMinorTriad() → {Boolean}

Source:
Returns:
Type
Boolean

<static> Chord#removeDuplicatePitches() → {music21.chord.Chord}

Removes any pitches that appear more than once (in any octave), removing the higher ones, and returns a new Chord.

Source:
Returns:

A new Chord object with duplicate pitches removed.

Type
music21.chord.Chord

<static> Chord#root() → {music21.pitch.Pitch}

Finds the Root of the chord.

Source:
Returns:

the root of the chord.

Type
music21.pitch.Pitch

<static> Chord#semitonesFromChordStep(chordStep, testRoot) → {number|undefined}

Returns the number of semitones above the root that a given chordstep is.

For instance, in a G dominant 7th chord (G, B, D, F), would
return 4 for chordStep=3, since the third of the chord (B) is four semitones above G.

Parameters:
Name Type Argument Description
chordStep number

the step to find, e.g., 1, 2, 3, etc.

testRoot music21.pitch.Pitch <optional>

the pitch to temporarily consider the root.

Source:
Returns:

Number of semitones above the root for this chord step or undefined if no pitch matches that chord step.

Type
number | undefined

<static> Chord#vexflowNote(options) → {Vex.Flow.StaveNote}

Parameters:
Name Type Description
options object

a dictionary of options {clef: {@music21.clef.Clef} } is especially important

Source:
Returns:
Type
Vex.Flow.StaveNote
Music21j, Copyright © 2013-2018 Michael Scott Cuthbert and cuthbertLab.
Documentation generated by JSDoc 3.5.5 on Wed Jul 4th 2018 using the DocStrap template.