From: Han-Wen Nienhuys Date: Wed, 27 Aug 2003 23:56:26 +0000 (+0000) Subject: * lily/translator-scheme.cc (LY_DEFINE): add ! X-Git-Tag: release/1.9.2~5 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=3b122b1ee17867bb76e9def476495383220ace59;p=lilypond.git * lily/translator-scheme.cc (LY_DEFINE): add ! * scm/music-functions.scm (set-stop-grace-properties) (set-start-grace-properties, add-grace-property): new functions for modular grace tweak control. --- diff --git a/ChangeLog b/ChangeLog index c670ca2abb..1274a9338f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2003-08-28 Han-Wen Nienhuys + * lily/translator-scheme.cc (LY_DEFINE): add ! + * input/*/*.ly (vmus): use \new everywhere. * lily/my-lily-lexer.cc: add \accacciatura and \appoggiatura diff --git a/Documentation/topdocs/NEWS.texi b/Documentation/topdocs/NEWS.texi index 60a6fa8bc4..0afa422dfb 100644 --- a/Documentation/topdocs/NEWS.texi +++ b/Documentation/topdocs/NEWS.texi @@ -10,11 +10,21 @@ @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 diff --git a/input/les-nereides.ly b/input/les-nereides.ly index f47077e109..a9ba1ba5bc 100644 --- a/input/les-nereides.ly +++ b/input/les-nereides.ly @@ -32,7 +32,7 @@ possibly more impressive to render without tweaks? (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 @@ -96,7 +96,7 @@ treble = \context Voice=treble \notes\relative c''{ \bar "||" } -trebleTwo = \context Voice=trebleTwo \notes\relative c''{ +trebleTwo = \new Voice \notes\relative c''{ \stemDown \slurDown % \fingerDown @@ -121,7 +121,7 @@ trebleTwo = \context Voice=trebleTwo \notes\relative c''{ <>)] } -bass = \context Voice=bass \notes\relative c{ +bass = \new Voice \notes\relative c{ \partial 2 \key a \major @@ -211,7 +211,7 @@ bass = \context Voice=bass \notes\relative c{ a)] } -bassTwo = \context Voice=bassTwo \notes\relative c{ +bassTwo = \new Voice \notes\relative c{ \skip 2 \skip 1*2 \skip 2 @@ -222,7 +222,7 @@ bassTwo = \context Voice=bassTwo \notes\relative c{ cis'4( bis) } -middleDynamics = \context Dynamics=middle \notes{ +middleDynamics = \notes{ \property Dynamics.TextScript \set #'padding = #-1 %tweak s2 s1*2 @@ -248,7 +248,7 @@ middleDynamics = \context Dynamics=middle \notes{ s8\! } -lowerDynamics = \context Dynamics=lower \notes{ +lowerDynamics = \notes{ s2 | %2 s2\sustainDown s8. s16\sustainUp s4 @@ -305,7 +305,7 @@ lowerDynamics = \context Dynamics=lower \notes{ \treble \trebleTwo > - \context Dynamics=middle < + \new Dynamics < \middleDynamics > \context Staff=bass < @@ -313,7 +313,7 @@ lowerDynamics = \context Dynamics=lower \notes{ \bass \bassTwo > - \context Dynamics=lower < + \new Dynamics < \lowerDynamics > > diff --git a/input/test/bagpipe.ly b/input/test/bagpipe.ly index 98297007ec..ad8e400213 100644 --- a/input/test/bagpipe.ly +++ b/input/test/bagpipe.ly @@ -6,9 +6,6 @@ Here's an example of bagpipe music. " } -#(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 ) @@ -51,6 +48,11 @@ gcdg = \notes{ \grace { g'32[ c d]}} % \score { \notes { \time 6/8 \partial 4 + + #(add-grace-property "Voice" 'Stem 'length 6) + #(add-grace-property "Voice" 'Stem 'stroke-style '()) + + \tieUp \slurUp f4 | diff --git a/input/test/bar-lines-lyric-only.ly b/input/test/bar-lines-lyric-only.ly index d1de8adf3b..7709d8b618 100644 --- a/input/test/bar-lines-lyric-only.ly +++ b/input/test/bar-lines-lyric-only.ly @@ -6,13 +6,13 @@ You can move around @code{Bar_engraver} and \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} > diff --git a/input/test/chord-names-german.ly b/input/test/chord-names-german.ly index 9dac83696a..ec02957f57 100644 --- a/input/test/chord-names-german.ly +++ b/input/test/chord-names-german.ly @@ -22,10 +22,10 @@ scm = \chords { \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 } > diff --git a/input/test/chord-names-jazz.ly b/input/test/chord-names-jazz.ly index e8c1060ad1..3923f309d4 100644 --- a/input/test/chord-names-jazz.ly +++ b/input/test/chord-names-jazz.ly @@ -116,7 +116,7 @@ banterProperties = \sequential { \property ChordNames.instrument = #"Ignatzek (default)" \property ChordNames.instr = #"Def" \chs } - \newcontext ChordNames { + \new ChordNames { \property ChordNames.instrument = #"Alternative" \property ChordNames.instr = #"Alt" \jazzAltProperties @@ -127,7 +127,7 @@ banterProperties = \sequential { % making this file take up to 4 pages. %{ - \newcontext ChordNames { + \new ChordNames { \banterProperties \chs } diff --git a/input/test/cue-notes.ly b/input/test/cue-notes.ly index 9bb9909670..e8b92a7cff 100644 --- a/input/test/cue-notes.ly +++ b/input/test/cue-notes.ly @@ -19,7 +19,7 @@ Cue notes should be set in smaller type. " R1 \property Voice.MultiMeasureRest \revert #'staff-position } - \newcontext Voice { s2 + \new Voice { s2 \clef tenor %% this should probably be put into an identifier. diff --git a/input/test/divisiones.ly b/input/test/divisiones.ly index 1e05635d1f..6408576838 100644 --- a/input/test/divisiones.ly +++ b/input/test/divisiones.ly @@ -13,7 +13,7 @@ Choices are @code{divisioMinima}, @code{divisioMaior} \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 @@ -40,7 +40,7 @@ Choices are @code{divisioMinima}, @code{divisioMaior} \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. diff --git a/lily/translator-scheme.cc b/lily/translator-scheme.cc index 2a51a7438f..ed42abdb18 100644 --- a/lily/translator-scheme.cc +++ b/lily/translator-scheme.cc @@ -28,7 +28,7 @@ LY_DEFINE(ly_get_context_property, } 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}.") { diff --git a/scm/music-functions.scm b/scm/music-functions.scm index ba31d6dea1..b7c6730469 100644 --- a/scm/music-functions.scm +++ b/scm/music-functions.scm @@ -626,7 +626,8 @@ Rest can contain a list of beat groupings (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) @@ -638,8 +639,8 @@ Rest can contain a list of beat groupings (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!) diff --git a/scripts/convert-ly.py b/scripts/convert-ly.py index dd6c5aed44..f138c70a47 100644 --- a/scripts/convert-ly.py +++ b/scripts/convert-ly.py @@ -1424,6 +1424,8 @@ if 1: 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)