lilypond-user
[Top][All Lists]
Advanced

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

Re: Trying to do a template


From: Mats Bengtsson
Subject: Re: Trying to do a template
Date: Mon, 28 Nov 2005 17:02:42 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050511

I guess that you don't want any new type of contexts, you just want
to redefine the existing ChordNames context type. Then, simply do

\layout {
       \context
       {
               \ChordNames
               \override BarLine #'bar-size = #4
               voltaOnThisStaff = ##t
               \consists Bar_engraver
               \consists "Volta_engraver"
               \consists "Percent_repeat_engraver"
       }
}


\chordmode{ \repeat volta 2  {
\partial 8 s8 | f2:maj f:7 \repeat "percent" 2 {bes1:7}
c:maj c:maj c:maj c:maj c:maj c:maj c:maj
} \alternative {
es e }
}


If you want to pursue your idea to define a new context type and
include it in the context hierarchy, then you would need to do
something like the following. Note that you also have to explicitly
instantiate that context in the score:

\layout {
       \context
       {
               \ChordNames
               \name MyChordNames
               \override BarLine #'bar-size = #4
               voltaOnThisStaff = ##t
               \consists Bar_engraver
               \consists "Volta_engraver"
               \consists "Percent_repeat_engraver"
               \alias ChordNames
       }
       \context
       {
               \Score
               \accepts "MyChordNames"
       }

}


\score{
 \new MyChordNames \chordmode{ \repeat volta 2  {
\partial 8 s8 | f2:maj f:7 \repeat "percent" 2 {bes1:7}
c:maj c:maj c:maj c:maj c:maj c:maj c:maj
} \alternative {
es e }
}
}


One of the best ways to learn these things is actually to look at the
definitions of the default context types, see the file ly/engraver-init.ly.

   /Mats

joeyc (sent by Nabble.com) wrote:

Version 2.6.3

I tried section 9.1.5, and I have tried about 30 variations of something similar to what they have in that section with no luck...

Here is one unsuccessful try... it must be that I am really missing some main concept of Lilypond?


\layout {
        \context
        {
                \name MyChordNames
                \override BarLine #'bar-size = #4
                voltaOnThisStaff = ##t
                \consists Bar_engraver
                \consists "Volta_engraver"
                \consists "Percent_repeat_engraver"
                \alias ChordNames
        }
        \context
        {
                \Staff
                \accepts "MyChordNames"
        }

}


\chordmode{ \repeat volta 2  {
\partial 8 s8 | f2:maj f:7 \repeat "percent" 2 {bes1:7}
c:maj c:maj c:maj c:maj c:maj c:maj c:maj
} \alternative {
es e }
}
------------------------------------------------------------------------
Sent from the Gnu - Lilypond - User <http://www.nabble.com/Trying-to-do-a-template-t615301.html#a1669198> forum at Nabble.com.

------------------------------------------------------------------------

_______________________________________________
lilypond-user mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/lilypond-user

--
=============================================
        Mats Bengtsson
        Signal Processing
        Signals, Sensors and Systems
        Royal Institute of Technology
        SE-100 44  STOCKHOLM
        Sweden
        Phone: (+46) 8 790 8463                         
       Fax:   (+46) 8 790 7260
        Email: address@hidden
        WWW: http://www.s3.kth.se/~mabe
=============================================





reply via email to

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