lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

centered textspanner dynamics


From: Helge Kruse
Subject: centered textspanner dynamics
Date: Sun, 06 Sep 2009 18:27:23 +0200
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

Hello,

I am using centered dynamics for some scores (id=357). Now I need to use a text for a dynamic change spread over several measures. I found an appropriate snippet in LSR (id=456).

But I failed to combine both snippets. The hairpin is not replaced by the text. What's going wrong here?

I attach a minimal example that can be compiled directly.


Regards,
Helge
#(ly:set-option 'delete-intermediate-files #t)
#(ly:set-option 'point-and-click #f)

\version "2.13.0"

voiceOne = \relative c' {
        \clef treble    \time 3/4
        g4 g g | g g g | g g g
}

voiceTwo = \relative c {
        \clef bass      \time 3/4
        f4 f f | f f f | f f f
}

dynamicsOne = {
  \set Voice.crescendoText = \markup { \italic { poco a poco di - mi - nu - en 
- do - - - - } }
  \set Voice.crescendoSpanner = #'text
  \override DynamicTextSpanner #'style = #'dotted-line
                s2.\> s2. s2 s8\!
}

\book {
        \score {
                <<
                \new StaffGroup
                        <<
                        \new Staff \voiceOne
                        \new Dynamics = "Dynamics" \dynamicsOne
                        \new Staff \voiceTwo
                        >>
                >>
                \layout {
                        % define dynamics context like 
http://lsr.dsi.unimi.it/LSR/Item?id=357
                        % to re-use it, put it in file to #include
                        \include "dynamicsContext.ly"
                        \context {
                                \StaffGroup
                                \accepts Dynamics
                        }
                }
        }

        %% LSI snippet: http://lsr.dsi.unimi.it/LSR/Item?id=456 
        \score {
                \relative c'' {
                        \set crescendoText = \markup { \italic { cresc. poco } }
                        \set crescendoSpanner = #'text
                        \override DynamicTextSpanner #'style = #'dotted-line
                        a2\< a
                        a2 a
                        a2 a
                        a2 a\mf
                }               
        }
}

% define Dynamics context

%dynamicsContext = 
\context 
{
  \type "Engraver_group"
  \name Dynamics
  \alias Voice
  \consists "Output_property_engraver"
  \consists "Piano_pedal_engraver"
  \consists "Script_engraver"
  \consists "New_dynamic_engraver"
  \consists "Dynamic_align_engraver"
  \consists "Text_engraver"
  \consists "Skip_event_swallow_translator"
  \consists "Axis_group_engraver"

  pedalSustainStrings = #'("Ped." "*Ped." "*")
  pedalUnaCordaStrings = #'("una corda" "" "tre corde")
  \override DynamicLineSpanner #'Y-offset = #0
  \override TextScript #'font-size = #2
  \override TextScript #'font-shape = #'italic
  \override VerticalAxisGroup #'minimum-Y-extent = #'(-1 . 1)
}

reply via email to

[Prev in Thread] Current Thread [Next in Thread]