Jonathan Wilkes wrote Monday, August 24, 2009 6:24 AM


Would probably help if I showed the file :). I'm guessing the problem is it's not allowed to use a variable inside of the braces after the \with
command, but I don't understand why.

Correct.  A \with clause may contain only

a) property operations

That's changing context or grob properties

b) context definitions

That's things like \consists, \accepts etc.

This was one of my questions as a newbie
three years ago next week!  The answer came
from Nicolaus Sceaux, see
http://lists.gnu.org/archive/html/lilypond-user/2006-08/msg00560.html

A music function has to return some music,
so you need to pass the ossia music to the
music function too, and include the \new Staff
as well, like this:

ossia = #(define-music-function (parser location staffName music)
 (string? ly:music?)
#{
 \new Staff \with {
   alignAboveContext = #$staffName
   \remove "Time_signature_engraver"
   fontSize = #-3
   \override StaffSymbol #'staff-space = #(magstep -3)
   \override StaffSymbol #'thickness = #(magstep -3)
 }
 $music
#})

Trevor

-Jonathan

\version "2.12.2"

ossia = #(define-music-function (parser location staffName)
 (string?)
#{
alignAboveContext = #$staffName
\remove "Time_signature_engraver"
fontSize = #-3
\override StaffSymbol #'staff-space = #(magstep -3)
\override StaffSymbol #'thickness = #(magstep -3)
#})

myMelody = \new Staff = main {
\relative c' {
c8 d e f g a b c |
<<
{
d1
}
{
\new Staff \with { \ossia #'main } {
\relative c' {
\clef bass
c4 d e f
}
}
}
>>
}
}

\score {
\myMelody
\layout {
 }
}





_______________________________________________
lilypond-user mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-user




_______________________________________________
lilypond-user mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to