Example #1
0
    def modify(self, context: Context):
        if self.upper != None or self.lower != None:
            context.voice = context.voice.clone(time_signature=(self.upper,
                                                                self.lower))
        elif self.upper != None:
            context.voice = context.voice.clone(
                time_signature=(self.upper, context.time_signature[1]))
        elif self.lower != None:
            context.voice = context.voice.clone(
                time_signature=(context.time_signature[0], self.lower))

        yield ContextChangeEvent(context.cursor, "timeSignature",
                                 context.voice.time_signature, context.voice,
                                 0)
    def modify(self, context: Context):
        context.voice = context.voice.clone(
            instrument=Instrument.from_program(self.instrument))

        yield ContextChangeEvent(context.cursor, "instrument",
                                 context.voice.instrument.program,
                                 context.voice, 0)
Example #3
0
def function_setvoice(context: Context, voice: Voice):
    context.voice = voice
Example #4
0
    def modify ( self, context : Context ):
        context.voice = context.voice.clone( tempo = self.tempo )

        yield ContextChangeEvent( context.cursor, "tempo", context.voice.tempo, context.voice, 0 )
Example #5
0
    def modify(self, context: Context):
        context.voice = context.voice.clone(value=self.length)

        yield ContextChangeEvent(context.cursor, "length", context.voice.value,
                                 context.voice, 0)
Example #6
0
    def modify(self, context: Context):
        context.voice = context.voice.clone(octave=self.octave)

        yield ContextChangeEvent(context.cursor, "octave",
                                 context.voice.octave, context.voice, 0)
    def modify ( self, context : Context ):
        context.voice = context.voice.clone( velocity = self.velocity )

        yield ContextChangeEvent( context.cursor, "velocity", context.voice.velocity, context.voice, 0 )