[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: grob::rhythmic-location and \set Score.currentBarNumber
From: |
David Kastrup |
Subject: |
Re: grob::rhythmic-location and \set Score.currentBarNumber |
Date: |
Mon, 30 Sep 2019 13:09:49 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Urs Liska <address@hidden> writes:
> Am 30. September 2019 12:43:46 MESZ schrieb David Kastrup <address@hidden>:
>>"Urs Liska" <address@hidden> writes:
>>
>>> Hi all,
>>>
>>> I use the grob::rhythmic-location function to determine the measure
>>position of a given grob in a score (in the scholarLY annotation
>>engraver). However, if the measure counter is modified using \set
>>Score.currentBarNumber this change is not reflected in the result of
>>grob::rhythmic-location.
>>>
>>> \version "2.19.82"
>>>
>>> {
>>> \override Score.BarNumber.break-visibility = ##(#t #t #t)
>>> \override NoteHead.after-line-breaking =
>>> #(lambda (grob)
>>> (ly:message "Location: ~a" (grob::rhythmic-location grob)))
>>> c'1
>>> \set Score.currentBarNumber = 12
>>> c'1
>>> }
>>>
>>> This prints
>>>
>>> Location: (1 . #<Mom 0>)
>>> Location: (2 . #<Mom 0>)
>>>
>>> instead of
>>>
>>> Location: (1 . #<Mom 0>)
>>> Location: (12 . #<Mom 0>)
>>>
>>> Is this a bug with grob::rhythmic-location?
>>
>>No. rhythmic-location uses internalBarNumber in order to get unique
>>and
>>sortable results.
>
>
> Ok, I see.
>
> How do I get the "current" bar number then, the one printed as barnumber?
It's not recorded in general grobs. If you say you need in in
scholarLy, it sounds like a bar number subject to repetition and gaps is
not particularly useful for identification purposes anyway.
--
David Kastrup