Initial clef change: Difference between revisions

No edit summary
mNo edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
Implements initial clef changes using a custom engraver. This engraves will upon encountering a difference between initial clef (as given by <code>\with { \clef ... }</code> and the clef at first timestep. If any difference is encountered a now clef (spaced like a cue clef) is created, while the original clef and any key signatures are modified to look like the initial clef values.
This snippet handles initial clef changes with a custom engraver. This engraver checks whether there is a difference between the initial clef (as given by <code>\with { \clef ... }</code> and the clef at the first timestep. If any difference is encountered a new clef (spaced like a cue clef) is created, while the original clef and any key signatures are modified to look like the initial clef values.


<lilypond version="2.24.0">
<lilypond version="2.24">
%%% This engraver records the initial clef properties (e.g. what is set by \with { \clef ... })
%%% This engraver records the initial clef properties (e.g. what is set by \with { \clef ... })
%%% If in the first timestep these changed, engrave the original clef, and change formatting and break
%%% If in the first timestep these changed, engrave the original clef, and change formatting and break
Line 222: Line 222:
}
}
</lilypond>
</lilypond>
[[Category:Contexts and engravers]]
[[Category:Scheme]]
[[Category:Staff notation]]
[[Category:Snippet]]