Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rhythmic-location reports wrong measure with Score.currentBarNumber #45

Open
uliska opened this issue Sep 30, 2019 · 0 comments
Open

rhythmic-location reports wrong measure with Score.currentBarNumber #45

uliska opened this issue Sep 30, 2019 · 0 comments
Labels

Comments

@uliska
Copy link
Contributor

uliska commented Sep 30, 2019

This is the actual issue behind openlilylib/scholarly#67.

\version "2.19.82"

#(define (rhythmic-location grob)
   "Return the musical/rhythmical position of a given grob
    as a pair of a measure number and a moment in that measure.
    If the position can't be determined return an 'impossible'
    value in measure 0."
   (if (ly:grob? grob)
       (or (grob::rhythmic-location grob)
           (cons 0 (ly:make-moment 0/4)))
       (ly:error "Requested rhythmic-location of a grob, but ~a is not a grob," grob)))

{
  \override NoteHead.after-line-breaking = 
  #(lambda (grob)
     (ly:message "Location: ~a" (rhythmic-location grob)))
  c'1
  \set Score.currentBarNumber = 12
  c'1
}

prints

Location: (1 . #<Mom 0>)
Location: (2 . #<Mom 0>)

(instead of 1 and 12).

Obviously this is due to grob::rhythmic-location, and I'll ask on bug-lilypond whether that's a bug or wrong usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant