def __init__(self, components=None, durations=None, span=1, lone=False, direction=None, overrides=None, ): ComplexBeamSpanner.__init__( self, components=components, direction=direction, overrides=overrides, ) self.durations = durations self.span = span self.lone = lone
def _fracture_right(self, i): self, left, right = ComplexBeamSpanner._fracture_right(self, i) weights = [left.get_duration(), right.get_duration()] assert sum(self.durations) == sum(weights) split_durations = sequencetools.split_sequence_by_weights( self.durations, weights, cyclic=False, overhang=False) left_durations, right_durations = split_durations left._durations = left_durations right._durations = right_durations return self, left, right
def _copy_keyword_args(self, new): ComplexBeamSpanner._copy_keyword_args(self, new) new.durations = self.durations[:] new.span = self.span
def _reverse_components(self): ComplexBeamSpanner._reverse_components(self) self._durations.reverse()