An apparatus and a method for detecting the structure of a music piece
which produces partial music data pieces each including a predetermined
number of consecutive chords starting from a position of each chord in
chord progression music data; compares the partial music data pieces with
the chord progression music data to calculate degrees of similarity for
each of the partial music data pieces; detects a position of a chord in
the chord progression music data where the calculated similarity degree
indicates a peak value higher than a predetermined value for each of the
partial music data pieces; and calculates the number of times that the
calculated similarity degree indicates a peak value higher than the
predetermined value for all the partial music data pieces for each chord
position in the chord progression music data to produce a detection
output representing the structure of the music piece.