harmonic-fit - fits melody to common-practice progressions


  $ harmonic-fit c g | head -3
  84    c
  27    g
  8     f

  $ atonal-util gen_melody
  ees f e d g des c b aes a ges bes
  $ harmonic-fit ees f e d g des c b aes a ges bes
  189   g
  95    c
  71    d
  60    a
  53    f
  48    dis
  40    cis
  40    e
  37    b
  30    ais
  22    fis
  18    gis


Fits a sequence of lilypond notes to a frequency chart of roman numeral progressions starting on each root pitch of the 12-tone scale. This may reveal what keys a sequence of notes likely belong to, and if so how strongly.

Care must be taken in what this program is fed; too much input may span several keys or key areas, and thus the fit will be less specific. Use short phrases, or analyze a specific number of measures, and if necessary input just the downbeat notes or otherwise implied harmony. This will require care, consistency, and good judgement. Comparison between different phrases should only be made if they are of the same length; otherwise, compensation will be necessary to normalize the resulting numbers.

This utility may also assist atonal analysis; the above example shows that the random phrase may tend towards G-something, which may or may not be desirable.


This program supports the following command line switches:


Optional chart file. JSON format; consult the DATA section of this program for details on what is used by default.


Lack of input validation, notably, and not much testing to see if the results make sense or are usable for any purpose.

If the bug is in the latest version, send a report to the author. Patches that fix problems or add new features are welcome.



Copyright 2012 Jeremy Mates

This program is distributed under the (Revised) BSD License: