Skip to content

08 Chords and harmony

Gene Boggs edited this page Feb 6, 2023 · 37 revisions

Constructing chords at random - Oof!

Example 1

Constructing chords by name

Example 2

Here, the handy Music::Chord::Note module is used.

Another option, if wanting to construct guitar chords, is to use the MIDI::Chord::Guitar module.

Exhibit A

modal-chords

Exhibit B

autumn-leaves

Use a dyad

Sometimes a dyad (2-note "chord", like the I and V notes) suffices to give the impression that chords are happening if there is a melodic line, which effectively adds the third note.

Example 3

Inversions

Say we have a chord like C major (C4-E4-G4), and we want the first or second inversion. Sure, we could just rewrite it to be E4-G4-C5 or G4-C5-E5. But that's not programming (and in this case, gymnastics).

Example 4

Neo-Riemannian operations

Perform Neo-Riemannian operations on major and minor triads, and seventh chords with the excellent Music::NeoRiemannianTonnetz module.

Here are examples: transform & transform-chain & transform-chords

Chord progressions

This is what we are really after. Here is an example of a randomized state machine that selects chords from the major scale using the default settings of the Music::Chord::Progression module:

Example 5

Exhibit C

chord-melody

Clone this wiki locally