[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Multiple clefs in one Staff
From: |
David Kastrup |
Subject: |
Re: Multiple clefs in one Staff |
Date: |
Sat, 28 Oct 2023 20:27:18 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
David Kastrup <dak@gnu.org> writes:
> Werner LEMBERG <wl@gnu.org> writes:
>
>>> Inspired by
>>> <https://music.stackexchange.com/questions/132340/lilypond-different-clefs-for-each-voice-on-one-staff>
>>>
>>> Should we be offering something like that?
>>
>> What exactly do you mean with 'offering'?
>
> Provide it as core functionality called with dedicated commands.
>
>> Having this functionality is certainly useful for Piano music.
>> However, it's quite rare, and an LSR snippet should be sufficient
>> (possibly integrated into LilyPond's documentation).
>
> I see that you have shown an example that repeats the clef for every
> measure. If that's the convention, the approach in my code is not
> likely helpful.
Correction: it is easy to make it do that.
\version "2.24.2"
\language "italiano"
\header {
tagline = ##f
}
\layout {
\context {
\Staff
\accepts PseudoClefStaff
}
\context {
\name PseudoClefStaff
\type Engraver_group
\alias Staff
\accepts Voice
\consists Clef_engraver
\override Clef.font-size = #-4
\override Clef.break-align-symbol = #'cue-clef
\override Clef.break-visibility = #end-of-line-invisible
}
}
\midi {
\context {
\Staff
\accepts PseudoClefStaff
}
\context {
\name PseudoClefStaff
\type Performer_group
\alias Staff
\accepts Voice
}
}
pseudoClef =
#(define-music-function (offset clef-type) ((number?) string?)
#{ \new PseudoClefStaff = "pseudo" \with { firstClef = ##f } { }
\change Staff = "pseudo"
#(if offset #{ \override Staff.Clef.Y-offset = #offset #})
\clef #clef-type
#})
% Any ideas for an automated endPseudoClef?
\score {
\new Staff = "lower" {
\key re \minor
\numericTimeSignature
\time 3/4
\clef bass
\relative do' {
\voices 1,""
<<
{
s2. r4 r8. \clef treble
\tuplet 3/2 16 { sol'32 (la sib }
do8.) do16--
do16-- sib sol la
sol8.
\omit TupletBracket
\tuplet 3/2 16 { fa32 (sol la }
sib8.) sib16
} \\
{
re,,,8.-- re16-- re2--~ 2.~
\pseudoClef #-3 "bass"
\voiceTwo
2.~ \break 2.~2.
\oneVoice
\change Staff = "lower" % change back to standard staff
}
>>
}
}
}
--
David Kastrup