[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lilypond-user
Subject:    Re: how to di it in lilypond
From:       Jonathan Kulp <jonlancekulp () gmail ! com>
Date:       2009-06-30 17:24:54
Message-ID: 4A4A4A66.2050807 () gmail ! com
[Download RAW message or body]

Francisco Vila wrote:
> 2009/6/30 Stefan Thomas <kontrapunktstefan@googlemail.com>:
>> Dear community,
>> I'm trying to do something similar to what You see in the attached pdf-file.
>> It has been created, years ago, with sibelius. Especially I would be
>> interested in getting the TimeSignature between the two piano staves. How
>> can I get it?
> 
> I used to do this using an invisible extra staff only to hold the time
> signature. This snippet does this:
> 
> http://lsr.dsi.unimi.it/LSR/Item?id=272
> 
> Not exactly the same but possibly adapteable.
> 

I tweaked the piano-centered-dynamics template a bit to use the 
Dynamics context for the centered time signature, removing the 
time signature engravers from the staves.  It puts the time 
signature in the right place, and it's easy to make it big, but it 
jacks up the spacing.  I don't have time to figure that part out 
right now. :)  Snippet attached.

Jon
-- 
Jonathan Kulp
http://www.jonathankulp.com

["centered-time.ly" (text/x-lilypond)]

\version "2.12.2"

global = {
  \key c \major
}

upper = \relative c'' {
  \clef treble
  a4 b c d
}

lower = \relative c {
  \clef bass
  a2 c
}

dynamics = {
  \time 3/4
  \override TimeSignature #'font-size = #6
  s2 s4 s
}

pedal = {
  s2\sustainOn s\sustainOff
}

\score {
  \new PianoStaff = "PianoStaff_pf" <<
    \new Staff = "Staff_pfUpper" \with {
      \remove "Time_signature_engraver"
    }
    << 
      \global 
      \upper 
    >>
    \new Dynamics = "Dynamics_pf" \dynamics
    \new Staff = "Staff_pfLower" \with {
      \remove "Time_signature_engraver"
    }
    << 
      \global 
      \lower 
    >>
    %\new Dynamics = "pedal" \pedal
  >>

  \layout {
    % define Dynamics context
    \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 "Time_signature_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)
    }
    % modify PianoStaff context to accept Dynamics context
    \context {
      \PianoStaff
      \accepts Dynamics
    }
  }
}

\score {
  \new PianoStaff = "PianoStaff_pf" <<
    \new Staff = "Staff_pfUpper" << \global \upper \dynamics \pedal >>
    \new Staff = "Staff_pfLower" << \global \lower \dynamics \pedal >>
  >>
  \midi { }
}

["centered-time.png" (image/png)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic