def __init__( self, direction=None, isolated_nib_direction=False, overrides=None, span_beam_count=1, ): ComplexBeam.__init__( self, direction=direction, isolated_nib_direction=isolated_nib_direction, overrides=overrides, ) assert isinstance(span_beam_count, (int, type(None))) self._span_beam_count = span_beam_count
def __init__( self, direction=None, durations=None, isolated_nib_direction=False, nibs_towards_nonbeamable_components=True, overrides=None, span_beam_count=1, ): ComplexBeam.__init__( self, direction=direction, isolated_nib_direction=isolated_nib_direction, overrides=overrides, ) durations = self._coerce_durations(durations) self._durations = durations assert isinstance(nibs_towards_nonbeamable_components, bool) self._nibs_towards_nonbeamable_components = \ nibs_towards_nonbeamable_components assert isinstance(span_beam_count, (int, type(None))) self._span_beam_count = span_beam_count
def _fracture_right(self, i): self, left, right = ComplexBeam._fracture_right(self, i) weights = [ inspect_(left).get_duration(), inspect_(right).get_duration(), ] assert sum(self.durations) == sum(weights) split_durations = sequencetools.split_sequence( 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): ComplexBeam._copy_keyword_args(self, new) if self.durations is not None: new._durations = self.durations[:] new._span_beam_count = self.span_beam_count
def _reverse_components(self): ComplexBeam._reverse_components(self) durations = reversed(self.durations) durations = tuple(durations) self._durations = durations
def _copy_keyword_args(self, new): ComplexBeam._copy_keyword_args(self, new) new._span_beam_count = self.span_beam_count