Determining a musical piece's style and key using maths

Computes various indices to evaluate tonality as proposed in M.A. thesis, MATHEMATICAL MUSIC ANALYSIS: A HOLISTIC APPROACH, Univ. of Georgia

You are now following this Submission

This program file contains the MATLAB code for analyzing a musical piece for its tonality and compositional style using various mathematical indices as proposed in Nicholas J. Lindell's M.A. thesis. These indices only utilize information about the frequency distribution of notes and transitions between notes in a piece, encoded in what is called a "flow matrix" in compartmental network analyses; essentially, the (i,j) entry represents how many times note i follows note j in the piece. This information is enough to determine, with reasonable accuracy, whether a piece is composed "serially," "atonally" but not serially, or within the "tonal system."

Tools for extracting frequency distributions and flow matrices from MIDI files have also been compiled for the analysis in the thesis, and can be found in the project "Analyzing musical compartmental networks using MIDI files" by the same author.

Detailed descriptions of the indices' formulation and usage can be found in the thesis, "Mathematical music analysis: a holistic approach," obtainable from the University of Georgia or from the author.

Cite As

NIcholas Lindell (2026). Determining a musical piece's style and key using maths (https://www.mathworks.com/matlabcentral/fileexchange/72167-determining-a-musical-piece-s-style-and-key-using-maths), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.1

Updated description and referenced my other project which computes the information necessary to use these tools

1.0.0