Organization of the piese part by part, not staff by staff

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Organization of the piese part by part, not staff by staff

Павел Буданов
Hello everybody!
This case is usually used: we are instancing staffs, voices and putting notes into them. This is simply example:
\new GrandStaff <<
 \new Staff \rightHand
  \new Staff \leftHand
>>
But I want to organizate the piece in other case. For example, I want to engrave any rondo. In first, I will instancing staff structure and write initialing:
\new GrandStaff <<
  \new Staff { \key c \minor ... }
 \new Staff { \clef bass \key c \minor ... }
>>
Then I declare the variables with music:
refren = <<
  \relative c'' { g8 c e es4. f8 d4. es8 c2 }
  \relative { r8 r4 c8 es g c c, f g b c, }
>>
episodeA = <<
  ... >>
episodeB = <<
  ... >>
And I will add this music to score block:
\refren \bar "||" \episodeA \refren \episodeB
Is this case possible? If so, how to implement it correctly, where is the documentation written about it? Sorry for my bad english.

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Organization of the piese part by part, not staff by staff

Valentin Villenave-3
On 1/10/19, Павел Буданов <[hidden email]> wrote:
> And I will add this music to score block:
> \refren \bar "||" \episodeA \refren \episodeB
> Is this case possible? If so, how to implement it correctly, where is the
> documentation written about it?

Greetings Pavel,
at its heart, LilyPond very much encourages «horizontal thinking»:
it’s easier to enter one melodic voice, then another, then another.

However, there are a few ways to enter music section by section like
what you’re looking for. The first one is to use \context Staff (which
can re-use an existing Staff rather than create a \new one every
time):

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

FirstSection = <<
  \context Staff = "voice" \relative c' {
    c2 d e1
  }
  \context PianoStaff = "piano" <<
    \context Staff = "right" \relative c' {
      <g c g'>2 <g d' g> <c e g>1
    }
    \context Staff = "left" \relative c {
      \clef bass
      e2 b c1
    }
  >>
>>

SecondSection = <<
  \context Staff = "voice" \relative c' {
    a'2 f4 a g1
  }
  \context PianoStaff = "piano" <<
    \context Staff = "right" \relative c' {
      <a c f>2 <c f a> <e g c> q
    }
    \context Staff = "left" \relative c {
      \clef bass
      f,4 g a b c2 c
    }
  >>
>>

\score {
  {
    \FirstSection
    \bar "||"
    \SecondSection
  }
}

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

The second trick you may be interested in learning, is \parallelMusic
(which allows you to enter polyphonic music with every voice at once).
Have a look at this chapter:
http://lilypond.org/doc/stable/Documentation/notation/multiple-voices#writing-music-in-parallel

Good luck!

V.

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Organization of the piese part by part, not staff by staff

Shevek
Fundamentally, the data model of Lilypond is horizontal, even when you delve into the guts of how the program works (iterators, streams, engravers). My advice is to embrace that and adapt your workflow and thinking to take advantage of Lilypond's strengths, rather than fighting against it.

In my experience composing with Lilypond, dividing pieces into sections like this leads to more pain later on if I decide I want something like an overlapping hairpin between the sections. Yeah, it's a little annoying to count bars in each part if I decide to add a measure or change a time signature, but it's not that big a deal if you use barchecks and one measure per line of code.

Having a single variable for the music for each part to be extracted makes a lot of sense, since it keeps the composer in the mindset of what each player will be seeing.

My two cents.

On Thu, Jan 10, 2019 at 4:03 PM Valentin Villenave <[hidden email]> wrote:
On 1/10/19, Павел Буданов <[hidden email]> wrote:
> And I will add this music to score block:
> \refren \bar "||" \episodeA \refren \episodeB
> Is this case possible? If so, how to implement it correctly, where is the
> documentation written about it?

Greetings Pavel,
at its heart, LilyPond very much encourages «horizontal thinking»:
it’s easier to enter one melodic voice, then another, then another.

However, there are a few ways to enter music section by section like
what you’re looking for. The first one is to use \context Staff (which
can re-use an existing Staff rather than create a \new one every
time):

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

FirstSection = <<
  \context Staff = "voice" \relative c' {
    c2 d e1
  }
  \context PianoStaff = "piano" <<
    \context Staff = "right" \relative c' {
      <g c g'>2 <g d' g> <c e g>1
    }
    \context Staff = "left" \relative c {
      \clef bass
      e2 b c1
    }
  >>
>>

SecondSection = <<
  \context Staff = "voice" \relative c' {
    a'2 f4 a g1
  }
  \context PianoStaff = "piano" <<
    \context Staff = "right" \relative c' {
      <a c f>2 <c f a> <e g c> q
    }
    \context Staff = "left" \relative c {
      \clef bass
      f,4 g a b c2 c
    }
  >>
>>

\score {
  {
    \FirstSection
    \bar "||"
    \SecondSection
  }
}

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

