lilypond-user
[Top][All Lists]
Advanced

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

conditional branch within scheme


From: Stefan Thomas
Subject: conditional branch within scheme
Date: Sun, 22 Apr 2012 20:27:23 +0200

Dear community,
I've written some scheme-code for making it easier to create ossia-staffs.
The syntax for the code I've created is \ossiastaff "staffname" { music}
It works fine but now it works only for ossia-staffs above. I would prefer a syntax like
\ossiastaff "staffname" "above" (or below) { music}
Here is my code:


\version "2.14.2"
ossiastaff = #(define-music-function (parser location x y) ( string? ly:music?  )
  #{
   \new Staff = "ossia" \with {
     alignAboveContext = $x
      \override Clef #'stencil = ##f
      \override KeySignature #'stencil = ##f
      \override TimeSignature #'stencil = ##f
      fontSize = #-3
      \override StaffSymbol #'staff-space = #(magstep -3)
      \override StaffSymbol #'thickness = #(magstep -3)
    } { \override PianoStaff.SpanBar #'glyph-name = #":" $y } 
#})

mainthing = \relative c'' { \time 3/4 \key g \major
d4 g,8 a b c d4 g, g
<<    {  e'4  c8 \mordent d e fis g4 g, g   } { \ossiastaff "mainstaff" { 
     
      s4 c32[ b c16.] s4 s4 }  } >>
 
}

\score {
  \new PianoStaff <<
  \new Staff="mainstaff" \mainthing
 
>>
}




reply via email to

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