This page contains supplementary files for the paper Milne, A. J., Sethares, W. A., Laney, R., and Sharp, D. B. (2011b). Modelling the similarity of pitch collections with expectation tensors. *Journal of Mathematics and Music*, 5(1), 1–20. doi:10.1080/17459737.2011.573678

The package PitchMetrics.zip consists of a number of MATLAB routines to calculate the pitch domain distance between pitch collections (such as chords, melodies, scales, tunings, virtual pitches, or spectral pitches). Some of these routines were used to generate the figures and data in the above paper.

PCSetPairDist.m measures the distance between any two pitch collections.

BetaChainDist.m measures the distance between a reference pitch collection and a variety of differently tuned generated scales.

nTETsDist.m measures the distance between a reference pitch collection and a variety of different equal tunings.

TonesSpectralDist.m measures the distance between the partials of a reference tone and the partials of a variety of differently tuned tones.

DyadSpectralDist.m measures the distance between the partials of a reference dyad and the partials of a variety of differently tuned dyads.

TriadSpectralDist.m measures the distance between the partials of a reference triad and the partials of a variety of differently tuned triads.

Each routine calls the function ExpectationMetrics.m, which embeds the pitch collections into a variety of different expectation tensors (multi-dimensional arrays), and calculates their distance with a variety of standard metrics. The actual expectation tensor and metric used is chosen by the routine that calls ExpectationMetrics.m.

Depending on the order of the tensor (dimension of the array), the embeddings reflect the pitch, dyad, triad, or tetrad content of the tone collection. Furthermore, the pitches can be absolute or relative - in the latter case the embeddings are invariant with respect to musical transposition.

The pitch domain distances calculated by these routines, differ from familiar voice-leading distances. The former are based on metrics between embeddings in the pitch domain (the range is expected number of tones heard), while the latter are based on metrics between embeddings in a categorical domain such as voice (e.g., bass, tenor, alto, soprano) (the range is pitch).

Pitch domain embeddings allow distances to be calculated between pitch collections with differing numbers of tones, and are more appropriate when tones cannot be simply categorised (such as the large number of resolvable partials in complex tones and chords). See the above-mentioned paper for a fuller discussion.