Hofmann-Engl [5] describes several possible calculations for melodic similarity based upon his idea of melodic chains. He defines the similarity of two melodies to be a function of what he calls the interval vector and the similarity vector. The similarity vector is defined to be the vector difference between the individual pitch values of the melodic vectors M1 and M2:
Recall that because these pitch values are logarithms, so that these differences can be thought of as the ratios of the fundamental frequencies of the notes in each melodic chain.
The similarity S between two pitch vectors is then defined in terms of the product of two values, one derived from the similarity vector and the other derived from the interval vector. In other words:
S = F1(VS) F2(VI)
The S value will be in the range zero to one, where one is perfect agreement. The subfunctions are then defined as follows:
In these equations c1, c2, k1 and k2 are constants, and si and ii are the ith element of the similarity and interval vectors.
In his own experiments, Hofmann-Engl adjusts the values of the constants to match results from experiments with human subjects.