Hi Andrea,
There's a easy way to reach that (see attached file), but the result wil
depend upon the incipits length.
Cheers,
Pierre

2014-11-19 13:32 GMT+01:00 Jayaratna <jayara...@gmail.com>:

> Dear Lilypondians,
>
>
> I am trying to adapt this code by Pierre to my needs:
>
> http://lists.gnu.org/archive/html/lilypond-user/2012-05/msg00379.html
>
> So far I have made this:
>
> <http://lilypond.1069038.n5.nabble.com/file/n168820/doubleincipit.png>
>
> Three things I need to adjust:
>
> 1) the brace needs to be a bracket and to be properly repositioned;
> 2) the second 'incipit' is too large compared to the first (which is made
> by
> a markup code inside the instrument name), I can make the first look like
> the second but I need the second to look like the first instead;
> 3) the '8' under the octave treble clefs in the second half of the example
> are shifted (and this could be a small bug: if you hide the clefs the 8s
> remain).
>
> I am attacing my doubleincipit.ly
> doubleincipit.ly
> <http://lilypond.1069038.n5.nabble.com/file/n168820/doubleincipit.ly>
>
> Any help welcome,
> thank you,
> Andrea
>
>
>
> --
> View this message in context:
> http://lilypond.1069038.n5.nabble.com/Double-incipit-was-midline-system-bracket-tp168820.html
> Sent from the User mailing list archive at Nabble.com.
>
> _______________________________________________
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
\version "2.18.2"

#(set-global-staff-size 10)

incipit =
#(define-music-function (parser location incipit-music) (ly:music?)
  #{
    \once \override Staff.InstrumentName.self-alignment-X = #RIGHT
    \once \override Staff.InstrumentName.self-alignment-Y = ##f
    \once \override Staff.InstrumentName.padding = #0.3
    \once \override Staff.InstrumentName.stencil =
      #(lambda (grob)
         (let* ((instrument-name (ly:grob-property grob 'long-text)))
           (set! (ly:grob-property grob 'long-text)
           #{ 
             \markup
             \score {
               { 
                 \context MensuralStaff 
                 \with { instrumentName = #instrument-name } 
                 $incipit-music
               }
               \layout { 
                 $(ly:grob-layout grob)
                 line-width = \indent
                 indent =
                  % primitive-eval is probably easiest for
                  % escaping lexical closure and evaluating
                  % everything respective to (current-module).
                 #(primitive-eval
                   '(or (false-if-exception (- indent incipit-width))
                      (* 0.5 indent)))
                 ragged-right = ##f
                 ragged-last = ##f
                 system-count = #1 
               }
              }
           #})
          (system-start-text::print grob)))
        #})

global = {
  \set Score.skipBars = ##t
  \key c \major
  \override Staff.Clef.full-size-change = ##t
  \once \override Staff.TimeSignature.stencil = ##f
  \time 4/2
}

discantusNotes = 
  \relative c'  {
    \clef violin
    c'1 d \bar"||"
  }

altusNotes = 
  \relative c'  {
    \clef "G_8"
    f1 f \bar "||"
  }
  
tenorNotes = 
  \relative c' {
    \clef "G_8"
    a1 f \bar "||"
  }

bassusNotes = 
  \relative c {
    \clef bass
    f,1 bes \bar"||" 
  }

discantusIncipit = 
<<
  \new MensuralVoice = "discantusIncipit"
  \repeat unfold 2 { s1 \noBreak }
  {
    \override Staff.TimeSignature.stencil = ##f
    \key c \major \clef "petrucci-c1"
  }
>>

altusIncipit =
<<
  \new MensuralVoice = "altusIncipit"
  \repeat unfold 2 { s1 \noBreak }
  {
    \override Staff.TimeSignature.stencil = ##f
    \key c \major \clef "petrucci-c3"
  }
>>

tenorIncipit = 
<<
  \new MensuralVoice = "tenorIncipit" 
  \repeat unfold 2 { s1 \noBreak }
  {
    \override Staff.TimeSignature.stencil = ##f
    \key c \major \clef "petrucci-c3"
  }
>>

bassusIncipit = 
<<
  \new MensuralVoice = "bassusIncipit" 
  \repeat unfold 2 { s1 \noBreak }
  { 
    \override Staff.TimeSignature.stencil = ##f
    \key c \major \clef "petrucci-c3"
  }
>>

myIncipit = \markup
\score {
  \new StaffGroup = choirStaff <<
    \new Voice = "discantusNotes" <<
      \global
      \set Staff.instrumentName = #"" 
      \incipit \discantusIncipit
      \discantusNotes
    >>
    \new Voice = "altusNotes" <<
      \global
      \set Staff.instrumentName = #"" 
      \incipit \altusIncipit
      \altusNotes
    >>
    \new Voice = "tenorNotes" <<
      \global
      \set Staff.instrumentName = #""  
      \incipit \tenorIncipit
      \tenorNotes
    >>
    \new Voice = "bassusNotes" <<
      \global
      \set Staff.instrumentName = #"" 
      \incipit \bassusIncipit
      \bassusNotes
    >>
  >>
  \layout {
    \context {
      \Score
      %% no bar lines in staves or lyrics
      \remove "Bar_number_engraver"
    }
    indent = #0.5
    incipit-width = #0.5
  }
}

\score {
  \new StaffGroup = choirStaff <<
    \set StaffGroup.instrumentName = \myIncipit
    \new Voice = "discantusNotes" <<
      \global
      \set Staff.instrumentName = #"" 
      \incipit \discantusIncipit
      \discantusNotes
    >>
    \new Voice = "altusNotes" <<
      \global
      \set Staff.instrumentName = #"" 
      \incipit \altusIncipit
      \altusNotes
    >>
    \new Voice = "tenorNotes" <<
      \global
      \set Staff.instrumentName = #""  
      \incipit \tenorIncipit
      \tenorNotes
    >>
    \new Voice = "bassusNotes" <<
      \global
      \set Staff.instrumentName = #"" 
      \incipit \bassusIncipit
      \bassusNotes
    >>
  >>
  \layout {
    \context {
      \Score
      %% no bar lines in staves or lyrics
      \remove "Bar_number_engraver"
    }
    indent = 30
    incipit-width = 0.5
  }
}
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to