def __init__( self, attachments=None, selector=None, scope=None, is_annotation=None, is_destructive=None, use_only_first_attachment=None, ): HashCachingObject.__init__(self) if attachments is not None: if not isinstance(attachments, collections.Sequence): attachments = (attachments,) attachments = abjad.TypedList(attachments) self._attachments = attachments if selector is not None: assert isinstance(selector, abjad.Selector) self._selector = selector if scope is not None: if isinstance(scope, type): assert issubclass(scope, abjad.Component) else: assert isinstance(scope, (abjad.Component, str)) self._scope = scope if is_annotation is not None: is_annotation = bool(is_annotation) self._is_annotation = is_annotation if is_destructive is not None: is_destructive = bool(is_destructive) self._is_destructive = is_destructive if use_only_first_attachment is not None: use_only_first_attachment = bool(use_only_first_attachment) self._use_only_first_attachment = use_only_first_attachment
def __init__( self, deviations=None, forbid_repetitions=None, grace_expressions=None, logical_tie_expressions=None, pitch_application_rate=None, pitch_specifier=None, pitch_operation_specifier=None, pitches_are_nonsemantic=None, use_self_as_seed_key=None, ): HashCachingObject.__init__(self) self._initialize_deviations(deviations) self._initialize_forbid_repetitions(forbid_repetitions) self._initialize_grace_expressions(grace_expressions) self._initialize_logical_tie_expressions(logical_tie_expressions) self._initialize_pitch_application_rate(pitch_application_rate) self._initialize_pitch_specifier(pitch_specifier) self._initialize_pitch_operation_specifier(pitch_operation_specifier) if pitches_are_nonsemantic is not None: pitches_are_nonsemantic = bool(pitches_are_nonsemantic) self._pitches_are_nonsemantic = pitches_are_nonsemantic if use_self_as_seed_key is not None: use_self_as_seed_key = bool(use_self_as_seed_key) self._use_self_as_seed_key = use_self_as_seed_key
def __init__( self, attachment_handler=None, color=None, comment=None, grace_handler=None, instrument=None, labels=None, minimum_phrase_duration=None, pitch_handler=None, register_handler=None, rhythm_maker=None, seed=None, ): import consort HashCachingObject.__init__(self) if attachment_handler is not None: assert isinstance(attachment_handler, consort.AttachmentHandler) self._attachment_handler = attachment_handler self._color = color if grace_handler is not None: assert isinstance(grace_handler, consort.GraceHandler) self._grace_handler = grace_handler if instrument is not None: assert isinstance(instrument, instrumenttools.Instrument) self._instrument = instrument if labels is not None: if isinstance(labels, str): labels = (labels,) labels = tuple(str(_) for _ in labels) self._labels = labels if minimum_phrase_duration is not None: minimum_phrase_duration = \ durationtools.Duration(minimum_phrase_duration) assert 0 <= minimum_phrase_duration self._minimum_phrase_duration = minimum_phrase_duration if pitch_handler is not None: assert isinstance(pitch_handler, consort.PitchHandler) self._pitch_handler = pitch_handler if register_handler is not None: assert isinstance(register_handler, consort.RegisterHandler) self._register_handler = register_handler if rhythm_maker is not None: prototype = ( rhythmmakertools.RhythmMaker, consort.CompositeRhythmMaker, ) assert isinstance(rhythm_maker, prototype) self._rhythm_maker = rhythm_maker if seed is not None: seed = int(seed) self._seed = seed if comment is not None: comment = str(comment) self._comment = comment
def __init__(self, leaf=None, attachments=None): HashCachingObject.__init__(self) prototype = scoretools.Leaf if leaf is not None: if isinstance(leaf, prototype): leaf = mutate(leaf).copy() elif issubclass(leaf, prototype): leaf = leaf() else: raise ValueError(leaf) self._leaf = leaf if attachments is not None: attachments = tuple(attachments) self._attachments = attachments
def __init__( self, application_rate=None, logical_tie_expressions=None, logical_tie_expressions_are_phrased=None, octavations=None, pitch_range=None, register_specifier=None, register_spread=None, ): HashCachingObject.__init__(self) self._initialize_application_rate(application_rate) self._initialize_logical_tie_expressions(logical_tie_expressions) self._initialize_octavations(octavations) self._initialize_pitch_range(pitch_range) self._initialize_register_specifier(register_specifier) self._initialize_register_spread(register_spread) if logical_tie_expressions_are_phrased is not None: logical_tie_expressions_are_phrased = bool(logical_tie_expressions_are_phrased) self._logical_tie_expressions_are_phrased = logical_tie_expressions_are_phrased
def __init__( self, discard_inner_offsets=None, primary_music_specifier=None, primary_voice_name=None, rotation_indices=None, secondary_music_specifier=None, secondary_voice_name=None, ): import consort HashCachingObject.__init__(self) prototype = consort.MusicSpecifierSequence if discard_inner_offsets is not None: discard_inner_offsets = bool(discard_inner_offsets) self._discard_inner_offsets = discard_inner_offsets if not isinstance(primary_music_specifier, prototype): primary_music_specifier = consort.MusicSpecifierSequence( music_specifiers=primary_music_specifier, ) self._primary_music_specifier = primary_music_specifier if primary_voice_name is not None: primary_voice_name = str(primary_voice_name) self._primary_voice_name = primary_voice_name if rotation_indices is not None: if not isinstance(rotation_indices, collections.Sequence): rotation_indices = int(rotation_indices) rotation_indices = (rotation_indices,) rotation_indices = tuple(rotation_indices) self._rotation_indices = rotation_indices if not isinstance(secondary_music_specifier, prototype): secondary_music_specifier = consort.MusicSpecifierSequence( music_specifiers=secondary_music_specifier, ) self._secondary_music_specifier = secondary_music_specifier if secondary_voice_name is not None: secondary_voice_name = str(secondary_voice_name) self._secondary_voice_name = secondary_voice_name