Harmonic Analysis of Jazz Chord Sequences
Project Summary

The T2 algorithm is the culmination of work I have done on harmonic analysis of jazz chord sequences in the last two years. The goal of such analysis is to determine the function of each chord and the harmonic structures in the chord sequences.

Previous attempts to solve this problem in the computer music literature are based on formal grammar or production rules. These approaches are unsatisfactory because a grammar or rule base that describes the chord changes of a “typical” jazz tune will not very likely be found. So the algorithms in these research reports are illustrated and evaluated on just a few chord charts that they can handle.

By reexamining the harmonic analysis problem and formulating it as a tonality segmentation problem, the T2 algorithm explicitly models modulations in chord sequences and will correctly analyze all “typical” jazz tunes. In fact T2 produces good results for the entire collection of tunes in Appendix D of Jerry Coker’s book Improvising Jazz.

There are of course a lot of details in the design of the T2 algorithm, and if you are interested you can download a draft of my paper below to read about them.

I believe this to be quite an important problem in computer music, for which I have now provided a good solution. For so long, projects, theses, and products have simulated jazz improvisation in one way or another, but none of them begins by performing a proper harmonic analysis on the chord sequences. With no knowledge of their harmony structures, an automatic accompaniment generator, for instance, cannot help but choose the wrong notes (say in the bass lines) sometimes. Attempts to generate improvised lines are also bound to have the same problem and be incomplete. An algorithm such as T2 is also interesting in its own right for its use in educational and compositional tools.

I have written informally about the design and implementation of T2, the T2 algorithm, and T2G (a GUI version of T2) in my blog. See the jump-off page for these articles.

Some of the programs found on those pages are older versions. So please download them from the links on this page below.


My paper “Jazz Harmonic Analysis as Optimal Tonality Segmentation” which describes the T2 algorithm in detail will appear in the Computer Music Journal 35:2 (Summer 2011).

Here is the source code of T2 (updated May 9, 2011 to match description in CMJ paper), an OCaml implementation of the algorithm I have described in the paper. The zip archive also contains the test data files.


The code was developed and tested using OCaml version 3.11.0. The README.txt file in the archive contains information on how to build and use this program, and its terms of use.

I have also written T2G, a GUI version of T2. T2G includes an automatic accompaniment generation function, as well as the harmonic analysis capability of T2.

Contact Information

Click here for my contact information.

Andrew Choi. Calgary. February 2009 (updated May 2011).