The second trick you may be interested in learning, is \parallelMusic
(which allows you to enter polyphonic music with every voice at once).
Have a look at this chapter:
http://lilypond.org/doc/stable/Documentation/notation/multiple-voices#writing-music-in-parallel

Good luck!

V.

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Organization of the piese part by part, not staff by staff

Mats Bengtsson-4
In reply to this post by Павел Буданов

On 2019-01-10 21:19, Павел Буданов wrote:

> Hello everybody!
> This case is usually used: we are instancing staffs, voices and
> putting notes into them. This is simply example:
> \new GrandStaff <<
>  \new Staff \rightHand
>   \new Staff \leftHand
> >>
> But I want to organizate the piece in other case. For example, I want
> to engrave any rondo. In first, I will instancing staff structure and
> write initialing:
> \new GrandStaff <<
>   \new Staff { \key c \minor ... }
>  \new Staff { \clef bass \key c \minor ... }
> >>
> Then I declare the variables with music:
> refren = <<
> \relative c'' { g8 c e es4. f8 d4. es8 c2 }
> \relative { r8 r4 c8 es g c c, f g b c, }
> >>
> episodeA = <<
>   ... >>
> episodeB = <<
>   ... >>
> And I will add this music to score block:
> \refren \bar "||" \episodeA \refren \episodeB
> Is this case possible? If so, how to implement it correctly, where is
> the documentation written about it? Sorry for my bad english.

You probably already know this, but in addition to the answers you
already have received, the simplest answer for the simplest special
case, when you only have a single voice of music, is of course:

episodeA = {c d e f}

episodeB = {g f e d }

ending= {c1}

% Pasting it together:

{\episodeA \episodeB \ending}


However, as soon as you have several parallel voices/staves in each of
the sections, then you either could paste each full voice together as
described above, or use any of the techniques that Valentine mentioned
in his reply, for example.

    /Mats

--
=============================================
        Mats Bengtsson, Prof.
        Information Science and Engineering
        School of Electrical Engin. and Comp. Science
        Royal Institute of Technology (KTH)
        SE-100 44  STOCKHOLM
        Sweden
        Phone: (+46) 8 790 8463
        Email: [hidden email]
        WWW: https://www.kth.se/profile/matben/
=============================================


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Organization of the piese part by part, not staff by staff

Павел Буданов
In reply to this post by Shevek
Thank you for the answers. I learned everything I needed


11.01.2019, 03:37, "Saul Tobin" <[hidden email]>:
Fundamentally, the data model of Lilypond is horizontal, even when you delve into the guts of how the program works (iterators, streams, engravers). My advice is to embrace that and adapt your workflow and thinking to take advantage of Lilypond's strengths, rather than fighting against it.

In my experience composing with Lilypond, dividing pieces into sections like this leads to more pain later on if I decide I want something like an overlapping hairpin between the sections. Yeah, it's a little annoying to count bars in each part if I decide to add a measure or change a time signature, but it's not that big a deal if you use barchecks and one measure per line of code.

Having a single variable for the music for each part to be extracted makes a lot of sense, since it keeps the composer in the mindset of what each player will be seeing.

My two cents.

On Thu, Jan 10, 2019 at 4:03 PM Valentin Villenave <[hidden email]> wrote:
On 1/10/19, Павел Буданов <[hidden email]> wrote:
> And I will add this music to score block:
> \refren \bar "||" \episodeA \refren \episodeB
> Is this case possible? If so, how to implement it correctly, where is the
> documentation written about it?

Greetings Pavel,
at its heart, LilyPond very much encourages «horizontal thinking»:
it’s easier to enter one melodic voice, then another, then another.

However, there are a few ways to enter music section by section like
what you’re looking for. The first one is to use \context Staff (which
can re-use an existing Staff rather than create a \new one every
time):

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

FirstSection = <<
  \context Staff = "voice" \relative c' {
    c2 d e1
  }
  \context PianoStaff = "piano" <<
    \context Staff = "right" \relative c' {
      <g c g'>2 <g d' g> <c e g>1
    }
    \context Staff = "left" \relative c {
      \clef bass
      e2 b c1
    }
  >>
>>

SecondSection = <<
  \context Staff = "voice" \relative c' {
    a'2 f4 a g1
  }
  \context PianoStaff = "piano" <<
    \context Staff = "right" \relative c' {
      <a c f>2 <c f a> <e g c> q
    }
    \context Staff = "left" \relative c {
      \clef bass
      f,4 g a b c2 c
    }
  >>
>>

\score {
  {
    \FirstSection
    \bar "||"
    \SecondSection
  }
}

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

The second trick you may be interested in learning, is \parallelMusic
(which allows you to enter polyphonic music with every voice at once).
Have a look at this chapter:
http://lilypond.org/doc/stable/Documentation/notation/multiple-voices#writing-music-in-parallel

Good luck!

V.

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user