scamp_extensions.composers.barlicity.calculate_metric_similarity

scamp_extensions.composers.barlicity.calculate_metric_similarity(rhythmic_strata_away: Sequence[Union[Tuple, int]], bar_tempo_away: float, rhythmic_strata_home: Sequence[Union[Tuple, int]], bar_tempo_home: float, standard_barlow: bool = True)[source]

As Barlow explains on page 46 of “On Musiquantics,” the metric coherece of a meter with itself is not always 1. This is because metric coherence conflates a measurement of the similarity of two meters with a measurement of the complexity of each of these meters. Metric similarity compensates for this by comparing a “home” meter with an “away” meter, and dividing the coherence of the two meters by the auto_coherence of the first meter with itself. With this scaling, the metric similarity of a meter with itself is always 1. (Note that this is not commutative the similarity of A to B is not the same as the similarity of B to A. This is why we distinguish a home from an away meter.)

Parameters:
Returns:

the similarity of the two meters as a float between 0 and 1