lilypond-user
[Top][All Lists]
Advanced

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

Re: How to fix this divisi please


From: Valentin Villenave
Subject: Re: How to fix this divisi please
Date: Wed, 6 Feb 2019 23:30:05 +0000

On 2/6/19, Reggie <address@hidden> wrote:
> Hi. I have put together as much as I can to truly do my best. I hope I am
> able to get some help to learn why I am wrong. I have a few questions. One,
> how can I input notes in Violin in the empty measures below divisisi?

Well, you’re using something a bit unusual : you’re actually starting
a new StaffGroup _inside_ the variable that’s normally used for a
single staff (your first violins) alone.
It’s not impossible, but it’s still a bit hasardous.

So, if you want your "main" Violin1 to keep playing while all of this
is happening, you have to include it as a simultaneous voice, like I
did in the corrected version of your code below.

> Finally, how can I create a violin 1 part so each part shows the violin 1
> and then only the "appropriate" divisi for each part only? I don't
> understand this engraver at all.

OK, this is where it become tricky. Because of your rather unusual
hack, _all_ of the divisi part are stored in _one_ variable (where we
usually prefer to define lots of different variables, and then use
these whenever we want). So we have to start with your huge variable
with all the staves inside, and then select the ones we want or filter
the ones we don’t want. LilyPond has a mechanism for that: the \tag
command, that allows you to mark one music expression and everything
inside. See 
http://lilypond.org/doc/v2.19/Documentation/notation/different-editions-from-one-source

Oh, one other thing: you don’t need to copy all your definitions
(global, scoreAViolinI etc.) in every file! Just put them all in one
file, that you can call, for example, "variables.ly":

%%%%% file: variables.ly %%%%
global = {…}
scoreAViolinI = {…}
etc.
%%%%%%%%%%%%%%%

And then in another file you can just type :

%%%% file: score.ly %%%%%

\include "variables.ly"
\header { title = "Full Score" }
\score {
  \new StaffGroup <<
     \new Staff \scoreAViolinI
     \new Staff … etc …
  >>
}
%%%%%%%%%%%%%%%%%

And then you can have other files such as

%%%%%% file : solo_part.ly %%%%

\include "variables.ly"
\header { title = "individual part" }
\score {
  \new Staff \scoreAViolinI
}
%%%%%%%%%%%%%%

Anyway. Here’s my version of your code, I’ve used tags and added some
examples of divisi parts as \bookparts blocks (just to have nicer
titles, and to force them to start on separate pages in the PDF).


%%%%%%%%%%%%%%%%%%%%%%%%

\version "2.19.80"

\header {
  % Remove default LilyPond tagline
  tagline = ##f
}

global = {
  \key c \major
  \time 4/4
}

scoreAViolinI = \relative c'' {
  \global
  % Music follows here.
  \repeat unfold 10 { c1 } ges1 \break
  <<
    \tag #'divMain {
      \oneVoice
      \repeat unfold 10 {c,2 d}
    }
    \\
    \new StaffGroup = "Group"
    \with {
      shortInstrumentName = \markup \center-column {Vl. "(div. a 4)"}
      systemStartDelimiter = #'SystemStartSquare
    } <<
      \tag #'div1 \new Staff = "diva1" \with {
        \remove Time_signature_engraver
        alignAboveContext = "ViolinMain"
        %shortInstrumentName = "v1.1"
      }  { g1:32 g1:32 g1:32 g1:32 g1:32 g1:32 g1:32 g1:32 g1:32 g1:32 }
      \tag #'div2 \new Staff = "diva2" \with {
        \remove Time_signature_engraver
        alignAboveContext = "ViolinMain"
        % shortInstrumentName = "v1.2"
      }  { bes1:32 bes1:32 bes1:32 bes1:32 bes1:32 bes1:32 bes1:32 bes1:32
           bes1:32 bes1:32 }
      \tag #'div3 \new Staff = "diva3" \with {
        \remove Time_signature_engraver
        alignAboveContext = "ViolinMain"
        % shortInstrumentName = "v1.3"
      }  { f1:32 f1:32 f1:32 f1:32 f1:32 f1:32 f1:32 f1:32 f1:32 f1:32 }
      \tag #'div4 \new Staff = "diva4" \with {
        \remove Time_signature_engraver
        alignAboveContext = "ViolinMain"
        \override BarLine.allow-span-bar = ##f
        % shortInstrumentName = "v1.4"
      }  { as1:32 as1:32 as1:32 as1:32 as1:32 as1:32 as1:32 as1:32 as1:32
           as1:32 }
    >>
  >>
  \repeat unfold 20 { fes1 }
}

scoreAViolinII = \relative c'' {
  \global
  % Music follows here.
  \repeat unfold 50 { d1 }
}

scoreAViola = \relative c' {
  \global
  % Music follows here.
  \repeat unfold 50 { e1 }
}

scoreACello = \relative c {
  \global
  % Music follows here.
  \repeat unfold 50 { f1 }
}

scoreAContrabass = \relative c {
  \global
  % Music follows here.
  \repeat unfold 50 { g1 }
}

scoreAViolinIPart = \new Staff = "ViolinMain" \with {
  instrumentName = "Violin I"
  shortInstrumentName = "Vl. I"
} \scoreAViolinI

scoreAViolinIIPart = \new Staff \with {
  instrumentName = "Violin II"
  shortInstrumentName = "Vl. II"
} \scoreAViolinII

scoreAViolaPart = \new Staff \with {
  instrumentName = "Viola"
  shortInstrumentName = "Vla."
} { \clef alto \scoreAViola }

scoreACelloPart = \new Staff \with {
  instrumentName = "Cello"
  shortInstrumentName = "Cl."
} { \clef bass \scoreACello }

scoreAContrabassPart = \new Staff \with {
  instrumentName = "Contrabass"
  shortInstrumentName = "Cb."
} { \clef bass \scoreAContrabass }

\score {
  <<
    \new StaffGroup <<
      \scoreAViolinIPart
      \scoreAViolinIIPart
      \scoreAViolaPart
      \scoreACelloPart
      \scoreAContrabassPart
    >>
  >>
  \layout { }
}

\paper {
  #(set-paper-size "a4")
  top-margin = 15\mm
  left-margin = 25\mm
  right-margin = 25\mm
  bottom-margin = 15\mm
}



scoreAViolinIPart = \new Staff = "ViolinMain" \with {
  instrumentName = "Violin I"
  shortInstrumentName = "Vl. I"
} \scoreAViolinI


\bookpart {
  \header {
    title = "Violin Part (main)"
  }
  \removeWithTag #'(div1 div2 div3 div4)
 \scoreAViolinIPart
}

\bookpart {
  \header {
    title = "Violin Part (div. 1)"
  }
  \removeWithTag #'(divMain div2 div3 div4)
 \scoreAViolinIPart
}

\bookpart {
  \header {
    title = "Violin Part (div. 2)"
  }
  \removeWithTag #'(divMain div1 div3 div4)
 \scoreAViolinIPart
}


\paper {
  #(set-paper-size "a4")
  top-margin = 15\mm
  left-margin = 25\mm
  right-margin = 25\mm
  bottom-margin = 15\mm
}

\layout {
  \context {
    \Staff
    \RemoveEmptyStaves
  }
}

%%%%%%%%%%%%%%%%%%%%%%%%

HTH!

Cheers,
V.



reply via email to

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