I am having two issues with a custom unpitched-percussion staff in a score.
Item 1: \RemoveEmptyStaves does not remove the percussion staff even though
it suppresses other staves correctly. (I had the same problem with a
non-customized DrumStaff or RhythmStaff when I tried that earlier.)
This feels like a bug to me.
Looking at the internals PDF, there is probably a one-line fix for this,
where one symbol (the percussion clef maybe?) is in the keepAliveInterfaces
list but should not be.
Can anyone tell me what I need to insert?
Item 2: I can't use a variable to insert the percussion music like I can
everything else.
When I build my score,
<< \drummode {tri4 cymc4 tt4} >> works fine.
But << \perc >> , after having previously set perc = {\drummode { tri4
cymc4 tt4 R2.} }, fails with the error "warning: Ignoring non-music
expression {\perc}"
Tried several variations, with and without extra braces, etc.
I assume this one is operator error (<<>> or {} in the wrong place,
\drummode in the wrong place, something...) but it has me confused.
Attached is an example of the problem score.
Thank you!
GRB
%Debugging percussion staff
\version "2.22.0"
\language "deutsch"
globalc = { \time 3/4
\tempo 2. = 56
}
%Fill one staff with 3 systems worth of music
cori = { \unfoldRepeats \repeat volta 12 {c'4 d' e' c' d' e'} }
corii = { \unfoldRepeats \repeat volta 12 {e4 f g e f g} }
%Horns 3-4 correctly appear only in the 1st and 3rd systems
coriii = {R2.*18 g2. R2.*5}
coriv = {R2.*24}
%Timpani correctly appear only in the 1st and 2nd systems
tp =\relative c {\clef bass R2. *12 e,4 h' h h r2 R2.*10}
%Why on earth doesnt this work later??
perc = {\drummode { tri4 cymc4 tt4 R2.} }
\header {
title = "Any Piece"
composer = "Any composer"
copyright =\markup{ \char ##x00A9 "2021 GRB"}
tagline = ##f
}
assemblescore = {
<<
\accidentalStyle Score.modern-voice
\new StaffGroup \with {instrumentName="Corni (F)"
\override InstrumentName.self-alignment-X = #RIGHT
shortInstrumentName="Cor."
systemStartDelimiter = #'SystemStartBrace }
<<
\new Staff = "Horns 1-2"
\with { instrumentName="1,2"
} <<
\set Staff.soloText = #"1."
\set Staff.soloIIText = #"2."
\set Staff.aDueText = "a 2"
\transposition f
\transpose f c' {
\globalc \partCombine \cori \corii }
>>
\new Staff = "Horns 3-4"
\with { instrumentName="3,4"
\override InstrumentName.self-alignment-X = #RIGHT
} <<
\set Staff.soloText = #"3."
\set Staff.soloIIText = #"4."
\set Staff.aDueText = "a 2"
\transposition f
\transpose f c' {
\globalc \partCombine \coriii \coriv }
>> >>
\new Staff = "Timpani" \with { instrumentName="Timpani (D, B, E)"
\override InstrumentName.self-alignment-X = #RIGHT
shortInstrumentName = "Tp."
}
<< \globalc \tp >>
%Custom percussion staff:
#(define perc '(
(triangle default #f 2)
(cymbals default #f 0)
(tamtam default #f -2)
))
\new DrumStaff = "Percussion" \with {
\override InstrumentName.self-alignment-X = #RIGHT
instrumentName=\markup { \right-column { "Triangolo" "Piatti" "Tamtam" } }
\override StaffSymbol.line-count=#3
}
<<
\set DrumStaff.drumStyleTable = #(alist->hash-table perc)
% This works:
\globalc \drummode { tri4 cymc4 tt4 R2.*23}
% This doesnt, with or without the braces:
% {\globalc \perc }
>>
>> % wrapper around whole score
}
\score {
\assemblescore
\layout{
\context { \Staff \RemoveEmptyStaves }
#(layout-set-staff-size 18)
indent = 40\mm
}%end layout
}