lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: restating clef and StaffGroup brace after \startStaff


From: Jean Abou Samra
Subject: Re: restating clef and StaffGroup brace after \startStaff
Date: Wed, 21 Oct 2020 18:47:37 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0


Le 21/10/2020 à 18:21, Gilberto Agostinho a écrit :
Hello,

Does anyone know if it would be possible to restate a staff's clef and a StaffGroup's brace after the \startStaff command? I am again trying to create a diagram showing non-consecutive measures side by side. I am able to set the bar numbers of these measures to arbitrary values as I wish, but I think the second measure would look better with clefs and braces similarly to the first. Does anyone have any ideas how to tackle this?

\version "2.19.82"
A = {
    \once \override Score.BarNumber.break-visibility = #end-of-line-invisible
    \set Score.currentBarNumber = #2
    \bar ""
    c'2 d'2

    \stopStaff
    s1
    \startStaff

    \once \override Score.BarNumber.break-visibility = #end-of-line-invisible
    \set Score.currentBarNumber = #13
    e'2 f'2
}
B = {
    c'1
    \stopStaff
    s1
    \startStaff
    c'1
}

\score{
    \new StaffGroup <<
        \new Staff \A
        \new Staff \B
    >>
    \layout{}
}

Producing: https://i.postimg.cc/ydXVn8HM/Screenshot-from-2020-10-21-17-19-13.png

Many thanks!
Gilberto

Hello,

Maybe there are hacks. However, for achieving this kind of tasks,
I would rather create separate systems and stack them in markups.
For instance (adapt the code to your convenience):

\version "2.23.0"

\layout {
  \context {
    \Score
    \override Score.BarNumber.break-visibility = #end-of-line-invisible
  }
}

#(define-markup-command (make-snippet layout props bar-number upper lower)
                             (integer? ly:music? ly:music?)
   (interpret-markup layout props
   #{
     \markup
       \score {
         \new StaffGroup <<
           \new Staff {
             \set Score.currentBarNumber = #bar-number
             \bar ""
             #upper
           }
           \new Staff { #lower }
         >>
         \layout { }
       }
   #}))

\markup {
  \make-snippet #2
    {
      c'2 d'2
    }
    {
      c'1
    }
  \hspace #5
  \make-snippet #13
    {
        e'2 f'2
    }
    {
      c'1
    }
}

Best regards,
Jean

PS: Note that LilyPond 2.20 is available (http://lilypond.org/download.html).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]