lilypond-user
[Top][All Lists]
Advanced

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

Re: Openlilylib edition-engraver. I need help understanding how to refer


From: Urs Liska
Subject: Re: Openlilylib edition-engraver. I need help understanding how to reference contexts.
Date: Sat, 27 Jan 2018 01:42:16 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2

Hi Stefano,

I have now also looked at your example. I think your voicing is strange even without considering the edition-engraver.

What you do is:

  • Create a staff ("LH")
  • Explicitly create a Voice ("Implied")
  • Start the content of that Voice with the clef
  • *Then* create two new voices *within* the Voice "Implied"
  • These contain the music

Technically what you're doing here is how *temporary* polyphony is used. The following example is a typical use case of the way you construct the LH staff:

\version "2.19.80"

\relative c' {
  c d e f | % this corresponds to where you put \clef F
  <<
    \new Voice {
      \voiceOne
      e f g a
    }
    \new Voice {
      \voiceTwo
      c, d e f
    }
  >>
  \oneVoice
  g1
}

In that example it is clearer what is happening:

  • The first measure (c d e f) will get assigned Voice A by the edition-engraver
  • The new voices are new voices and therefore B and C
  • For the last measure I'm not sure if that will be A again or if a new voice D is started instead.

This at least explains why you have to use B and C for the left hand.
I'm not sure why the first beat doesn't work properly, but I suspect it has to do with the fact that you have in fact a Voice A but without any length. That is, the voices B and C are instantiated *during* Voice A but also at the *same time*. Obviously this confuses the edition-engraver.

What you *want* to do (independently of the edition-engraver) is to set up the LH exactly like the RH: One Staff with two parallel Voices. Probably you were misled by the idea that the clef should apply to the staff and should therefore be written outside the two voices. But you can simply put \clef at the beginning (inside) of either Voice.

I have rewritten your example to have that proper structure. You can see that it now addresses the Voices as A and B, and does so from the first beat.

\version "2.19.80"

\language "english"

\include "oll-core/package.ily"
\loadPackage edition-engraver

\addEdition test

%When the voice with the \clef F is created explicitly, sub-voices appear to be inaccessible on the first note of the first bar
\editionMod test 1 0/4 Piano.LH.Voice.A { \once \override NoteHead.color = #magenta }
\editionMod test 1 0/4 Piano.LH.Voice.B { \once \override NoteHead.color = #green }
%Yet they are accessible later
\editionMod test 1 1/8 Piano.LH.Voice.A { \once \override NoteHead.color = #magenta }
\editionMod test 1 2/4 Piano.LH.Voice.B { \once \override NoteHead.color = #green }

\consistToContexts #edition-engraver Score.PianoStaff.Staff.Voice

\score {
  \new PianoStaff \with {
    \editionID Piano
  } <<
    \new Staff \with { 
      \editionID RH 
    } <<
      \new Voice = "RH_A" \relative c'' {
        \voiceOne c4. d8 d4. g8 | e4.( d8 c b g4)
      }
      \new Voice = "RH_B" \relative c'' {
        \voiceTwo a2. g4~ | g f2 e4 |
      }
    >>

    \new Dynamics { s1\mp }

    \new Staff \with {
      \editionID LH
    } {
      <<
        \new Voice = "LH_A" \relative c' {
          \clef F \voiceOne e8 d c4  d8 c b4 | c8 b a2 g4
        }
        \new Voice = "LH_B" \relative c {
          \voiceTwo f2 e | d g,4 c |
        }
      >>
    }
  >>
}
I hope this makes the situation clearer to you.

Best
Urs



reply via email to

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