Beispiel #1
0
    def set_markup(self, source_expression):
        r'''Set markup to `source_expression`.

        Returns markup set expression.
        '''
        from experimental.tools import musicexpressiontools
        source_expression = \
            musicexpressiontools.PayloadExpression(payload=source_expression)
        attribute = 'markup'
        return self._store_leaf_set_expression(attribute, source_expression)
Beispiel #2
0
    def set_register(self, source_expression):
        r'''Set register to `source_expression`.

        Returns register set expression.
        '''
        from experimental.tools import musicexpressiontools
        assert isinstance(source_expression, pitchtools.Registration)
        source_expression = \
            musicexpressiontools.PayloadExpression(payload=source_expression)
        attribute = 'reigster'
        return self._store_leaf_set_expression(attribute, source_expression)
Beispiel #3
0
    def set_leaf_color(self, source_expression):
        r'''Set leaf color to `source_expression`.

        Returns leaf color set expression.
        '''
        from experimental.tools import musicexpressiontools
        assert isinstance(source_expression, str), repr(source_expression)
        source_expression = \
            musicexpressiontools.PayloadExpression(payload=source_expression)
        attribute = 'leaf_color'
        return self._store_leaf_set_expression(attribute, source_expression)
Beispiel #4
0
    def set_mark(self, source_expression):
        r'''Set mark to `source_expression`.

        Returns mark set expression.
        '''
        from experimental.tools import musicexpressiontools
        #assert isinstance(source_expression, indicatortools.Mark)
        source_expression = \
            musicexpressiontools.PayloadExpression(payload=source_expression)
        attribute = 'mark'
        return self._store_leaf_set_expression(attribute, source_expression)
Beispiel #5
0
    def set_dynamic(self, source_expression):
        r'''Set dynamic to `source_expression`.

        Returns dynamic set expression.
        '''
        from experimental.tools import musicexpressiontools
        dynamic = indicatortools.Dynamic(source_expression)
        source_expression = \
            musicexpressiontools.PayloadExpression(payload=dynamic)
        attribute = 'dynamic'
        return self._store_leaf_set_expression(attribute, source_expression)
Beispiel #6
0
    def set_aggregate(self, source_expression):
        r'''Set aggregate to `source_expression`.

        Returns aggregate set expression.
        '''
        from experimental.tools import musicexpressiontools
        assert isinstance(source_expression, list), repr(source_expression)
        source_expression = \
            musicexpressiontools.PayloadExpression(payload=source_expression)
        attribute = 'aggregate'
        return self._store_leaf_set_expression(attribute, source_expression)
Beispiel #7
0
    def set_spanner(self, source_expression):
        r'''Set spanner to `source_expression`.

        Returns spanner set expression.
        '''
        from experimental.tools import musicexpressiontools
        assert isinstance(source_expression, spannertools.Spanner)
        assert not len(source_expression)
        source_expression = \
            musicexpressiontools.PayloadExpression(payload=source_expression)
        return self._store_counttime_component_select_expression_set_expression(
            'spanner', source_expression)
Beispiel #8
0
    def set_dynamic_handler(self, source_expression):
        r'''Set dynamic handler to `source_expression`.

        Returns dynamic set expression.
        '''
        from abjad.tools import handlertools
        from experimental.tools import musicexpressiontools
        assert isinstance(source_expression, handlertools.DynamicHandler)
        source_expression = \
            musicexpressiontools.PayloadExpression(payload=source_expression)
        attribute = 'dynamic_handler'
        return self._store_counttime_component_select_expression_set_expression(
            'dynamic_handler', source_expression)
Beispiel #9
0
    def set_pitch_class_transform(self, source_expression):
        r'''Set pitch class transform to `source_expression`.

        Returns pitch-class transform set expression.
        '''
        from experimental.tools import musicexpressiontools
        pitch_class_transform_expression = \
            musicexpressiontools.PitchClassTransformExpression(
                source_expression)
        source_expression = \
            musicexpressiontools.PayloadExpression(
                payload=pitch_class_transform_expression)
        attribute = 'pitch_class_transform'
        return self._store_leaf_set_expression(attribute, source_expression)
Beispiel #10
0
    def set_tempo(self, source_expression):
        r'''Set tempo to `source_expresion`.

        Returns tempo set expression.
        '''
        from experimental.tools import musicexpressiontools
        if isinstance(source_expression, indicatortools.Tempo):
            source_expression = copy.copy(source_expression)
        elif isinstance(source_expression, tuple):
            source_expression = indicatortools.Tempo(*source_expression)
        else:
            raise TypeError(source_expression)
        source_expression = \
            musicexpressiontools.PayloadExpression(payload=source_expression)
        attribute = 'tempo'
        return self._store_leaf_set_expression(attribute, source_expression)
Beispiel #11
0
    def set_articulation(self, source_expression):
        r'''Set articulation to `source_expression`.

        Returns articulation set expression.
        '''
        from experimental.tools import musicexpressiontools
        if isinstance(source_expression, indicatortools.Articulation):
            articulation_list = [source_expression]
        elif isinstance(source_expression, str):
            articulation = indicatortools.Articulation(source_expression)
            articulation_list = [articulation]
        elif isinstance(source_expression, list):
            articulation_list = [
                indicatortools.Articulation(x) for x in source_expression
            ]
        source_expression = \
            musicexpressiontools.PayloadExpression(payload=articulation_list)
        attribute = 'articulation'
        return self._store_leaf_set_expression(attribute, source_expression)