Dear LilyPond community,

I'm working on an web psalter https://www.zaltar.cz (in Czech language) with 
responsive music notation based on LilyPond. For example, take a look at 
https://www.zaltar.cz/OL1.html and try changing the width of the browser. The 
notation is pre-engraved at 9 different sizes and the correct size is 
automatically selected using CSS rules. The LilyPond code used to create the 
notation is linked at the bottom of each page.

In order to make the notation work at so many different sizes, I have used the 
excellent work of Thomas Morley 
(https://lists.gnu.org/archive/html/lilypond-user/2020-05/msg00002.html), Jean 
Abou Samra and Werner Lemberg 
(https://www.mail-archive.com/[email protected]/msg149350.html). Thank you 
very much! Their code handles automatic wrapping of long breves and snapping 
syllables so that they appear as one text on each breve.

However, I would like to take musical notation even further. Right now, there's 
a lot of extra space behind the breve because of those invisible notes that are 
evenly spaced.

My question is: Is it possible to reduce the spacing between those invisible 
breves? I tried using \override NoteHead.X-extent = #'(0 . 0). This almost does 
what I want. The notes can overlap and the spacing is dictated by the text 
only, which is great for my purpose. However, there is serious drawback to 
this. The ledger lines stop working. This is understandable, since they need 
the X-extent of note heads to calculate the length. So, please, is there any 
other way to a achieve similar spacing, but without interfering with the ledger 
lines?

Below is some kind of MWE. I would like to achieve the same spacing as in the 
MWE, but with working ledger lines:

\version "2.24.0"

\header {
  tagline = ""
}

\paper {
  indent = 0\cm
  top-margin = 0\cm
  right-margin = 0\cm
  bottom-margin = 0\cm
  left-margin = 0\cm
  paper-width = 15\cm
  page-breaking = #ly:one-page-breaking
}

hideNotes = {
  % logic for hiding notes based on Thomas Morley's work
  % https://lists.gnu.org/archive/html/lilypond-user/2020-05/msg00002.html
}
unHideNotes = {
  % logic for hiding notes based on Thomas Morley's work
  % https://lists.gnu.org/archive/html/lilypond-user/2020-05/msg00002.html
}

squashNotes = {
  \override NoteHead.X-extent = #'(0 . 0)
}
unSquashNotes = {
  \revert NoteHead.X-extent
}

\score {
  <<
    \new Voice = "melody" {
      \cadenzaOn \key c \major \relative {
        c'\breve*1/16 \squashNotes \hideNotes \breve*1/16 \bar "" \breve*1/16 \bar "" \breve*1/16 
\bar "" \breve*1/16 \bar ""
        \breve*1/16 \bar "" \breve*1/16 \bar "" \breve*1/16 \bar "" \breve*1/16 \bar "" 
\breve*1/16 \breve*1/16 \bar ""
        \unHideNotes \unSquashNotes \bar "" f8 e d d4 r \bar "|"
d\breve*1/16 \squashNotes \hideNotes \breve*1/16 \breve*1/16 \bar "" \unHideNotes \unSquashNotes \bar ""
        g8[( f)] e e2 \bar "||" \break
      }
    }
    \new Lyrics \lyricsto "melody" {
      \lyricmode {
        \set stanza = "3."
        Bu -- deš-li u -- cho -- vá -- vat "v pa" -- mě -- ti vi -- ny, Ho -- 
spo -- di -- ne,
        Pa -- ne, kdo ob -- sto -- jí?
      }
    }
  >>
}

Thank you very much for your time and effort,
Jiri Hon

Reply via email to