Musical Key Detection Using a Triple Composite Signature of Fifths
Abstract
This article introduces a novel algorithm for key detection in musical compositions represented in symbolic form, such as MIDI. The method is based on the analysis of a triple composite signature of fifths (TCSF), which is formed by combining the signatures of fifths obtained individually for the beginning, the end, and the entirety of the analyzed piece. The key is determined by the sign of the angle between the characteristic vector of the TCSF and the major/minor mode axis derived from that signature. To evaluate the algorithm’s effectiveness, experiments were conducted using Chopin’s Preludes, Op. 28, pieces from the Saarland Music Data: MIDI-Audio Piano Music dataset, as well as pieces from the Schubert Winterreise Dataset. As a reference method, a correlation-based algorithm implementing various tonal profiles was used. The proposed algorithm achieved the highest accuracy for Chopin’s Preludes and the Schubert Winterreise Dataset (91.67% in both cases), while for the Saarland Music Data, its accuracy was lower than that of the correlation-based approaches (72.34 %). The main advantages of the presented algorithm are low computational complexity, stable decision-making when extending the analytical window, as well as incorporation of expert analysis aspects, particularly by focusing on the beginning and end of the composition.
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Archives of Acoustics

This work is licensed under a Creative Commons Attribution 4.0 International License.