I'm actually not sure how useful the hack from the example "3.2.4 Piano centered dynamics" really is. It seems to me that you could get more or less the same result by keeping the dynamics definitions in one of the staves and simply adjusting the staff-padding property for the dynamics. For example, in the example template in the manual, simply replace the \score{...} block by
\score { \context PianoStaff << \context Staff=upper << \upper \dynamics >> \context Staff=lower << \clef bass \lower \pedal >> >> \layout { \context{ \Staff \override DynamicLineSpanner #'staff-padding = #3 \override SostenutoPedalLineSpanner #'staff-padding = #3 \override SustainPedalLineSpanner #'staff-padding = #3 \override UnaCordaPedalLineSpanner #'staff-padding = #3 } } } This should also solve the problem you report. /Mats Trevor Baca wrote:
You have to have hairpins in a separate context (like the 3.2.4 template) to get this, but when you do you'll find that hairpins take their horizontal start- and stop-points from the *width of lyric text* happening at the same rhythmic moment, rather than from the *width of noteheads* happening at the same rhythmic moment, which can lead to, for example, really confusing your pianist. The example here shows this point through a series of four progressive examples that should render on a single page. You'll need 2.7.4 to render the \wordwrap correctly and read the explanations. Possibly a workaround for this already exists? Or possibly the Dynamics context I've built here for these examples is somehow deficient. Or perhaps Lily's default behavior for hairpin spanning should change? Trevor. %%%%%%%%%%% hairpin-lyrics interaction %%%%%%% \version "2.7.4" \markup {\wordwrap {\bold {Hairpin-lyrics interaction.} Here is some music. The hairpins attach inline to notes, directly in the note entry. The hairpins are very beautiful. They each start from left note-edge and stop at right note-edge:}} theWords = \lyricmode { text and even more text, words and even more words } \score { << \new Staff << \clef treble \time 4/4 \context Voice = "theNotes" { c'2.\< c'4\! | c'2.\> c'4\! | c'1\< | r1\! c'2.\< c'4\! | c'2.\> c'4\! | c'1\< | r1\! } \lyricsto "theNotes" \new Lyrics \theWords >> >> } \markup {\wordwrap {Here is the same music, but with dynamics in a special Dyanmics context like the one in template 3.2.4. Here the hairpins are not so beautiful. They each start at left lyric-edge and stop at right lyric-edge:}} \score { << \new Staff << \clef treble \time 4/4 \context Voice = "theNotes" { c'2. c'4 | c'2. c'4 | c'1 | r1 c'2. c'4 | c'2. c'4 | c'1 | r1 } \lyricsto "theNotes" \new Lyrics \theWords >> \new Dynamics { s2.\< s4\! | s2.\> s4\! | s1\< | s1\! s2.\< s4\! | s2.\> s4\! | s1\< | s1\! } >> \layout { \context { \name "Dynamics" \type "Engraver_group_engraver" \consists "Axis_group_engraver" \consists "Skip_event_swallow_translator" \consists "Dynamic_engraver" } \context { \Score \accepts "Dynamics" } } } \markup {\wordwrap {The same hairpin-stretching effect obtains no matter where we put the special Dynamics context:}} \score { << \new Staff << \clef treble \time 4/4 \context Voice = "theNotes" { c'2. c'4 | c'2. c'4 | c'1 | r1 c'2. c'4 | c'2. c'4 | c'1 | r1 } \lyricsto "theNotes" \new Lyrics \theWords >> \new Staff { c'2. c'4 | c'2. c'4 | c'1 | r1 c'2. c'4 | c'2. c'4 | c'1 | r1 } \new Dynamics { s2.\< s4\! | s2.\> s4\! | s1\< | s1\! s2.\< s4\! | s2.\> s4\! | s1\< | s1\! } >> \layout { \context { \name "Dynamics" \type "Engraver_group_engraver" \consists "Axis_group_engraver" \consists "Skip_event_swallow_translator" \consists "Dynamic_engraver" } \context { \Score \accepts "Dynamics" } } } \markup {\wordwrap {The idea that hairpin bounds match lyric bounds is unusual. The following snippet from the first of the Brahms German folksongs probably gives a good idea why when we look carefully at the hairpins on either side of the barline between the first two measures:}} brahmsLyrics = \lyricmode { of -- fen schon, komm | nur in mei -- ne | Hütt __ Ach | } \score { << \new Staff << \context Voice = "melody" { \clef treble \time 6/8 c''4 e''8 d''4 f''8 | e''4 d''8 c''4 d''8 g'4. ~ g'4 c''8 | } \lyricsto "melody" \new Lyrics \brahmsLyrics >> \new PianoStaff << \new Staff { \clef treble \time 6/8 r8 <e' c'' e''>8[ r8 <f' b' e''>8 r8 <d' f' b'>8] | r8 <c' e' c''>8[ r8 <e' g' c''>8 r8 <c' fis' a'>8] | r8 <g b g'>8[ r8 <g e' g'>8 r8 <g c' fis' g'>8] | } \new Dynamics { \time 6/8 s8 s4\< s4\> s8\! | s4. \< s4. | s4. s4 s8\! | } \new Staff { \time 6/8 \clef bass fis,4( g,4 gis,4) | a,4( a4 d4) | g,4( c4 a,4) | } >> >> \layout { \context { \name "Dynamics" \type "Engraver_group_engraver" \consists "Axis_group_engraver" \consists "Skip_event_swallow_translator" \consists "Dynamic_engraver" \override Hairpin #'extra-offset = #'(0 . 1.5) } \context { \PianoStaff \accepts "Dynamics" \override VerticalAlignment #'forced-distance = #5 } } } \markup {\wordwrap {The end effect is to render the hairpins such that they frequently look like y have nothing to do with the rhythmic timevalues in the piano. Maybe we should reconsider this nment principle?}} %%%%%%%%%%% hairpin-lyrics interaction %%%%%%% _______________________________________________ bug-lilypond mailing list bug-lilypond@gnu.org http://lists.gnu.org/mailman/listinfo/bug-lilypond
-- ============================================= Mats Bengtsson Signal Processing Signals, Sensors and Systems Royal Institute of Technology SE-100 44 STOCKHOLM Sweden Phone: (+46) 8 790 8463 Fax: (+46) 8 790 7260 Email: [EMAIL PROTECTED] WWW: http://www.s3.kth.se/~mabe ============================================= _______________________________________________ bug-lilypond mailing list bug-lilypond@gnu.org http://lists.gnu.org/mailman/listinfo/bug-lilypond