Ossia bei Mehrstimmigkeit

Begonnen von Hilflos-im-Code, Mittwoch, 2. Mai 2018, 11:49

« vorheriges - nächstes »

Hilflos-im-Code

Ich würde gerne über dem 2 Takt eine Ossia-Stelle einfügen.

\version "2.19.81"

\new Staff
<<
\new Voice = Oberstimme { \voiceOne c'' c'' c'' c'' c'' c'' c'' c''  c'' c'' c'' c''}
\\
  \new Voice  = Unterstimme {\voiceTwo c'1 1 1}
 
>>
 
 


Eine Umformung orientiert an dem zweiten Beispiel unter http://lilypond.org/doc/v2.19/Documentation/notation/modifying-single-staves#ossia-staves war nicht ganz zielführend.


\version "2.19.81"
<<
 
  \new Staff = ossia \with {
    \remove "Time_signature_engraver"
    \hide Clef
    fontSize = #-3
    \override StaffSymbol.staff-space = #(magstep -3)
    \override StaffSymbol.thickness = #(magstep -3)
  }
  { \stopStaff s1*3 }





\new Staff
<<
\new Voice = Oberstimme { \voiceOne c''4  c'' c'' c'' <<
     
      \context Staff = ossia {
        \startStaff e4 g8 f e2 \stopStaff
      }
    >>  c''4 c'' c'' c''  c'' c'' c'' c''}
\\
  \new Voice  = Unterstimme {\voiceTwo c'1 1 1}
 
>>

>>

 

Malte

Hallo Hilflos-im-Code,

dir könnte es helfen, deinen Code übersichtlicher zu formatieren. Aus deinem Original-Code\version "2.19.81"
<<

  \new Staff = ossia \with {
    \remove "Time_signature_engraver"
    \hide Clef
    fontSize = #-3
    \override StaffSymbol.staff-space = #(magstep -3)
    \override StaffSymbol.thickness = #(magstep -3)
  }
  { \stopStaff s1*3 }





\new Staff
<<
\new Voice = Oberstimme { \voiceOne c''4  c'' c'' c'' <<
     
      \context Staff = ossia {
        \startStaff e4 g8 f e2 \stopStaff
      }
    >>  c''4 c'' c'' c''  c'' c'' c'' c''}
\\
  \new Voice  = Unterstimme {\voiceTwo c'1 1 1}

>>

>>

 

könnte so z. B.\version "2.19.81"

<<
  \new Staff = ossia \with {
    \remove "Time_signature_engraver"
    \hide Clef
    fontSize = #-3
    \override StaffSymbol.staff-space = #(magstep -3)
    \override StaffSymbol.thickness = #(magstep -3)
  } {
    \stopStaff
    s1*3
  }
  \new Staff <<
    \new Voice = Oberstimme {
      \voiceOne
      c''4  c'' c'' c''
      <<
        \context Staff = ossia {
          \startStaff
          e4 g8 f e2
          \stopStaff
        }
      >>
      c''4 c'' c'' c''
      c'' c'' c'' c''
    } \\ \new Voice = Unterstimme {
      \voiceTwo
      c'1 1 1
    }
  >>
>>
werden. Dann würde auch schneller auffallen, daß einfach nur in Z. 24f. dieses Codes eine kleine Änderung nötig ist, damit das zusätzliche System und die obere Stimme tatsächlich gleichzeitig passieren:\version "2.19.81"

<<
  \new Staff = ossia \with {
    \remove "Time_signature_engraver"
    \hide Clef
    fontSize = #-3
    \override StaffSymbol.staff-space = #(magstep -3)
    \override StaffSymbol.thickness = #(magstep -3)
  } {
    \stopStaff
    s1*3
  }
  \new Staff <<
    \new Voice = Oberstimme {
      \voiceOne
      c''4  c'' c'' c''
      <<
        \context Staff = ossia {
          \startStaff
          e4 g8 f e2
          \stopStaff
        }
        {
          c''4 c'' c'' c''
        }
      >>
      c'' c'' c'' c''
    } \\ \new Voice = Unterstimme {
      \voiceTwo
      c'1 1 1
    }
  >>
>>

Hier noch ein paar kommentierte Optimierungsvorschläge:\version "2.19.81"

<<
  \new Staff = ossia \with {
    \omit TimeSignature % einfach für Einheitlichkeit nicht den Engraver entfernt
    \omit Clef % nicht hide, weil er dann noch Platz bräuchte
    % tatsächlich könnte man auch einfach den Clef_engraver entfernen
    \magnifyStaff #(magstep -3) % einfachere Variante für kleine Systeme
  } {
    \stopStaff
    s1*3
  }
  \new Staff <<
    \new Voice = Oberstimme {
      \voiceOne
      c''4  c'' c'' c''
      <<
        \context Staff = ossia {
          \startStaff
          e4 g8 f e2
          \stopStaff
        }
        {
          c''4 c'' c'' c''
        }
      >>
      c'' c'' c'' c''
    }
    % \\ an dieser Stelle braucht man nicht
    % das ist nur sinnvoll, wenn man nicht selbst Voices explizit erstellt
    % und \voiceOne/\voiceTwo nicht explizit setzt
    \new Voice = Unterstimme {
      \voiceTwo
      c'1 1 1
    }
  >>
>>

Hilflos-im-Code

Danke.

Was spricht eigentlich gegen diese Lösung?

\version "2.19.81"

<<
  \new Staff = ossia \with {
    \remove "Time_signature_engraver"
    \hide Clef
    fontSize = #-3
    \override StaffSymbol.staff-space = #(magstep -3)
    \override StaffSymbol.thickness = #(magstep -3)
  } {
    \stopStaff
    s1   \startStaff
    e4 g8 f e2
    \stopStaff
  }
  \new Staff <<
    \new Voice = Oberstimme {
      \voiceOne
      c''4 c'' c'' c''
      c''4 c'' c'' c''
      c''4 c'' c'' c''

    } \\ \new Voice = Unterstimme {
      \voiceTwo
      c'1 1 1
    }
  >>
>>

Da kann man sich weniger mit den Klammern vertun.


Aber bei beiden Lösungen gibt es nach einem Zeilenumbruch ein Problem mit den Taktzahlen.

\version "2.19.81"

<<
  \new Staff = ossia \with {
    \remove "Time_signature_engraver"
    \hide Clef
    fontSize = #-3
    \override StaffSymbol.staff-space = #(magstep -3)
    \override StaffSymbol.thickness = #(magstep -3)
  } {
    \stopStaff
    s1*10
  }
  \new Staff <<
    \new Voice = Oberstimme {
      \voiceOne
      c''4  c'' c'' c''
        c''4  c'' c'' c''
          c''4  c'' c'' c''
            c''4  c'' c'' c''
              c''4  c'' c'' c''
                c''4  c'' c'' c''
                  c''4  c'' c'' c''
                    c''4  c'' c'' c''
                      c''4  c'' c'' c''
      <<
        \context Staff = ossia {
          \startStaff
          e4 g8 f e2
          \stopStaff
        }
        {
          c''4 c'' c'' c''
        }
      >>
      c'' c'' c'' c''
    } \\ \new Voice = Unterstimme {
      \voiceTwo
      c'1 1 1 1 1 1 1 1 1 1 1
    }
  >>
>>


Wie bekommt man diese Taktzahl auf die normale Höhe beim Violinschlüssel?

harm6

Zitat von: Hilflos-im-CodeAber bei beiden Lösungen gibt es nach einem Zeilenumbruch ein Problem mit den Taktzahlen.
...
Wie bekommt man diese Taktzahl auf die normale Höhe beim Violinschlüssel?

Du solltest Maltes Code sorgfältig lesen.
Zitat von: Malte\omit Clef % nicht hide, weil er dann noch Platz bräuchte

Damit funktionierts. Der Unterschied läßt sich gut beobachten wenn Du
#(ly:set-option 'debug-skylines #t)
auf toplevel-Niveau in Dein file einfügst.

Gruß,
  Harm

Hilflos-im-Code

#4
Danke. Wenn man aber ein \clef "treble_8" setzt funktioniert wegen der 8 unter dem Violinschlüssel deine Lösung nicht mehr.

\version "2.19.81"

<<
  \new Staff = ossia \with {
    \remove "Time_signature_engraver"
    \omit Clef
    fontSize = #-3
    \override StaffSymbol.staff-space = #(magstep -3)
    \override StaffSymbol.thickness = #(magstep -3)
  } {\clef "treble_8"
    \stopStaff
    s1*8 \startStaff
          e,4 g,8 f, e,2
          \stopStaff
  }


\new Staff <<
    \new Voice = Oberstimme {\clef "treble_8"
      \voiceOne
      c'4  c' c' c'
        c'4  c' c' c'
          c'4  c' c' c'
            c'4  c' c' c'
              c'4  c' c' c'
                c'4  c' c' c'
                  c'4  c' c' c'
                    c'4  c' c' c'
                      c'4  c' c' c'
     
          c'4 c' c' c'
       
      c' c' c' c'
    } \\
   
    \new Voice = Unterstimme {
      \voiceTwo
      c1 1 1 1 1 1 1 1 1 1 1
    }
   
   
  >>
>>




Edit: Die Lösung, dass ich "\clef 'treble'" setze, ist klar. Aber es wirkt merkwürdig, dass die Lösung schlüsselabhängig ist.

Malte

Wenn du genau hinsiehst, merkst du, daß die 8 nicht entfernt wird. Das liegt daran, daß sie nicht zum Clef-Grob gehört. Hier müßte also zusätzlich zu \omit Clef auch noch \omit ClefModifier gesetzt werden.

Ich würde aber noch eine andere Vorgehensweise vorschlagen: Der ossia-Staff muß nicht von Anfang an mitlaufen, du könntest ihn auch nur für das kurze ossia-Stück erst erzeugen:\version "2.19.81"

\new Staff = "main" <<
  \new Voice = Oberstimme {
    \clef "treble_8"
    \voiceOne
    c'4  c' c' c'
    c'4  c' c' c'
    c'4  c' c' c'
    c'4  c' c' c'
    c'4  c' c' c'
    c'4  c' c' c'
    c'4  c' c' c'
    c'4  c' c' c'
    <<
      { c'4  c' c' c' }
      \new Staff \with {
        \omit TimeSignature
        \omit Clef
        \omit ClefModifier
        \magnifyStaff #(magstep -3)
        alignAboveContext = "main"
      } {
        \clef "treble_8"
        e,4 g,8 f, e,2
      }
    >>
    c'4 c' c' c'
    c' c' c' c'
  }
  \new Voice = Unterstimme {
    \voiceTwo
    c1 1 1 1 1 1 1 1 1 1 1
  }
>>


Übrigens nochmal zur Mehrstimmigkeit allgemein: Das Konstrukt<<
  A
  \\
  B
>>
ist eine Kurzschreibweise für<<
  \context Voice = "1" {
    \voiceOne
    A
  }
  \context Voice = "2" {
    \voiceTwo
    B
  }
>>

Du brauchst also in deinem Code entweder den doppelten Backslash \\ nicht, oder du verzichtest auf das explizite Erstellen von Voices und das explizite Setzen von \voiceOne/Two. Das explizite Setzen brauchst du eigentlich nur, wenn deine Voices aus einem schwerwiegenden Grund nicht "1" und "2" heißen sollen, würd ich sagen.