On 2020-03-08 3:18 am, Pablo Cordal wrote:
Thank you very much Aaron, but I get and error, I attach print, could it be
because I have an older version?

Yes, I tend to assume folks are on the latest build, which is obviously not always correct.

Try:

%%%%
\version "2.18.2"

forceBar = #(define-music-function
  (parser location bar) (string?)
  (define (advanceToNextMeasure context)
    (let ((timing (ly:context-find context 'Timing))
          (score (ly:context-find context 'Score)))
      (ly:context-set-property! timing 'measurePosition
        (ly:make-moment 0))
      (ly:context-set-property! score 'currentBarNumber
        (1+ (ly:context-property score 'currentBarNumber)))))
  #{ \applyContext #advanceToNextMeasure \bar #bar #})

{
  \override Score.BarNumber.break-visibility = #all-visible

  \repeat unfold 5 b'4 \forceBar "|."
  \repeat unfold 7 b'4 \forceBar "|."
  \repeat unfold 3 b'4 \forceBar "|."
  \repeat unfold 6 b'4 \forceBar "|."
}
%%%%

The main changes:

- 2.18.2 requires that the parser and location arguments are explicitly defined. - 2.18.2 does not support bare durations, so I just used \repeat unfold instead.


-- Aaron Hill

Reply via email to