예제 #1
0
    def weave(self, staff, index=0, **kwargs):

        drive_in_cell = ImaginaryCell(rhythm=(-0.5, ) + (
            0.5,
            0.5,
        ) * (self.drive_in_beats - 1) + (0.5, ))
        off_cell = ImaginaryCell(rhythm=(-0.5, ) + (1, ) *
                                 (self.off_count - 1) + (1.5, ))

        if self.drive_in_beats > 1:
            drive_in_cell.events[1].tag(self.initial_dynamic, "\\<")
            drive_in_cell.events[-1].tag(self.driving_dynamic, ">", ".")
        drive_in_cell.events[1:-1].tag("-")
        drive_in_cell.events[-1].tag(">", ".")

        off_cell.events[-1].tag(">")
        off_cell.note_events.tag("-")

        my_phrase = ImaginaryPhrase(drive_in_cell, off_cell)

        if self.end_downbeat == True:
            end_cell = ImaginaryCell(rhythm=(1, ))
            end_cell.events[0].tag(">", ".")
            my_phrase.append(end_cell)

        return my_phrase
예제 #2
0
 def weave(self, staff, index=0, **kwargs):
     my_phrase = ImaginaryPhrase(*[
         ImaginaryCell(rhythm=[self.osti_pulse_duration] *
                       self.osti_cell_length)
         for i in range(self.osti_cell_count)
     ])
     return my_phrase
예제 #3
0
    def weave(self, staff, index=0, **kwargs):
        my_phrase = ImaginaryPhrase(
            ImaginaryCell(rhythm=[
                self.pulse_duration
                for i in range(int(self.pulse_beats / self.pulse_duration))
            ]))

        return my_phrase
예제 #4
0
 def weave(self, staff, index=0, **kwargs):
     my_rhythm = [self.swell_duration, self.hit_duration]
     if self.hit_rest:
         my_rhythm.append(0-self.hit_rest)
     my_cell = ImaginaryPhrase(
         ImaginaryCell(rhythm=my_rhythm)
         )
     my_cell.events[0].tag(self.low_dynamic, "\\<")
     my_cell.events[1].tag(self.hit_dynamic, *self.hit_articulations)
     return my_cell
예제 #5
0
    def weave(self, staff, index=0, **kwargs):
        my_line = calliope.Line()

        for repeat in range(self.repeats):
            my_phrase = ImaginaryPhrase()

            for i, p in enumerate(self.pattern):
                my_accent = abjad.CyclicTuple(self.pattern_accent)[i]
                my_fill_in = abjad.CyclicTuple(self.pattern_fill_in)[i]
                my_pulse_type = abjad.CyclicTuple(self.pattern_pulse_type)[i]
                my_accent = abjad.CyclicTuple(self.pattern_accent)[i]

                if my_pulse_type == "all":
                    my_rhythm = (self.pulse_duration, ) * p

                elif my_pulse_type == "first":
                    if my_fill_in:
                        my_rhythm = (p * self.pulse_duration, )
                    else:
                        my_rhythm = (self.pulse_duration, self.pulse_duration -
                                     p * self.pulse_duration)

                else:  # other
                    if my_fill_in:
                        q, r = divmod(p, 2)
                        my_rhythm = [
                            self.pulse_duration * 2 for pq in range(q)
                        ]
                        if r:
                            my_rhythm.append(self.pulse_duration)
                    else:
                        my_rhythm = [[
                            self.pulse_duration, 0 - self.pulse_duration
                        ][pj % 2] for pj in range(p)]
                my_cell = ImaginaryCell(rhythm=my_rhythm)
                if my_accent:
                    my_cell.note_events[0].tag(">")
                my_phrase.append(my_cell)
            my_line.append(my_phrase)

        return my_line
예제 #6
0
    def weave(self, staff, index=0, **kwargs):
        my_line = ImaginaryLine()

        for pb in self.phrase_beats:
            if self.pulse_on_count > 0:
                cell_on = ImaginaryCell(rhythm=[
                    self.pulse_duration for i in range(self.pulse_on_count - 1)
                ] + [self.pulse_duration / 2])
            else:
                cell_on = ImaginaryCell(rhythm=(0 - self.pulse_duration / 2, ))

            beats_remaining = pb - cell_on.beats
            cell_off_rhythm = []

            while beats_remaining > 1.5 * self.pulse_duration:
                cell_off_rhythm.append(self.pulse_duration)
                beats_remaining -= self.pulse_duration

            cell_off_rhythm.append(1.5 * self.pulse_duration)
            cell_off = ImaginaryCell(rhythm=cell_off_rhythm)

            my_line.append(ImaginaryPhrase(cell_on, cell_off))

        return my_line
예제 #7
0
    def weave(self, staff, index=0, **kwargs):
        my_phrase = ImaginaryPhrase(ImaginaryCell(rhythm=self.pad_durations, ))

        return my_phrase