[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Scheme function for ossia
From: |
Trevor Daniels |
Subject: |
Re: Scheme function for ossia |
Date: |
Mon, 24 Aug 2009 09:42:45 +0100 |
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
address@hidden
http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Scheme function for ossia, Kieren MacMillan, 2009/08/25