The use of edition engraver is certainly one good approach. Although, you would have a similar task to the one you wanted to avoid, which is to compile a separate mapping of breaks. In the case of the ee, this amounts to compiling a list of entries for each measure number where you need the breaks, rather than creating another voice with all the durations.
The use of variables is very clever and something to consider. I might just switch to this in the future!
But I figured I'd share the approach I use, which solves this exact problem for me such that I have not found a need to improve it, and for which you are already set up, which is to use tags. Tags support multiple names, so in addition to whatever tags you are using currently, you could add ones to distinguish between parts and the score.
The basic concept is that if you want a part-only line break, you can write
\tag #'Part { \break }
If you want a score-only line break, you can write
\tag #'Score { \break }
Same deal for page breaks. For the ease of input, these can be defined:
breakPart = \tag #'Part { \break }
breakScore = \tag #'Score { \break }
pageBreakPart = \tag #'Part { \pageBreak }
pageBreakScore = \tag #'Score { \pageBreak }
And then to use them, you write:
\breakPart
\breakScore
\pageBreakPart
\pageBreakScore
So, for example:
Violinone = \new Voice {
\relative c'' {
c2 d e1
\breakPart
\pageBreakScore
c2 d e1
\pageBreakPart
c2 d e1
\bar "|."
}
}
The one sticky point conceptually here is that, if you don't currently have a global structure (your example's global just lists stuff at the top, and does not map out the entire piece), that means you will have to put the score-based breaks in one of the parts.
You might need to put the score-based breaks in more than one part if, for example, you want to break the score during what is a multi-measure rest of one of the parts.
Then, you just supply the appropriate tag in the \score's:
\version "2.19.82"
#(set-global-staff-size 14)
\book {
\score {
% I changed this case to match my definitions above,
% which should be fine for your example since you didn't use "score" anywhere.
% The () are just to clarify that this could be a list of tags, in case you use others.
\new StaffGroup \keepWithTag #'(Score) \music
\layout { }
%\midi { }
}
}
\book {
\bookOutputName "violinone"
\score {
% This is really the only change: use a list of tags, including the one used in the part-based breaks
\keepWithTag #'(Part vn1) \music
\layout { }
}
}
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-