Chord and Interval Analysis

Exposing the physical guts of chords

Gene Boggs

Epistemologist-at-large

While studying...

Musical Geometry,   etc...

I decided to side-step and do some yak shaving on the size of note intervals and what acoustically makes up a chord.

This turned out to get more complicated, the closer I shaved^Wlooked.

The Problems

Some Visual Context

Pictures are worth at least 1000 words

The Design

Use some handy CPAN bits

  1. Math::Combinatorics

  2. Music::Chord::Namer qw(chordname);

  3. MIDI::Pitch qw(name2freq);

  4. Math::Fraction; # XXX Syntax check spits warnings but does fractional approximation. Submit patch.

  5. Sort::ArbBiLex;

  6. Music::Scales

D#, Eb, E, Fb, E#, F?

The Solution

=> Perl !

On with the show!

 size      = 3,  # Number of notes in a chord.
 octave    = 4,  # Common octave: A=440Hz
 equalt    = 0,  # Show equal temperament.
 justi     = 0,  # Show just, ratio or natural intonation.
 intervals = 0,  # Show chord intervals.
 chords    = 0,  # Show chord names.
 rootless  = 0,  # Show 'no-root' chords.
 cents     = 0,  # Show note cents.
 freqs     = 0,  # Show note frequencies.
 primes    = 0,  # Show prime factorizations.
 tonic     = C,  # C Major tonality only for now.
 temper = 1200/log(2), # Equal temperament factor. 

Example Usage

 perl intervals --size=3 --chords --equalt --intervals C E G
 perl intervals --ch --e --i C E G  # Same as above.
 perl intervals --ch --r --j --p --i C D E
 perl intervals --j --f --i C pM3 pM7  # Pythagoras would be proud.
 perl intervals --j --ce C D D\#       # Intersting analysis...
 perl intervals --j --ce C D Eb
 perl intervals --s=8 --j --ce --f --i C D D\# Eb E E\# Fb F
 perl intervals --j --f --ce --i C 11h 7h  # Crazy! 

Real Example 1

 perl intervals --size=3 --chords --equalt --justi --intervals C E G
 C E G => {
  chords => [C],
  eq_tempered_intervals => {
   C E => 1.25992104989487,
   C G => 1.49830707687668,
   E G => 1.18920711500272
  },
  natural_intervals => {
   C E => { 5/4 => major third },
   C G => { 3/2 => perfect fifth },
   E G => { 6/5 => minor third }
  }
 } 

Real Example 2

 perl intervals --j --f --i C pM3 G
 C pM3 G => {
  natural_frequencies => {
   C   => { 1/1   => unison, perfect prime, tonic },
   G   => { 3/2   => perfect fifth },
   pM3 => { 81/64 => Pythagorean major third }
  },
  natural_intervals => {
   C G   => { 3/2   => perfect fifth },
   C pM3 => { 81/64 => Pythagorean major third },
   pM3 G => { 32/27 => Pythagorean minor third }
  }
 } 

Real Example 3

 > perl intervals --s=9 --j --f --i C D Db D\# Eb E E\# Fb F
 C Db D D# Eb E Fb E# F => {
  natural_frequencies => {
   C  => { 1/1    => unison, perfect prime, tonic },
   D  => { 9/8    => major whole tone },
   D# => { 75/64  => classic augmented second },
   Db => { 27/25  => large limma, BP small semitone (minor second), alternate Renaissance half-step },
   E  => { 5/4    => major third },
   E# => { 125/96 => classic augmented third },
   Eb => { 6/5    => minor third },
   F  => { 4/3    => perfect fourth },
   Fb => { 32/25  => classic diminished fourth }
  },
  ...
 } 

Real Example 3 (cont.)

 > perl intervals --s=9 --j --f --i C D Db D\# Eb E E\# Fb F
 C Db D D# Eb E Fb E# F => { ...,
  natural_intervals => {
   C D   => { 9/8 => major whole tone },
   C D#  => { 75/64 => classic augmented second },
   ...
   Eb E  => { 25/24 => classic chromatic semitone, minor chroma, minor half-step },
   Eb E# => { 625/576 => 1.08506944444444 },
   Eb Fb => { 16/15 => minor diatonic semitone, major half-step },
   Eb F  => { 10/9 => minor whole tone },
   E E#  => { 25/24 => classic chromatic semitone, minor chroma, minor half-step },
   E Fb  => { 128/125 => minor diesis, diesis, diminished second },
   E F   => { 16/15 => minor diatonic semitone, major half-step },
   E# F  => { 128/125 => minor diesis, diesis, diminished second },
   Fb E# => { 3125/3072 => small diesis },
   Fb F  => { 25/24 => classic chromatic semitone, minor chroma, minor half-step }
  }
 } 

Links