Hallo zoink,
Robert hat vorgemacht was ich mir eigentlich vorgestellt habe!
Auch wenn Du schreibst:
Ich möchte aber die zwei Stimmen auf keinen Fall getrennt in Variablen schreiben, denn das führt beim Schreiben längerer Stücken zu einiger Verwirrung.
, so denke ich genau das Gegenteil. Die Konstruktion <<{...}\\{...}>> verwende ich eigentlich nur noch in Sonderfällen.
Ich habe mal Robert's Vorschlag einschließlich
\repeat percent und Variablen umgesetzt.
\version "2.12.3"
drumPitchNames =
#(append '(
(bassdrumr . bassdrumr)
(bassdruml . bassdruml)
(bdr . bassdrumr)
(bdl . bassdruml)
(tomm . lowmidtom)
(tomf . lowfloortom)
)
drumPitchNames
)
#(define mydrums '(
(crashcymbal cross #f +5)
(cowbell triangle #f +5)
(hihat cross #f +4)
(closedhihat cross "stopped" +4)
(halfopenhihat xcircle #f +4)
(openhihat cross "open" +4)
(ridecymbal cross #f +3)
(ridebell triangle #f +3)
(hightom default #f +2)
(lowmidtom default #f +1)
(sidestick cross #f 0)
(snaredrum default #f 0)
(lowtom default #f -1)
(lowfloortom default #f -2)
(pedalhihat cross #f -3)
(bassdrumr default #f -4)
(bassdruml default #f -5)
)
)
drumNotesOne = \drummode {
\tempo 4 = 120
% 1-4
\set Score.measureLength = #(ly:make-moment 9 8) s8
s1 |
\unset Score.measureLength
\repeat percent 3 { s1 |}
% 5-12
\repeat percent 8 {\repeat unfold 4 { hh4 }| }
}
drumNotesTwo = \drummode {
% 1-4
\set Score.measureLength = #(ly:make-moment 9 8) s8
\acciaccatura tomh8 tomh8 [\times 2/3 { bdr16 bdl bdr } tomm8 bdr] bdr sn toml16 [bdr bdl bdr] |
\unset Score.measureLength
\repeat percent 3 { \acciaccatura tomh8 tomh8 \times 2/3 { bdr16 bdl bdr } tomm8 bdr bdr sn toml16 bdr bdl bdr |}
% 5-12
\repeat percent 8 {\repeat unfold 4 { bdr8 sn } }
}
\book {
\bookpart {
\score {
\new DrumStaff \with {
\consists "Parenthesis_engraver"
}
<<
\set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
\set DrumStaff.countPercentRepeats = ##t
\new DrumVoice { \voiceOne \drumNotesOne }
\new DrumVoice { \voiceTwo \drumNotesTwo }
>>
\layout {
indent = 0.0\cm
}
}
\header {
title = "Titel"
subtitle = " "
instrument = "Schlagzeug"
poet = "Autor"
composer = "Komponist"
meter = " "
tagline = ##f
}
}
}
Die Zuordnung zu den Stimmen habe ich verändert und im
\score mit
\voiceOne, \voiceTwo gearbeitet um die Notenhälse von vornherein richtig auszurichten
@Robert
das Problem ist, dass Lily die Neudefinition der drumStyleTable erst mit dem ersten vollen Notenwert berücksichtigt.
Das wußte ich nicht! Insofern: wieder etwas gelernt!!
Aber hat Dein Vorschlag nicht auch ein paar Nachteile?
Man muß beim
\set Score.measureLength = #(ly:make-moment 9 8) music \unset Score.measureLength-Konstrukt im ersten Takt von Hand verbalken und wenn man
\repeat percent setzen will, diesen Takt nach
\unset Score.measureLength nocheinmal angeben. Ich habe keinen Weg (mit akzeptablem Aufwand) gefunden stattdessen das repeat-percent-Zeichen auszugeben. In der zweiten Stimme mußte ich dasselbe Konstrukt dann erneut angeben.
Insofern frage ich, ob meine Idee mit
\cadenzaOn s128 \cadenzaOff diese Voraussetzung nicht auch erfüllt? Wenn ich folgenden Code kompiliere wird das repeat percent -Zeichen auch im zweiten Takt ausgegeben.
\version "2.12.3"
drumPitchNames =
#(append '(
(bassdrumr . bassdrumr)
(bassdruml . bassdruml)
(bdr . bassdrumr)
(bdl . bassdruml)
(tomm . lowmidtom)
(tomf . lowfloortom)
)
drumPitchNames
)
#(define mydrums '(
(crashcymbal cross #f +5)
(cowbell triangle #f +5)
(hihat cross #f +4)
(closedhihat cross "stopped" +4)
(halfopenhihat xcircle #f +4)
(openhihat cross "open" +4)
(ridecymbal cross #f +3)
(ridebell triangle #f +3)
(hightom default #f +2)
(lowmidtom default #f +1)
(sidestick cross #f 0)
(snaredrum default #f 0)
(lowtom default #f -1)
(lowfloortom default #f -2)
(pedalhihat cross #f -3)
(bassdrumr default #f -4)
(bassdruml default #f -5)
)
)
cad = {\cadenzaOn s128 \cadenzaOff }
drumNotesOne = \drummode {
\tempo 4 = 120
% 1-4
\cad
\repeat percent 4 { s1 |}
% 5-12
\repeat percent 8 {\repeat unfold 4 { hh4 }| }
}
drumNotesTwo = \drummode {
% 1-4
\cad
\repeat percent 4 { \acciaccatura tomh8 tomh8 \times 2/3 { bdr16 bdl bdr } tomm8 bdr bdr sn toml16 bdr bdl bdr |}
% 5-12
\repeat percent 8 {\repeat unfold 4 { bdr8 sn } }
}
\book {
\bookpart {
\score {
\new DrumStaff \with {
\consists "Parenthesis_engraver"
}
<<
\set DrumStaff.drumStyleTable = #(alist->hash-table mydrums)
\set DrumStaff.countPercentRepeats = ##t
\new DrumVoice { \voiceOne \drumNotesOne }
\new DrumVoice { \voiceTwo \drumNotesTwo }
>>
\layout {
indent = 0.0\cm
}
}
\header {
title = "Titel"
subtitle = " "
instrument = "Schlagzeug"
poet = "Autor"
composer = "Komponist"
meter = " "
tagline = ##f
}
}
}
Gruß,
Harm