[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: barNumberCheck with repeats
From: |
Robert Schmaus |
Subject: |
Re: barNumberCheck with repeats |
Date: |
Wed, 9 Nov 2016 10:49:16 +0100 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
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