def _get_lilypond_format_bundle(self, component=None): bundle = LilyPondFormatBundle() format_slot = bundle.get(self.format_slot) if self.tweaks: tweaks = self.tweaks._list_format_contributions( directed=self.directed ) format_slot.commands.extend(tweaks) pieces = self._get_format_pieces() format_slot.commands.extend(pieces) return bundle
def _get_lilypond_format_bundle(self, component=None): bundle = LilyPondFormatBundle() if not self.hide: markup = self._get_markup() markup = new(markup, direction=enums.Up) markup_format_pieces = markup._get_format_pieces() bundle.after.markup.extend(markup_format_pieces) return bundle
def _get_lilypond_format_bundle(self, component=None): bundle = LilyPondFormatBundle() if self.tweaks: tweaks = self.tweaks._list_format_contributions() bundle.after.spanner_starts.extend(tweaks) string = self._add_direction("[") bundle.after.spanner_starts.append(string) return bundle
def _get_lilypond_format_bundle(self, component=None): bundle = LilyPondFormatBundle() string = self.command if self.leak: string = f"<> {string}" bundle.after.leaks.append(string) else: bundle.after.spanner_stops.append(string) return bundle
def _get_lilypond_format_bundle(self, component=None): bundle = LilyPondFormatBundle() if self.hide: return bundle #staff = abjad.inspect(component).parentage().get_first(abjad.Staff) #strings = self._get_lilypond_format(context=staff) strings = self._get_lilypond_format() bundle.before.commands.extend(strings) return bundle
def _get_lilypond_format_bundle(self, component=None): bundle = LilyPondFormatBundle() if not self.once: revert_format = '\n'.join(self.revert_format_pieces) bundle.grob_reverts.append(revert_format) if not self.is_revert: override_format = '\n'.join(self.override_format_pieces) bundle.grob_overrides.append(override_format) return bundle
def _get_lilypond_format_bundle(self, component=None): bundle = LilyPondFormatBundle() string = r'\stopGroup' if self.leak: string = f'<> {string}' bundle.after.leaks.append(string) else: bundle.after.spanner_stops.append(string) return bundle
def _get_lilypond_format_bundle(self, component=None): bundle = LilyPondFormatBundle() n = self.n or 0 string = rf'\ottava {n}' if self.format_slot in ('before', None): bundle.before.commands.append(string) else: assert self.format_slot == 'after' bundle.after.commands.append(string) return bundle
def _get_lilypond_format_bundle(self, component=None): bundle = LilyPondFormatBundle() string = r"\!" if self.leak: string = f"<> {string}" bundle.after.leaks.append(string) else: # bundle.after.spanner_stops.append(string) bundle.after.articulations.append(string) return bundle
def _get_lilypond_format_bundle(self, component=None): bundle = LilyPondFormatBundle() if self.tweaks: tweaks = self.tweaks._list_format_contributions() bundle.after.markup.extend(tweaks) markup = self.markup markup = new(markup, direction=enums.Up) markup_format_pieces = markup._get_format_pieces() bundle.after.markup.extend(markup_format_pieces) return bundle
def _get_lilypond_format_bundle(self, component=None): bundle = LilyPondFormatBundle() if self.hide: return bundle strings = self._get_lilypond_format() if self.after: bundle.after.commands.extend(strings) else: bundle.before.commands.extend(strings) return bundle
def _get_lilypond_format_bundle(self, component=None): bundle = LilyPondFormatBundle() strings = [] if self.zero_padding: strings.append(r'- \abjad-zero-padding-glissando') if self.tweaks: tweaks = self.tweaks._list_format_contributions() strings.extend(tweaks) strings.append(r'\glissando') bundle.after.spanner_starts.extend(strings) return bundle
def _get_lilypond_format_bundle(self, component=None): bundle = LilyPondFormatBundle() string = ']' if self.leak: string = f'<> {string}' bundle.after.leaks.append(string) else: #bundle.after.spanner_stops.append(string) # starts (instead of stops) so [ ] is possible on single leaf: bundle.after.spanner_starts.append(string) return bundle
def _get_lilypond_format_bundle(self, component=None): bundle = LilyPondFormatBundle() string = r"\stopTrillSpan" if self.right_broken: string = self._tag_hide([string])[0] if self.leak: string = f"<> {string}" bundle.after.leaks.append(string) else: bundle.after.spanner_stops.append(string) return bundle
def _get_lilypond_format_bundle(self, component=None): bundle = LilyPondFormatBundle() if self.tweaks: tweaks = self.tweaks._list_format_contributions() bundle.after.articulations.extend(tweaks) bundle.after.articulations.append(r"\arpeggio") if self.direction in (enums.Up, enums.Down): if self.direction is enums.Up: command = r"\arpeggioArrowUp" else: command = r"\arpeggioArrowDown" bundle.before.commands.append(command) return bundle
def _get_lilypond_format_bundle(self, component=None): bundle = LilyPondFormatBundle() n = self.n or 0 string = rf"\ottava {n}" if self.right_broken: string = self._tag_hide([string])[0] if self.format_slot in ("before", None): bundle.before.commands.append(string) else: assert self.format_slot == "after" bundle.after.commands.append(string) return bundle
def _get_lilypond_format_bundle(self, component=None): bundle = LilyPondFormatBundle() if self.tweaks: strings = self.tweaks._list_format_contributions() if self.right_broken: strings = self._tag_show(strings) bundle.after.spanner_starts.extend(strings) string = self._add_direction('~') strings = [string] if self.right_broken: strings = self._tag_show(strings) bundle.after.spanner_starts.extend(strings) return bundle
def _get_lilypond_format_bundle(self, component=None): bundle = LilyPondFormatBundle() if self.tweaks: tweaks = self.tweaks._list_format_contributions() bundle.after.spanner_starts.extend(tweaks) if self.kind == "corda": string = r"\unaCorda" elif self.kind == "sostenuto": string = r"\sostenutoOn" else: assert self.kind in ("sustain", None) string = r"\sustainOn" bundle.after.spanner_starts.append(string) return bundle
def _get_lilypond_format_bundle(self, component=None): """ hairpin contributes formatting to the 'spanners' slot (rather than the 'commands' slot). The reason for this is that the LilyPond \startTrillSpan [pitch] command must appear after \< and \> but before \set and other commmands. """ bundle = LilyPondFormatBundle() if self.tweaks: tweaks = self.tweaks._list_format_contributions() bundle.after.spanners.extend(tweaks) strings = self._get_lilypond_format() bundle.after.spanners.extend(strings) return bundle
def _get_lilypond_format_bundle(self, component=None): bundle = LilyPondFormatBundle() if self.tweaks: strings = self.tweaks._list_format_contributions() bundle.after.spanners.extend(strings) strings = [] if self.direction is not None: assert isinstance(self.direction, str) strings.append(self.direction) elif self._should_force_repeat_tie_up(component): string = r"- \tweak direction #up" strings.append(string) strings.append(r"\repeatTie") bundle.after.spanners.extend(strings) return bundle
def _get_lilypond_format_bundle(self, component=None): bundle = LilyPondFormatBundle() if self.tweaks: tweaks = self.tweaks._list_format_contributions() if self.leak: bundle.after.leaks.extend(tweaks) else: bundle.after.articulations.extend(tweaks) if not self.hide: string = self._get_lilypond_format() if self.leak: bundle.after.leaks.append(string) else: bundle.after.articulations.append(string) return bundle
def _get_lilypond_format_bundle(self, component=None): bundle = LilyPondFormatBundle() if self.tweaks: tweaks = self.tweaks._list_format_contributions() bundle.after.spanner_starts.extend(tweaks) string = r"\startTrillSpan" if self.interval or self.pitch: bundle.opening.spanners.append(r"\pitchedTrill") if self.pitch: pitch = self.pitch else: pitch = component.written_pitch + self.interval string = string + f" {pitch!s}" bundle.after.spanner_starts.append(string) return bundle
def _get_lilypond_format_bundle(self, component=None): bundle = LilyPondFormatBundle() if self.tweaks: strings = self.tweaks._list_format_contributions() if self.left_broken: strings = self._tag_show(strings) bundle.after.spanners.extend(strings) strings = [] if self._should_force_repeat_tie_up(component): string = r"- \tweak direction #up" strings.append(string) strings.append(r"\repeatTie") if self.left_broken: strings = self._tag_show(strings) bundle.after.spanners.extend(strings) return bundle
def _get_lilypond_format_bundle(self, leaf): bundle = LilyPondFormatBundle() if len(self) == 1 and self._left_broken: strings = [self._stop_command_string()] strings = self._tag_show(strings) bundle.after.spanner_stops.extend(strings) return bundle # important: pitch trill must start AFTER markup if leaf is self[0]: if self.pitch is not None or self.interval is not None: if self.is_harmonic: string = '(lambda (grob) (grob-interpret-markup grob' string += r' #{ \markup \musicglyph #"noteheads.s0harmonic" #}))' scheme = Scheme(string, verbatim=True) override = LilyPondGrobOverride( grob_name='TrillPitchHead', property_path=('stencil', ), value=scheme, ) string = override.tweak_string(grob=True) bundle.after.trill_spanner_starts.append(string) strings = [r'\pitchedTrill'] if self._left_broken: strings = self._tag_hide(strings) bundle.opening.spanners.extend(strings) if self.pitch is not None: pitch_string = str(self.pitch) elif self.interval is not None: pitch = leaf.written_pitch + self.interval pitch_string = str(pitch) else: pitch_string = None strings = self._tweaked_start_command_strings() if pitch_string: strings[-1] += ' ' + pitch_string if self._left_broken: strings = self._tag_hide(strings) bundle.after.trill_spanner_starts.extend(strings) if leaf is self[-1]: if 1 < len(self): strings = [self._stop_command_string()] if self._right_broken: strings = self._tag_hide(strings) bundle.after.spanner_stops.extend(strings) return bundle
def _get_lilypond_format_bundle(self, component=None): bundle = LilyPondFormatBundle() bundle.grob_overrides.append( "\\once \\override Accidental.stencil = ##f\n" "\\once \\override AccidentalCautionary.stencil = ##f\n" "\\once \\override Arpeggio.X-offset = #-2\n" "\\once \\override NoteHead.stencil = #ly:text-interface::print\n" r"\once \override NoteHead.text = \markup {" + "\n" "\t\\filled-box #'(-0.6 . 0.6) #'(-0.7 . 0.7) #0.25\n" "}") if not self.hide: if self.include_black_keys and self.include_white_keys: string = r"\center-align \concat { \natural \flat }" elif self.include_black_keys: string = r"\center-align \flat" else: string = r"\center-align \natural" markup = Markup(string, direction=self.markup_direction) markup_format_pieces = markup._get_format_pieces() bundle.after.markup.extend(markup_format_pieces) return bundle
def _get_lilypond_format_bundle(self, component=None): bundle = LilyPondFormatBundle() strings = [] if self.tweaks: tweaks = self.tweaks._list_format_contributions() strings.extend(tweaks) #bundle.after.spanner_stops.extend(tweaks) if self.kind == 'corda': string = r'\treCorde' elif self.kind == 'sostenuto': string = r'\sostenutoOff' else: assert self.kind in ('sustain', None) string = r'\sustainOff' strings.append(string) if self.leak: strings.insert(0, '<>') bundle.after.leaks.extend(strings) else: bundle.after.spanner_stops.extend(strings) return bundle
def _get_lilypond_format_bundle(self, component=None): bundle = LilyPondFormatBundle() strings = [] if self.tweaks: tweaks = self.tweaks._list_format_contributions() strings.extend(tweaks) # bundle.after.spanner_stops.extend(tweaks) if self.kind == "corda": string = r"\treCorde" elif self.kind == "sostenuto": string = r"\sostenutoOff" else: assert self.kind in ("sustain", None) string = r"\sustainOff" strings.append(string) if self.leak: strings.insert(0, "<>") bundle.after.leaks.extend(strings) else: bundle.after.spanner_stops.extend(strings) return bundle
def _get_lilypond_format_bundle(self, component=None): bundle = LilyPondFormatBundle() if self.style is not None: string = rf"- \abjad-{self.style}" bundle.after.spanner_starts.append(string) if self.left_text: string = self._get_left_text_directive() bundle.after.spanner_starts.append(string) if self.left_broken_text is not None: string = self._get_left_broken_text_tweak() bundle.after.spanner_starts.append(string) if self.right_text: string = self._get_right_text_tweak() bundle.after.spanner_starts.append(string) if self.right_padding: string = self._get_right_padding_tweak() bundle.after.spanner_starts.append(string) if self.tweaks: tweaks = self.tweaks._list_format_contributions() bundle.after.spanner_starts.extend(tweaks) string = self._add_direction(self.command) bundle.after.spanner_starts.append(string) return bundle
def _get_lilypond_format_bundle(self, component=None): bundle = LilyPondFormatBundle() bundle.opening.commands.append(self._get_lilypond_format()) return bundle
def _get_lilypond_format_bundle(self, component=None): bundle = LilyPondFormatBundle() slot = bundle.get(self.format_slot) slot.commands.extend(self._get_lilypond_format()) return bundle
def _get_lilypond_format_bundle(self, component=None): bundle = LilyPondFormatBundle() string = "\n".join(self.format_pieces) bundle.context_settings.append(string) return bundle
def _get_lilypond_format_bundle(self, component=None): bundle = LilyPondFormatBundle() format_slot = bundle.get(self.format_slot) format_slot.comments.append(self._get_lilypond_format()) return bundle