Beispiel #1
0
 def _handle_rhythm_voice(self, rhythm_voice, current_stage):
     if (self._height_envelopes is None
             or self._height_envelopes[current_stage] is None):
         return
     # previous_string_index = None
     for tie, offset_start, offset_end, i, count in \
             Handler._iterate_logical_ties(rhythm_voice):
         # hide leaves if necessary
         if not self._show_rhythmic_notation:
             for leaf in tie:
                 Handler._hide_leaf(leaf)
    def _handle_rhythm_voice(self, rhythm_voice, current_stage):
        if (self._height_envelopes is None or
            self._height_envelopes[current_stage] is None) and \
                (self._height_envelope_patterns is None or
                 self._height_envelope_patterns[current_stage] is None):
            return

        previous_string_index = None
        for tie, offset_start, offset_end, i, count in \
                self._iterate_logical_ties(rhythm_voice):
            # hide leaves if necessary
            if not self._show_rhythmic_notation:
                for leaf in tie:
                    Handler._hide_leaf(leaf)

            if tie.is_pitched:
                tremolo = Handler._cycle_next(
                    self._tremolo_patterns,
                    current_stage
                )

                string_index = Handler._cycle_next(
                    self._string_index_patterns,
                    current_stage
                )

                direction = Handler._cycle_next(
                    self._direction_patterns,
                    current_stage
                )

                if string_index != previous_string_index:
                    BowingHandler._attach_string_index(string_index, tie)

                if direction:
                    BowingHandler._attach_direction(direction, tie)

                if tremolo:
                    Handler._add_stem_tremolo(tie)

                previous_string_index = string_index
            else:
                previous_string_index = None
    def _handle_rhythm_voice(self, rhythm_voice, current_stage):
        if (self._height_envelopes is None or
            self._height_envelopes[current_stage] is None) and \
                (self._height_envelope_patterns is None or
                 self._height_envelope_patterns[current_stage] is None):
            return

        previous_string_index = None
        for tie, offset_start, offset_end, i, count in \
                self._iterate_logical_ties(rhythm_voice):
            # hide leaves if necessary
            if not self._show_rhythmic_notation:
                for leaf in tie:
                    Handler._hide_leaf(leaf)

            if tie.is_pitched:
                tremolo = Handler._cycle_next(self._tremolo_patterns,
                                              current_stage)

                string_index = Handler._cycle_next(self._string_index_patterns,
                                                   current_stage)

                direction = Handler._cycle_next(self._direction_patterns,
                                                current_stage)

                if string_index != previous_string_index:
                    BowingHandler._attach_string_index(string_index, tie)

                if direction:
                    BowingHandler._attach_direction(direction, tie)

                if tremolo:
                    Handler._add_stem_tremolo(tie)

                previous_string_index = string_index
            else:
                previous_string_index = None