2003-08-28 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ * lily/translator-scheme.cc (LY_DEFINE): add !
+
* input/*/*.ly (vmus): use \new everywhere.
* lily/my-lily-lexer.cc: add \accacciatura and \appoggiatura
@itemize
@item
-Two new commands for grace note have been added, @code{\accacciatura}
-and @code{\appogiatura}. Both reflect the traditional meanings of
-accacciatura and ap
+Two new commands for grace notes have been added, @code{\accacciatura}
+and @code{\appoggiatura},
+@example
+ \appoggiatura f8 e4
+ \accacciatura g8 f4
+@end example
+Both reflect the traditional meanings of accacciatura and appogiatura,
+and both insert insert a slur from the first grace note to the main
+note.
+
+@item
+Layout options for grace notes are now stored in a context property,
+and may now be set separately from musical content.
@item
The @code{\new} command will create a context with a unique
(lambda (elt) (equal? text (ly:get-grob-property elt 'text))))
-treble = \context Voice=treble \notes\relative c''{
+treble = \new Voice \notes\relative c''{
\key a \major
r2
| %2
\bar "||"
}
-trebleTwo = \context Voice=trebleTwo \notes\relative c''{
+trebleTwo = \new Voice \notes\relative c''{
\stemDown
\slurDown
% \fingerDown
<<a cis,>>)]
}
-bass = \context Voice=bass \notes\relative c{
+bass = \new Voice \notes\relative c{
\partial 2
\key a \major
a)]
}
-bassTwo = \context Voice=bassTwo \notes\relative c{
+bassTwo = \new Voice \notes\relative c{
\skip 2
\skip 1*2
\skip 2
cis'4( bis)
}
-middleDynamics = \context Dynamics=middle \notes{
+middleDynamics = \notes{
\property Dynamics.TextScript \set #'padding = #-1 %tweak
s2
s1*2
s8\!
}
-lowerDynamics = \context Dynamics=lower \notes{
+lowerDynamics = \notes{
s2
| %2
s2\sustainDown s8. s16\sustainUp s4
\treble
\trebleTwo
>
- \context Dynamics=middle <
+ \new Dynamics <
\middleDynamics
>
\context Staff=bass <
\bass
\bassTwo
>
- \context Dynamics=lower <
+ \new Dynamics <
\lowerDynamics
>
>
"
}
-#(add-to-grace-init "Voice" 'Stem 'length 6)
-#(add-to-grace-init "Voice" 'Stem 'stroke-style '())
-
% doen't work??
%#(add-to-grace-init "Voice" 'Stem 'font-relative-size )
%
\score {
\notes { \time 6/8 \partial 4
+
+ #(add-grace-property "Voice" 'Stem 'length 6)
+ #(add-grace-property "Voice" 'Stem 'stroke-style '())
+
+
\tieUp
\slurUp
f4 |
\score {
\notes \relative c' \context ChoirStaff <
- \newcontext Staff { c1 c1 c1}
+ \new Staff { c1 c1 c1}
\context Lyrics \lyrics <
{ bla1 die bla }
{ foo bar foo }
{ foo bar foo }
>
- \newcontext Staff { c1 c1 c1}
+ \new Staff { c1 c1 c1}
>
\score {
\notes <
\context ChordNames { \scm }
- \newcontext ChordNames {
+ \new ChordNames {
\property ChordNames.instrument = #"german"
\germanChords \scm }
- \newcontext ChordNames {
+ \new ChordNames {
\property ChordNames.instrument =#"semi-german"
\semiGermanChords \scm }
\context Voice { \scm } >
\property ChordNames.instrument = #"Ignatzek (default)"
\property ChordNames.instr = #"Def"
\chs }
- \newcontext ChordNames {
+ \new ChordNames {
\property ChordNames.instrument = #"Alternative"
\property ChordNames.instr = #"Alt"
\jazzAltProperties
% making this file take up to 4 pages.
%{
- \newcontext ChordNames {
+ \new ChordNames {
\banterProperties
\chs
}
R1
\property Voice.MultiMeasureRest \revert #'staff-position
}
- \newcontext Voice { s2
+ \new Voice { s2
\clef tenor
%% this should probably be put into an identifier.
\score {
\notes {
- \newcontext Staff \addlyrics \notes \transpose c c' {
+ \new Staff \addlyrics \notes \transpose c c' {
\property Score.timing = ##f
\property Score.barAlways = ##t
\property Voice.TextScript \set #'padding = #3
\caesura
g4( a) g e( f) e
}
- \newcontext Lyrics \lyrics {
+ \new Lyrics \lyrics {
Blah blub, blah blam.
Blah blub, blah blam.
Blah blub, blah blam.
}
LY_DEFINE(ly_set_context_property,
- "ly:set-context-property", 3, 0, 0,
+ "ly:set-context-property!", 3, 0, 0,
(SCM context, SCM name, SCM val),
"set value of property @var{name} in context @var{context} to @var{val}.")
{
(let*
((props (ly:get-context-property context 'graceSettings)))
- (vector-map execute-1 props)))
+ (if (vector? props)
+ (vector-map execute-1 props))))
(define-public (set-stop-grace-properties context)
(define (execute-1 x)
(let*
((props (ly:get-context-property context 'graceSettings)))
-
- (vector-reverse-map execute-1 props)))
+ (if (vector? props)
+ (vector-reverse-map execute-1 props))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; switch it on here, so parsing and init isn't checked (too slow!)
conversions.append (((1,9,1), conv, """Remove - before articulation"""))
if 1:
def conv (str):
+ str = re.sub ('ly:set-context-property',
+ 'ly:set-context-property!', str)
str = re.sub ('\\\\newcontext', '\\\\new', str)
str = re.sub ('\\\\grace[\t\n ]*([^{ ]+)',
r'\\grace { \1 }', str)