From 805c2b39f4a6857a8481ebfcb66b9cf3298a1c92 Mon Sep 17 00:00:00 2001 From: hanwen Date: Tue, 16 Jul 2002 23:49:16 +0000 Subject: [PATCH] * lily/music.cc (LY_DEFINE): change ly-set-mus-property to ly-set-mus-property! * lily/grob.cc (LY_DEFINE): change ly-set-grob-property to ly-set-grob-property! --- ChangeLog | 5 +++ Documentation/user/refman.itely | 5 +-- lily/grob-scheme.cc | 2 +- lily/music.cc | 2 +- scm/drums.scm | 32 +++++++++---------- scm/music-functions.scm | 54 ++++++++++++++++----------------- scripts/convert-ly.py | 8 +++++ 7 files changed, 61 insertions(+), 47 deletions(-) diff --git a/ChangeLog b/ChangeLog index 581e57e0aa..1dfb760e50 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2002-07-17 Han-Wen + * lily/music.cc (LY_DEFINE): change ly-set-mus-property to + ly-set-mus-property! + + * lily/grob.cc (LY_DEFINE): change ly-set-grob-property to ly-set-grob-property! + * lily/parser.yy (Repeated_music): shift duration log for tremolo repeats, instead of klutzing around. diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index e39eccc2c1..4f69df2c8f 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -2125,11 +2125,12 @@ style. @end lilypond Tremolo beams are @internalsref{Beam} grobs. Single stem tremolos are -@internalsref{StemTremolo}. +@internalsref{StemTremolo}. The single stem tremolo @emph{must} be +entered without @code{@{} and @code{@}}. @refbugs -Tremolo beams confuse the spacing engine. +Only powers of two and undotted notes are supported repeat counts. @node Tremolo subdivisions @subsection Tremolo subdivisions diff --git a/lily/grob-scheme.cc b/lily/grob-scheme.cc index 39d89d2914..a7df394d32 100644 --- a/lily/grob-scheme.cc +++ b/lily/grob-scheme.cc @@ -4,7 +4,7 @@ #include "item.hh" #include "paper-def.hh" -LY_DEFINE(ly_set_grob_property,"ly-set-grob-property", 3, 0, 0, +LY_DEFINE(ly_set_grob_property,"ly-set-grob-property!", 3, 0, 0, (SCM grob, SCM sym, SCM val), "Set @var{sym} in grob @var{grob} to value @var{val}") { diff --git a/lily/music.cc b/lily/music.cc index 7b9e88a769..22f16ff80a 100644 --- a/lily/music.cc +++ b/lily/music.cc @@ -227,7 +227,7 @@ LY_DEFINE(ly_get_mus_property, } LY_DEFINE(ly_set_mus_property, - "ly-set-mus-property", 3, 0, 0, + "ly-set-mus-property!", 3, 0, 0, (SCM mus, SCM sym, SCM val), "Set property @var{sym} in music expression @var{mus} to @var{val}.") { diff --git a/scm/drums.scm b/scm/drums.scm index 517cb979bb..f6187f3705 100644 --- a/scm/drums.scm +++ b/scm/drums.scm @@ -166,7 +166,7 @@ (define (make-articulation-script x) (let* ( (m (ly-make-music "Articulation_req")) ) - (ly-set-mus-property m 'articulation-type x) + (ly-set-mus-property! m 'articulation-type x) m ) ) @@ -175,7 +175,7 @@ (define (add-articulation-script m x) (if x (if (and x (equal? (ly-music-name m) "Request_chord")) - (ly-set-mus-property m 'elements + (ly-set-mus-property! m 'elements (cons (make-articulation-script x) (ly-get-mus-property m 'elements)) ) (let* ( (es (ly-get-mus-property m 'elements)) @@ -192,10 +192,10 @@ (define (make-head-type-elem t) (let* ( (m (ly-make-music "Music")) ) - (ly-set-mus-property m 'iterator-ctor Push_property_iterator::constructor) - (ly-set-mus-property m 'symbol 'NoteHead) - (ly-set-mus-property m 'grob-property 'style) - (ly-set-mus-property m 'grob-value t) + (ly-set-mus-property! m 'iterator-ctor Push_property_iterator::constructor) + (ly-set-mus-property! m 'symbol 'NoteHead) + (ly-set-mus-property! m 'grob-property 'style) + (ly-set-mus-property! m 'grob-value t) m ) ) @@ -204,17 +204,17 @@ (let* ( (m (ly-make-music "Context_specced_music")) (e (make-head-type-elem t)) ) - (ly-set-mus-property m 'element e) - (ly-set-mus-property m 'context-type "Thread") + (ly-set-mus-property! m 'element e) + (ly-set-mus-property! m 'context-type "Thread") m ) ) (define (make-thread-context thread-name element) (let* ( (m (ly-make-music "Context_specced_music"))) - (ly-set-mus-property m 'element element) - (ly-set-mus-property m 'context-type "Thread") - (ly-set-mus-property m 'context-id (symbol->string thread-name)) + (ly-set-mus-property! m 'element element) + (ly-set-mus-property! m 'context-type "Thread") + (ly-set-mus-property! m 'context-id (symbol->string thread-name)) m ) ) @@ -237,7 +237,7 @@ (seq (make-sequential-music (list ht req-ch))) ) (add-articulation-script req-ch script) - (ly-set-mus-property fe 'pitch pitch) + (ly-set-mus-property! fe 'pitch pitch) (set! req-ch (make-thread-context style seq)) req-ch ) @@ -288,22 +288,22 @@ (alts (ly-get-mus-property music 'alternatives))) (if (pair? es) - (ly-set-mus-property music 'elements (map (drums->paper kit) es) ) + (ly-set-mus-property! music 'elements (map (drums->paper kit) es) ) ) (if (music? alts) - (ly-set-mus-property + (ly-set-mus-property! music 'alternatives ((drums->paper kit) alts))) (if (music? body) - (ly-set-mus-property + (ly-set-mus-property! music 'body ((drums->paper kit) body))) (if (music? e) (begin - (ly-set-mus-property + (ly-set-mus-property! music 'element ((drums->paper kit) e)) ) diff --git a/scm/music-functions.scm b/scm/music-functions.scm index 7ccd23c208..d4534a7b41 100644 --- a/scm/music-functions.scm +++ b/scm/music-functions.scm @@ -29,16 +29,16 @@ encountered. This scales the music up by a factor 2^k." (cdr cp))) ) - (ly-set-mus-property music 'duration nd) + (ly-set-mus-property! music 'duration nd) )) (if (pair? es) - (ly-set-mus-property + (ly-set-mus-property! music 'elements (map f es))) (if (music? e) - (ly-set-mus-property + (ly-set-mus-property! music 'element (f e))) @@ -59,20 +59,20 @@ written by Rune Zedeler. " (if (equal? (ly-get-mus-property 'type music) 'tremolo) (shift-duration-log music (- (intlog2 (ly-get-mus-property 'repeat-count music)))) ) - (ly-set-mus-property + (ly-set-mus-property! music 'length Repeated_music::unfolded_music_length) - (ly-set-mus-property + (ly-set-mus-property! music 'start-moment-function Repeated_music::first_start) - (ly-set-mus-property + (ly-set-mus-property! music 'iterator-ctor Unfolded_repeat_iterator::constructor))) (if (pair? es) - (ly-set-mus-property + (ly-set-mus-property! music 'elements (map unfold-repeats es))) (if (music? e) - (ly-set-mus-property + (ly-set-mus-property! music 'element (unfold-repeats e))) @@ -99,16 +99,16 @@ Fingering_engraver." ) (if pitch - (map (lambda (x) (ly-set-mus-property x 'pitch pitch)) (find-scripts es)) + (map (lambda (x) (ly-set-mus-property! x 'pitch pitch)) (find-scripts es)) ) (if (pair? es) - (ly-set-mus-property + (ly-set-mus-property! music 'elements (map pitchify-scripts es))) (if (music? e) - (ly-set-mus-property + (ly-set-mus-property! music 'element (pitchify-scripts e))) @@ -126,11 +126,11 @@ this is not an override " (let* ((m (ly-make-music "Music"))) - (ly-set-mus-property m 'iterator-ctor Push_property_iterator::constructor) - (ly-set-mus-property m 'symbol grob) - (ly-set-mus-property m 'grob-property gprop) - (ly-set-mus-property m 'grob-value val) - (ly-set-mus-property m 'pop-first #t) + (ly-set-mus-property! m 'iterator-ctor Push_property_iterator::constructor) + (ly-set-mus-property! m 'symbol grob) + (ly-set-mus-property! m 'grob-property gprop) + (ly-set-mus-property! m 'grob-value val) + (ly-set-mus-property! m 'pop-first #t) m @@ -139,9 +139,9 @@ this is not an override (define (make-grob-property-revert grob gprop) "Revert the grob property GPROP for GROB." (let* ((m (ly-make-music "Music"))) - (ly-set-mus-property m 'iterator-ctor Pop_property_iterator::constructor) - (ly-set-mus-property m 'symbol grob) - (ly-set-mus-property m 'grob-property gprop) + (ly-set-mus-property! m 'iterator-ctor Pop_property_iterator::constructor) + (ly-set-mus-property! m 'symbol grob) + (ly-set-mus-property! m 'grob-property gprop) m @@ -172,22 +172,22 @@ this is not an override "Add \context CONTEXT = foo to M. " (let* ((cm (ly-make-music "Context_specced_music"))) - (ly-set-mus-property cm 'element m) - (ly-set-mus-property cm 'context-type context) + (ly-set-mus-property! cm 'element m) + (ly-set-mus-property! cm 'context-type context) (if (and (pair? rest) (string? (car rest))) - (ly-set-mus-property cm 'context-id (car rest)) + (ly-set-mus-property! cm 'context-id (car rest)) ) cm )) (define (make-sequential-music elts) (let* ((m (ly-make-music "Sequential_music"))) - (ly-set-mus-property m 'elements elts) + (ly-set-mus-property! m 'elements elts) m )) (define (make-simultaneous-music elts) (let* ((m (ly-make-music "Simultaneous_music"))) - (ly-set-mus-property m 'elements elts) + (ly-set-mus-property! m 'elements elts) m )) (define (music-separator? m) @@ -247,7 +247,7 @@ this is not an override (let* ((es (ly-get-mus-property ch 'elements))) - (ly-set-mus-property ch 'elements + (ly-set-mus-property! ch 'elements (voicify-list (split-list es music-separator?) 0)) ch )) @@ -264,9 +264,9 @@ this is not an override (e (ly-get-mus-property m 'element)) ) (if (pair? es) - (ly-set-mus-property m 'elements (map voicify-music es))) + (ly-set-mus-property! m 'elements (map voicify-music es))) (if (music? e) - (ly-set-mus-property m 'element (voicify-music e))) + (ly-set-mus-property! m 'element (voicify-music e))) (if (and (equal? (ly-music-name m) "Simultaneous_music") (reduce (lambda (x y ) (or x y)) (map music-separator? es))) diff --git a/scripts/convert-ly.py b/scripts/convert-ly.py index fafa29e2f6..4da651fe8d 100644 --- a/scripts/convert-ly.py +++ b/scripts/convert-ly.py @@ -892,6 +892,14 @@ if 1: conversions.append (((1,5,62), conv, 'visibility-lambda -> break-visibility')) + +if 1: + def conv (str): + str = re.sub ('ly-set-grob-property', 'ly-set-grob-property!', str) + str = re.sub ('ly-set-mus-property', 'ly-set-mus-property!', str) + return str + + conversions.append (((1,3,138), conv, 'ly-set-X-property -> ly-set-X-property!')) ################################ -- 2.39.5