[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Strange output for Glissando.to-barline
From: |
David Kastrup |
Subject: |
Re: Strange output for Glissando.to-barline |
Date: |
Thu, 31 May 2018 14:09:29 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
Thomas Morley <address@hidden> writes:
> Hi,
>
> 'to-barline does not work as expected for Glissandi.
>
> \version "2.19.81"
>
> {
> \once \override Glissando.to-barline = ##t
> f'1\glissando
> c'1
> }
>
> Same problem for all tested versions, i.e. 2.12.3 up to 2.21.0
>
> I have only a vague guess how 'to-barline is done in the relevant
> .cc-files, though I've got the impression there is some work done to
> care about spanner-extent in x-axis direction, but I couldn't identify
> anything about y-axis wrt 'to-barline in staff-symbol.cc and
> note-spacing.cc.
>
> Also, we have no regtest for Glissando.to-barline, it's mostly about
> Hairpins. One with TrillSpanner and another for the SchemeTextSpanner.
I see the following:
address@hidden:/usr/local/tmp/lilypond$ git grep "to-barline" lily scm
lily/bar-engraver.cc: if (to_boolean (g->get_property ("to-barline")))
lily/line-spanner.cc: "to-barline "
lily/note-spacing.cc: && to_boolean (me->get_property
("space-to-barline")))
lily/note-spacing.cc: "space-to-barline "
lily/spanner.cc: "to-barline "
lily/staff-symbol.cc: // What the default implementation of to-barline
does for
scm/define-grob-properties.scm: (space-to-barline ,boolean? "If set, the
distance between a note
scm/define-grob-properties.scm: (to-barline ,boolean? "If true, the spanner
will stop at the bar
scm/define-grobs.scm: (to-barline . #t)
scm/define-grobs.scm: (space-to-barline . #t)
That is surprisingly little code actually looking at this property. The
main impetus will be in bar-engraver.cc where we have
void
Bar_engraver::acknowledge_end_spanner (Grob_info gi)
{
Grob *g = gi.grob ();
if (to_boolean (g->get_property ("to-barline")))
spanners_.push_back (dynamic_cast<Spanner *> (g));
}
and
void
Bar_engraver::process_acknowledged ()
{
if (!bar_ && scm_is_string (get_property ("whichBar")))
create_bar ();
if (bar_)
for (vsize i = 0; i < spanners_.size (); i++)
spanners_[i]->set_bound (RIGHT, bar_);
}
Basically, when spanners have their end acknowledged, they are marked so
that process_acknowledged will set their right bounds to the bar that
has been created. That's all. And looking at
lily/glissando-engraver.cc it certainly looks like setting the right
bound happens before announcing the spanner end.
So I am somewhat at a loss why this should not work for glissandi.
--
David Kastrup