if r"\stemless" in lilypond_code:Ībjad_lilypond_(- 1, ScoreComponent._outer_stemless_def)Ībjad_lilypond_file.header_block.title = abjad().Markup(title)Ībjad_lilypond_file.header_poser = abjad().Markup(composer)Ībjad_lilypond_file.header_poser = abjad(). # if we're actually producing the lilypond file itself, then we put the simpler # definition of stemless outside of the main score object. Title = self.title if hasattr(self, "title") else NoneĬomposer = poser if hasattr(self, "composer") else Noneįor gliss_override in ScoreComponent._gliss_overrides:Ībjad().attach(abjad().LilyPondLiteral(gliss_override), abjad_object, "opening")Ībjad_lilypond_file = abjad().LilyPondFile.new( """ assert abjad() is not None, "Abjad is required for this operation." Grace_container = None # this is where we populate the source_id_dict passed down to us from the top level "to_abjad()" call if source_id_dict is not None:ĭef to_abjad_lilypond_file( self) -> 'abjad().LilyPondFile': """Ĭonvert and wrap as a abjad.LilyPondFile object Grace_container = abjad().AfterGraceContainer(grace_notes)Ībjad().attach(grace_container, abjad_object) # this signifier, \stemless, is not standard lilypond, and is defined with # an override at the start of the scoreĪbjad().attach(abjad().LilyPondLiteral( r"\stemless"), note) # Now we make, fill, and attach the abjad AfterGraceContainer, if applicable if len(grace_notes) > 0: # This is a simple note abjad_object = abjad().Note(_policy.resolve_abjad_pitch(self.pitch), duration) # Set the notehead # but first check that we're not just repeating the last grace note pitch if last_pitch != grace.written_pitch: Grace = abjad().Note(_policy.resolve_abjad_pitch(_at(t)), 1 / 16) Self._set_abjad_note_head_styles(abjad_object) side of the dialog Ensure Other dropdown functions as per MS3. Raise ValueError( "Must be an abjad Note or Chord object")ĭef _set_abjad_note_head_styles( self, abjad_note_or_chord): if isinstance(abjad_note_or_chord, abjad().Note):Ībjad().tweak(abjad_note_or_chord.note_heads).style = lilypond_style.split( "|") if len(lilypond_style.split( "|")) > 1: From the 5 big ones (MuseScore, Dorico, Finale, Sibelius and LilyPond) Lilypond and. # the pipe separates out a bit of comment text, which is used when the # desired notehead can't be displayedĪbjad().tweak(abjad_note_or_chord.note_head).style = lilypond_style.split( "|")Ībjad().attach(abjad().LilyPondComment(lilypond_style.split( "|")), abjad_note_or_chord)Įlif isinstance(abjad_note_or_chord, abjad().Chord):įor chord_member, note_head_style in enumerate():Ībjad().tweak(abjad_note_or_chord.note_heads).style = lilypond_style.split( "|")Ībjad().attach(abjad().LilyPondComment(lilypond_style.split( "|")), abjad_note_or_chord) else: Lilypond_style = get_lilypond_notehead_name(note_head_style) I want to define a Lilypond function that will interpolate two notes. If isinstance(abjad_note_or_chord, abjad().Note):
0 Comments
Leave a Reply. |