Polyrhythmic staves: Difference between revisions
Appearance
Import snippet from LSR |
m Replace version="2.24.0" with version="2.24" now that the LilyWiki extension supports auto-selecting the latest release in a stable series |
||
| Line 1: | Line 1: | ||
Polyrhythmic pieces (with different rhythms in different staves) are not processed propperly with default settings. The BarLines crash as well as Timing. The solution is to assign the respective engravers to the Staff context. | Polyrhythmic pieces (with different rhythms in different staves) are not processed propperly with default settings. The BarLines crash as well as Timing. The solution is to assign the respective engravers to the Staff context. | ||
<lilypond version="2.24 | <lilypond version="2.24"> | ||
% For polyrhythmic pieces we have to remove some engravers | % For polyrhythmic pieces we have to remove some engravers | ||
% from score context and assign them to staff context. | % from score context and assign them to staff context. | ||
Revision as of 18:55, 16 November 2025
Polyrhythmic pieces (with different rhythms in different staves) are not processed propperly with default settings. The BarLines crash as well as Timing. The solution is to assign the respective engravers to the Staff context.
\version "2.24"
% For polyrhythmic pieces we have to remove some engravers
% from score context and assign them to staff context.
% This snippet makes no use of Repeat_acknowledge_engraver and Volta_engraver
% But to make it easier to adapt the snippet to different needs,
% these engravers are mentioned here, too. You will need them as soon as you use \repeat.
upperVoice = \relative c'' {
\override Staff.BarLine.allow-span-bar = ##f
\time 3/4
e4 f g
a g f % since Staff.BarLine.allow-span-bar is set to ##f, bar lines are not connected
e f g
% if we want the BarLines of the Staves to be connected, we have to turn it on again
a g f\bar"|." \once \override Staff.BarLine.allow-span-bar = ##t
}
lowerVoice = \relative c'' {
\time 4/4
c1
c1
c1\bar"|."
}
\score {
\new StaffGroup <<
\new Staff <<
\new Voice { \upperVoice }
>>
\new Staff <<
\new Voice { \lowerVoice }
>>
>>
\layout {
\context {
\Score
\remove "Timing_translator"
%\remove "Repeat_acknowledge_engraver"
%\remove "Volta_engraver"
}
\context{
\Staff
\consists "Timing_translator"
%\consists "Repeat_acknowledge_engraver"
%\consists "Volta_engraver"
}
}
}