On Thu 25 Apr 2024 at 13:06:01 (-0700), Steve Carlock wrote: > Thanks. I agree that the barcheck warning message is cryptic. It appears > that this issue happens when the lyric is attached to notes that are tied > across a measure boundary. Unfortunately I can't change the third measure > - that motif from my simple example is used frequently in the pieces I am > working on at the moment. It's a catch-22. I start ignoring the barcheck > warnings because of the lyrics that cross measure boundaries and then miss > the legit warnings from where I've messed up the lyrics. The good news is > that even with the warnings, the output is exactly what I need it to be.
It's possible to set your extract, make all the checks, and get no warning messages, but it's tedious, and means using lyric durations. (check1.ly, attached.) Using addlyrics instead of lyric durations is a trade-off, and I assume the documenter had already made that choice when they wrote: "Note that bar check marks in lyrics are evaluated at the musical moment when the syllable following the check mark is processed. If the lyrics are associated with the notes of a voice which has a rest at the beginning of a bar, then no syllable can be located at the start of that bar and a warning will be issued if a bar check mark is placed in the lyrics at that position." One compromise you can make is to leave out any bar checks that occur within lyrics that happen to cross barlines. You can still add a barNumberCheck as long as you bear in mind that its number applies to the measure of the /next/ lyric. (check2.ly, attached.) Alternatively, you can leave the bar and bar number checks in place, as you suggest above, but use the tersely documented¹ expect-warning feature to silence just these warnings. (check3.ly, attached.) That will prevent their spam from obscuring other, significant warnings amd errors. Each expect-warning line at the top of the file (which is where they must all be placed) will silence one warning with the corresponding text. They must be placed in the corresponding order as well.² Run check3.ly with its expect-warning line commented out, and again with it duplicated: you will see how it works, and that extra expect-warning lines are treated as errors, not ignored. AIUI the expect-warning string has to match the warning message from the start of the text, but can be truncated, ie expect-warning "bar check failed" would still match the warning in check3.ly. ¹ Internals References §4 Scheme functions (alphabetical) page 872 in version 2.25.10 ² But particularly for bar checks, bear this in mind: "If successive bar checks are off by the same musical interval, only the first warning message is displayed. This allows the warning to focus on the source of the timing error." (Notation Reference.) Cheers, David.
\version "2.24.3" \language "english" << \new Staff { \new Voice = vvv { \relative c' { \override Score.BarNumber.break-visibility = #all-visible \set Score.barNumberVisibility = #(every-nth-bar-number-visible 1) f8 4 f8 f4 8 f8~ \barNumberCheck #2 | 4 r4 r2 \barNumberCheck #3 | r2 r8 f8 4 \barNumberCheck #4 | } } } \new Lyrics { \lyricmode { \set associatedVoice = vvv This8 Lit4 -- tle8 star4 -- O8 -- mine8 __ \barNumberCheck #2 | _4 \skip4 \skip2 \barNumberCheck #3 | \skip2 \skip8 I8 said4 \barNumberCheck #4 | } } >>
\version "2.24.3" \language "english" << \new Staff { \new Voice { \relative c' { \override Score.BarNumber.break-visibility = #all-visible \set Score.barNumberVisibility = #(every-nth-bar-number-visible 1) f8 4 f8 f4 8 f8~ \barNumberCheck #2 | 4 r4 r2 \barNumberCheck #3 | r2 r8 f8 4 \barNumberCheck #4 | } } } \addlyrics { \lyricmode { This Lit -- tle star -- O -- mine __ \barNumberCheck #3 I said \barNumberCheck #4 | } } >>
#(ly:expect-warning "bar check failed at: 5/8") \version "2.24.3" \language "english" << \new Staff { \new Voice { \relative c' { \override Score.BarNumber.break-visibility = #all-visible \set Score.barNumberVisibility = #(every-nth-bar-number-visible 1) f8 4 f8 f4 8 f8~ \barNumberCheck #2 | 4 r4 r2 \barNumberCheck #3 | r2 r8 f8 4 \barNumberCheck #4 | } } } \addlyrics { \lyricmode { This Lit -- tle star -- O -- mine __ \barNumberCheck #3 | I said \barNumberCheck #4 | } } >>