MeasureQuantizationScheme(beat_schemes: Sequence[scamp.quantization.BeatQuantizationScheme], time_signature: Union[scamp.quantization.TimeSignature, str], beat_groupings: Sequence = 'auto')¶
Scheme for quantizing a measure, including beat lengths and which beat divisors to allow.
beat_schemes – list of BeatQuantizationSchemes for each beat in the measure
time_signature – a TimeSignature or string representing a time signature for this measure
beat_groupings – a (potentially nested) list/tuple representing how beats come together to form larger groupings. For instance, in 4/4 time the beat_groupings will default to (2, 2).
Constructs a MeasureQuantizationScheme from a time signature.
Generates a list of hierarchies representing how nested a subdivision is within the metric structure.
from_time_signature(time_signature: Union[scamp.quantization.TimeSignature, str, float], max_divisor: int = 'default', max_divisor_indigestibility: float = 'default', simplicity_preference: float = 'default') → scamp.quantization.MeasureQuantizationScheme¶
Constructs a MeasureQuantizationScheme from a time signature. All beats will follow the same quantization scheme, as dictated by the parameters.
time_signature – Either a TimeSignature object or something that can be interpreted as such (e.g. a string to parse as a time signature, a measure length)
max_divisor – the max divisor for all beats in the is measure (see
max_divisor_indigestibility – the max indigestibility for all beats in the is measure (see
simplicity_preference – the simplicity preference for all beats in the is measure (see
get_beat_hierarchies(subdivision_length: float) → Sequence[int]¶
Generates a list of hierarchies representing how nested a subdivision is within the metric structure. For instance, if called on a 4/4 measure, with subdivision_length, 0.5, this will return the list [0, 3, 2, 3, 1, 3, 2, 3], showing that the first subdivision (downbeat) is the strongest, the 5th (3rd beat) is one level down, etc.
subdivision_length – length (in quarter notes) of the subdivision