[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Hara_kiri_engraver shouldn't handle both staves of a PianoStaff as s
From: |
Valentin Villenave |
Subject: |
Re: Hara_kiri_engraver shouldn't handle both staves of a PianoStaff as separate single staves |
Date: |
Sun, 26 Aug 2007 17:31:01 +0200 |
2007/8/26, Valentin Villenave <address@hidden>:
> The existing solutions are:
> -whenever only one hand is playing, systematically add invisible notes
> to the other hand so the staff doesn't disappear. As Neil mentioned,
> it is ugly.
Here is a quick-and-dirty function I wrote a few months ago, which
sort of works; however there are a few bugs with it:
-notes tend to overlap, generating many warning messages when compiling
-if you add an ottava to one of the hands, it is printed on both staves
-you can't use polyphonic music within one hand.
So after spending a few hours and loosing some of my hair, I just dropped it.
%%%%%
%% quick-and-dirty: each staff will contain the music
%% of both staves as two distinct voices, but only
%% one will be visible.
PianoAlive=
#(define-music-function (parser location right left) (ly:music? ly:music?)
#{ <<
\new Staff \with {
\remove "Ottava_spanner_engraver"
\remove "Collision_engraver"
\remove "Rest_collision_engraver"
\remove "Accidental_engraver"
\remove "Key_engraver" } { <<
\new Voice \with {
\override VerticalAxisGroup #'minimum-Y-extent = ##f
localKeySignature = #'()
createSpacing = ##t
squashedPosition = #0
\consists "Pitch_squash_engraver"
\remove "Rest_engraver"
\remove "Text_engraver"
\remove "Dynamic_engraver"
\remove "Fingering_engraver"
\remove "Slur_engraver"
\remove "Tie_engraver"
\remove "Script_engraver"
\remove "Script_column_engraver"
\remove "Stem_engraver"
\remove "Tuplet_engraver"
\remove "Arpeggio_engraver"
\remove "Beam_engraver"
\remove "Dots_engraver"
\remove "Multi_measure_rest_engraver" } {
\sequential {
\override NoteHead #'transparent = ##t
\override NoteHead #'no-ledgers = ##t
\override TupletBracket #'transparent = ##t
\override TupletNumber #'transparent = ##t
}
{ \voiceFour $left }}
\new Voice \with{
\consists "Ottava_spanner_engraver"
\consists "Accidental_engraver"
\consists "Collision_engraver"
\consists "Rest_collision_engraver"
\consists "Key_engraver"
\consists "Clef_engraver" }
$right >> }
\new Staff \with {
\remove "Ottava_spanner_engraver"
\remove "Collision_engraver"
\remove "Rest_collision_engraver"
\remove "Accidental_engraver"
\remove "Key_engraver" } { <<
\new Voice \with {
\override VerticalAxisGroup #'minimum-Y-extent = ##f
localKeySignature = #'()
createSpacing = ##t
squashedPosition = #0
\consists "Pitch_squash_engraver"
\remove "Rest_engraver"
\remove "Text_engraver"
\remove "Dynamic_engraver"
\remove "Fingering_engraver"
\remove "Slur_engraver"
\remove "Tie_engraver"
\remove "Script_engraver"
\remove "Script_column_engraver"
\remove "Stem_engraver"
\remove "Tuplet_engraver"
\remove "Arpeggio_engraver"
\remove "Beam_engraver"
\remove "Dots_engraver"
\remove "Multi_measure_rest_engraver" } {
\sequential {
\override NoteHead #'transparent = ##t
\override NoteHead #'no-ledgers = ##t
\override TupletBracket #'transparent = ##t
\override TupletNumber #'transparent = ##t
}
{\voiceFour $right }}
\new Voice \with{
\consists "Ottava_spanner_engraver"
\consists "Accidental_engraver"
\consists "Collision_engraver"
\consists "Rest_collision_engraver"
\consists "Key_engraver"
\consists "Clef_engraver" }
$left >> }
>>
#})
%%Here comes the above snippet with this function:
one = {
\repeat unfold 4 { a4 b c' d'} \break
\repeat unfold 4 { a4 b c' d'} \break
\repeat unfold 4 { a4 b c' d'} \break
a1
}
two = { \clef treble
\repeat unfold 4 { a4 b c' d'} \break
\repeat unfold 4 { a4 b c' d'} \break
R1*4 \break
a1
}
three = { \clef bass
\repeat unfold 4 { a4 b c' d'} \break
R1*4 \break
R1*4 \break
a1
}
\score {<<
\context Staff = one \one
\new PianoStaff
\PianoAlive \two \three
>>
\layout {
\context { \RemoveEmptyStaffContext }
}
}
%%%%
Regards,
Valentin
- Hara_kiri_engraver shouldn't handle both staves of a PianoStaff as separate single staves, Valentin Villenave, 2007/08/26
- Re: Hara_kiri_engraver shouldn't handle both staves of a PianoStaff as separate single staves,
Valentin Villenave <=
- Re: Hara_kiri_engraver shouldn't handle both staves of a PianoStaff as separate single staves, Kieren MacMillan, 2007/08/26
- Re: Hara_kiri_engraver shouldn't handle both staves of a PianoStaff as separate single staves, Valentin Villenave, 2007/08/26
- Re: Hara_kiri_engraver shouldn't handle both staves of a PianoStaff as separate single staves, Kieren MacMillan, 2007/08/26
- Re: Hara_kiri_engraver shouldn't handle both staves of a PianoStaff as separate single staves, Valentin Villenave, 2007/08/26
- Re: Hara_kiri_engraver shouldn't handle both staves of a PianoStaff as separate single staves, Kieren MacMillan, 2007/08/26
- Re: Hara_kiri_engraver shouldn't handle both staves of a PianoStaff as separate single staves, Neil Puttock, 2007/08/26
- Re: Hara_kiri_engraver shouldn't handle both staves of a PianoStaff as separate single staves, Valentin Villenave, 2007/08/26
- Re: Hara_kiri_engraver shouldn't handle both staves of a PianoStaff as separate single staves, Tao Cumplido, 2007/08/27
- Re: Hara_kiri_engraver shouldn't handle both staves of a PianoStaff as separate single staves, Valentin Villenave, 2007/08/28