scamp_extensions.rhythm.metric_structure

Contains the MetricStructure class, which provides a highly flexible representation of metric hierarchy. The easiest and most flexible way of creating MetricStructures is through the from_string() method, which makes use of the MeterArithmeticGroup class to parse expressions like “(2 + 3 + 2) * 3” (which would representing a 6/8 + 9/8 + 6/8 additive compound meter).

Classes

MetricStructure(*groups[, ...])

A highly flexible representation of a metric hierarchy, capable of describing both additive, multiplicative, and hybrid additive/multiplicative meters.

MeterArithmeticGroup(elements, operation)

This class exists as an aid to parsing arithmetic expressions into MetricStructures.

Functions

flatten_beat_groups(beat_groups[, ...])

Returns a flattened version of beat_groups, unraveling the outer layer according to rules of indispensability.