Separating key cancellations from key signature changes: Difference between revisions
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 12: | Line 12: | ||
We want to change that, moving <code>key-cancellation</code> before <code>staff-bar</code>. To make this happen we use the <code>grob-transformer</code> function, which gives us access to the original vector as the second argument of the lambda function, here called <code>orig</code> (we don't need the first argument, <code>grob</code>). We return a new vector, with unchanged first and last elements. For the middle element, we first remove <code>key-cancellation</code> from the list, then adding it again before <code>staff-bar</code>. | We want to change that, moving <code>key-cancellation</code> before <code>staff-bar</code>. To make this happen we use the <code>grob-transformer</code> function, which gives us access to the original vector as the second argument of the lambda function, here called <code>orig</code> (we don't need the first argument, <code>grob</code>). We return a new vector, with unchanged first and last elements. For the middle element, we first remove <code>key-cancellation</code> from the list, then adding it again before <code>staff-bar</code>. | ||
<lilypond version="2.24 | <lilypond version="2.24" full> | ||
%LSR based on | %LSR based on | ||
%LSR https://stackoverflow.com/questions/40964806/scheme-inserting-a-number-in-a-list | %LSR https://stackoverflow.com/questions/40964806/scheme-inserting-a-number-in-a-list | ||