Not much of a trick.

\set Score.ignoreBarChecks = ##t

Ah, great - thanks David!



barNumberCheck =
#(define-music-function (n) (integer?)
   (_i "Print a warning if the current bar number is not @var{n}.")
   (make-music 'ApplyContext
               'procedure
               (lambda (c)
                 (let ((cbn (ly:context-property c 'currentBarNumber)))
                   (if (and  (number? cbn) (not (= cbn n)))
                       (ly:input-warning (*location*)
                                         "Barcheck failed got ~a expect ~a"
                                         cbn n))))))

I think it would be reasonable to let this thing also heed
ignoreBarChecks ?  That would mean something like

barNumberCheck =
#(define-music-function (n) (integer?)
   (_i "Print a warning if the current bar number is not @var{n}.")
   (make-music 'ApplyContext
               'procedure
               (lambda (c)
                 (if (not (ly:context-property c 'ignoreBarChecks #f))
                   (let ((cbn (ly:context-property c 'currentBarNumber)))
                     (if (and  (number? cbn) (not (= cbn n)))
                         (ly:input-warning (*location*)
                                           "Barcheck failed got ~a expect ~a"
                                           cbn n)))))))

This will certainly work for my (probably comparatively simple) scores - I'll use that.

But in general, shouldn't bar checks still be valid even if the bar number count isn't necessarily? Then again, maybe that's a rather academic problem - one would hardly code a score using bar (number) checks and then place "ignoreBarChecks" in *all* score blocks ... at least one of the \layout block will use the checks. So, for me, this would work - but others with bigger and more complicated scores might have a different opinion on this.

I guess, a mention of this in the sections "Repeats in MIDI" would be a good idea - I'd be happy to do that, if the Doc-people let me know, how I can do that.

Thanks again,
Best, Robert

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to