Autochange music with a different pitch: Difference between revisions
Appearance
No edit summary |
m New category Tags: Mobile edit Mobile web edit |
||
| Line 26: | Line 26: | ||
[[Category:Automatic notation]] | [[Category:Automatic notation]] | ||
[[Category:Workaround]][[Category:Snippet]] | [[Category:Workaround]] | ||
[[Category:Snippet]] | |||
Latest revision as of 23:25, 21 November 2025
The \autochange command usually allows to switch staves when reaching the middle C. However, here is a way to specify a different pitch as the "turning point".
\version "2.24"
%% http://lsr.di.unimi.it/LSR/Item?id=724
% by David Kastrup (Feb. 2014)
autoChangeWithPitch =
#(define-music-function (ref music) ((ly:pitch?) ly:music?)
(let ((mus (make-autochange-music
(if ref #{ \transpose $ref c' $music #} music))))
(set! (ly:music-property mus 'element) music)
mus))
\context PianoStaff <<
\context Staff = "up" {
\autoChangeWithPitch a \new Voice << \relative c' {
g4 c e d c r4 a g } >>
}
\context Staff = "down" {
\clef bass
s1*2
}
>>