lilypond-user
[Top][All Lists]
Advanced

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

Re: Creating two-staved ossia


From: Pierre Perol-Schneider
Subject: Re: Creating two-staved ossia
Date: Thu, 1 Aug 2019 08:11:19 +0200

Hello Mr Ho,
Please don't forget to reply to the list.
Here's an attempt with v2.16.
Please note that I don't think this will help since v2.16 is pretty old and I'm almost sure no one one the list is using it anymore.
The best thing you have to do is to update your LP version (to 2.19.83 !!)
If you've found your LP version with the Ubuntu package, first uninstall LP. See how here: http://lilypond.org/unix.html
Otherwise, downloads are here: http://lilypond.org/download.html
Anyway, here's the attempt:

\version "2.16.0"

% See => http://lilypond.1069038.n5.nabble.com/magnifyStaff-and-key-signature-padding-td222389.html
staffSize = #(define-music-function (parser location new-size) (number?)
  #{
    \set fontSize = #new-size
    \override StaffSymbol #'staff-space = #(magstep new-size)
    \override StaffSymbol #'thickness = #(magstep new-size)
    \override KeySignature #'padding = #(* 2/3 (- 1 (magstep new-size)))
  #})

\header{
  title = ""
  subtitle = ""
}

upper = \relative c'' { % <= use \transpose c c'' for absolute mode
  \clef treble
  \key d \minor
  \time 4/4
  c1 c \break d d \break g g
}

lower =  \relative c {
  \clef bass
  \key d \minor
  \time 4/4
  a a bes bes c c
}

ossia = \new PianoStaff <<
    \new Staff \with {
      \RemoveEmptyStaves
      \override BarLine #'allow-span-bar = ##f
      \staffSize #-3
    } { \key d\minor s1*2 e''1 e'' }
    \new Staff \with {
      \RemoveEmptyStaves
       \staffSize #-3
    } { \clef F \key d\minor s1*2 f1 f }
>>

\score {
  \new StaffGroup \with {
    \override SpanBar #'glyph-name = "!" % <= won't work with v2.16
    \remove "System_start_delimiter_engraver"
  } <<
    \ossia
    \new PianoStaff \with { \override BarLine #'allow-span-bar = ##f } <<
      \new Staff = "upper" \upper
      \new Staff = "lower" \lower    
    >>
  >>
  \layout {
    \context {
      \PianoStaff
      \consists #Span_stem_engraver
    }
    \context {
      \Staff
      \override VerticalAxisGroup #'remove-first = ##t
    }
  }
  \midi {}
}

HTH, cheers,
Pierre

Le mer. 31 juil. 2019 à 22:52, Nikolai Ho <address@hidden> a écrit :

Hello Mr. Schneider,

I just cannot figure out how to implement the code you gave into my code because the format seems quite different and I am very new to music engraving.

This is the structure of my code and I want to insert an ossia like the one you showed in your example above a certain set of bars in the middle of the piece. Can you please help fuse the code you provided with mine because I am quite clueless now! Thank you so much for your time!

 

 

\version "2.16.0"

\header{

  title = ""

  subtitle = "       "

}

 

upper =

  \relative c'' {

  \clef treble

  \key d \minor

  \time 4/4

…..

}

 

lower =

  \relative c {

  \clef bass

  \key d \minor

  \time 4/4

   ….. 

}

 

\score {

  \new PianoStaff <<

    \new Staff = "upper" \upper

    \new Staff = "lower" \lower    

  >>

 

  \layout {

  \context {

    \PianoStaff

    \consists #Span_stem_engraver

  }}

  \midi { }

}

 


reply via email to

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