Polyrhythmic staves: Difference between revisions
Appearance
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 |
m New category Tags: Mobile edit Mobile web edit |
||
| (One intermediate revision by the same user not shown) | |||
| Line 58: | Line 58: | ||
[[Category:Contexts and engravers]] | [[Category:Contexts and engravers]] | ||
[[Category:Contemporary notation]] | [[Category:Contemporary notation]] | ||
[[Category:Snippet]] | |||
Latest revision as of 23:30, 21 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"
}
}
}