2

I'm trying to typeset this time signature from a hand-written manuscript:

target

A straight-up 7/8 time signature is easy

\time 7/8

easy78

The 2/4+3/8 is tougher but still not bad

\compoundMeter #'((2 4) (3 8))

enter image description here

A 7/8 signature in parentheses also seems reasonable:

\once \override Staff.TimeSignature.stencil = #(lambda (grob)
    (parenthesize-stencil (ly:time-signature::print grob) 0.1 0.4 0.4 0.1)
  )
\time 7/8

enter image description here

But when I apply that parentheses to the compound signature, things start to break-down (I get the 7/8 signature again)

\once \override Staff.TimeSignature.stencil = #(lambda (grob)
    (parenthesize-stencil (ly:time-signature::print grob) 0.1 0.4 0.4 0.1)
  )
\compoundMeter #'((2 4) (3 8))

enter image description here

2 Answers 2

3

The issue here is that ´compoundMeter` changes the time signature stencil to

#(lambda (grob)
  (grob-interpret-markup grob (make-compound-meter-markup args)))

You override this to use the original stencil. So you simply need to combine these:

hybridCompoundMeter =
#(define-music-function (args) (pair?)
   #{
     \compoundMeter #args
     \once \override Timing.TimeSignature.stencil =
     #(lambda (grob)
        (let ((stc1 (ly:time-signature::print grob))
              (stc2 (parenthesize-stencil
                     (grob-interpret-markup grob (make-compound-meter-markup args))
                     0.1 0.4 0.4 0.1)))
          (ly:stencil-combine-at-edge stc1 X RIGHT stc2 0.8)))
   #})

{
  \hybridCompoundMeter #'((2 4) (3 8))
  8 8 8 8 8 8 8
}

which then looks like this:

enter image description here

3
  • That is super useful info. How did you know that? Is this in an scm/ file thay you could grep, in the notation reference, or did you happen you know off the top of your head? Either way. I love it, but I'd like to know how to answer this myself in the future.
    – Stewart
    Aug 5, 2023 at 20:25
  • Oh, and I love how easily you've demonstrated how much better this solution is with the 4+3 groups of eighths
    – Stewart
    Aug 5, 2023 at 20:35
  • 1
    @Stewart The beat structure is in fact handled by the compoundMeter command. When I read your description I already suspected that compoundMeter changes the stencil callback, I then simply looked up the definition in ly/music-functions-init.ly. Generally you’ll find a lot in ly/ (for Lilypond code) and in scm/ (for schema code).
    – Lazy
    Aug 5, 2023 at 23:08
1

Here's a solution that just marks-up the whole thing:

\once \override Staff.TimeSignature.stencil = #ly:text-interface::print
\once \override Staff.TimeSignature.text =
  \markup {
    \override #'(baseline-skip . 0)
    \center-column \number { 7 8 }
    \raise #-1.25 { \fontsize #5 { "(" } }
    \override #'(baseline-skip . 0)
    \center-column \number { 2 4 }
    \raise #-1 { \fontsize #5 { "+" } }
    \override #'(baseline-skip . 0)
    \center-column \number { 3 8 }
    \raise #-1.25 { \fontsize #5 { ")" } }
  }
\time 7/8

enter image description here

Not sure if that's the best method, especially since the parentheses take up a lot of horizontal space (unlike the beautiful parentheses provided by parenthesize-stencil).

I can live with this, but I'm interested if there's a prettier solution out there (with the nicer parentheses)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.