I managed to do an example where I feed the same stuff into a Staff and a TabStaff, splitting in two Voices for the Staff, and remaining in one for the TabStaff (the automatic string selection cannot handle different voices, so this gives some warnings but saves the effort of specifying that myself).
This shows an interesting property:
If multiple Contexts have the same name, Lilypond switches to the one that’s
closest so if we have
ContextA {
→ ContextB [ change to ContextC ]
→ ContextC
}
Context D {
→ ContextB
→ ContextC
}
We change to ContextC in ContextA. If we have
ContextA {
→ ContextB [ change to ContextC ]
→ ContextE
}
Context D {
→ ContextB
→ ContextC
}
We change to ContextC in ContextD.
So in this case we only need to specify to switch to Container 2, and both
Staves will automatically switch to the right container.
Valentin\version "2.20"
\language "deutsch"
\layout {
\context {
\Voice
\accepts "Notes"
\accepts "Container"
}
\context {
\TabVoice
\accepts "Notes"
\accepts "Container"
}
\context {
\name "Notes"
\type "Engraver_group"
}
\context {
\Staff
\accepts "Container"
}
\context {
\TabStaff
\accepts "Container"
}
\context {
\Dynamics
\accepts "Container"
}
\context {
\name "Container"
\type "Engraver_group"
\accepts "Notes"
}
}
music = \relative c'' {
c4 h8 a h4 a8 g
<<
{ \voiceOne a4 g8 f g2 a8 c e g a2 }
\new Container \new Notes { \change Container="2" \voiceTwo f,2 h,2 c4 h a2 }
>>
}
\score {
<<
\new Staff <<
\new Voice \new Container="1" \new Notes { \music }
\new Voice \new Container="2" \new Notes { #(skip-of-length music) }
>>
\new TabStaff \new TabVoice <<
\new Container="1" \new Notes { \music }
\new Container="2" \new Notes { #(skip-of-length music) }
>>
>>
\layout { }
}
signature.asc
Description: This is a digitally signed message part.
