]> git.donarmstrong.com Git - lilypond.git/commitdiff
* VERSION (PATCH_LEVEL): bump version.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 11 Jul 2006 10:44:48 +0000 (10:44 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 11 Jul 2006 10:44:48 +0000 (10:44 +0000)
* python/convertrules.py (conv): add rule for tupletNumberFormatFunction.

* ly/engraver-init.ly (AncientRemoveEmptyStaffContext): remove
tupletNumberFormatFunction.

* scm/define-grobs.scm (all-grob-descriptions): calc TupletNumber
text through 'text callback.

* lily/time-scaled-music-iterator.cc (construct_children): copy
tweaks generated events.

* scm/define-context-properties.scm
(all-user-translation-properties): remove tupletNumberFormatFunction

* lily/tuplet-engraver.cc (process_music): don't read
tupletNumberFormatFunction

* scm/output-lib.scm (tuplet-number::calc-fraction-text): new
function.

ChangeLog
Documentation/topdocs/NEWS.tely
VERSION
lily/time-scaled-music-iterator.cc
lily/tuplet-engraver.cc
ly/engraver-init.ly
python/convertrules.py
scm/define-context-properties.scm
scm/define-grobs.scm
scm/output-lib.scm
scm/translation-functions.scm

index 5ae5cece082fe1769e90e1ce9dddb6478875263f..7f92f870d33c7ef3ccb8eacdcfd21c9c463e2abf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+2006-07-11  Han-Wen Nienhuys  <hanwen@lilypond.org>
+
+       * VERSION (PATCH_LEVEL): bump version.
+
+       * python/convertrules.py (conv): add rule for tupletNumberFormatFunction.
+
+       * ly/engraver-init.ly (AncientRemoveEmptyStaffContext): remove
+       tupletNumberFormatFunction.
+
+       * scm/define-grobs.scm (all-grob-descriptions): calc TupletNumber
+       text through 'text callback.
+
+       * lily/time-scaled-music-iterator.cc (construct_children): copy
+       tweaks generated events.
+
+       * scm/define-context-properties.scm
+       (all-user-translation-properties): remove tupletNumberFormatFunction
+
+       * lily/tuplet-engraver.cc (process_music): don't read
+       tupletNumberFormatFunction
+
+       * scm/output-lib.scm (tuplet-number::calc-fraction-text): new
+       function.
+
 2006-07-11  Erik Sandberg  <mandolaerik@gmail.com>
 
        * lily/global-context-scheme.cc: Separated ly:run-translator into
index 925246b4dce76b4d0e02809fdac5032d396e8d3d..a6679e5284724842b6cd063ce834e99d29ded152 100644 (file)
@@ -65,6 +65,28 @@ which scares away people.
 * only show user-visible changes. 
 
 @end ignore
+@item
+Nested tuplets can have different formatting for each nesting level,
+
+@lilypond[ragged-right]
+\new Staff {
+  \time 5/4
+  \tweak #'text #tuplet-bracket::calc-fraction-text
+  \times 5/3 {
+     \tweak #'tupletNumberFormatFunction #denominator-tuplet-formatter
+     \times 2/3 {
+        c'8[ c'8 c'8]
+     }
+     \times 2/3 {
+        c'8[ c'8 c'8]
+     }
+     \times 2/3 {
+        c'8[ c'8 c'8]
+     }
+  }
+}
+@end lilypond
+
 @item
 New sections with different spacing parameters can be started with
 @code{newSpacingSection}.  This is useful when there are  
diff --git a/VERSION b/VERSION
index 4a595f5f0a0ee1499222a61d5fb65a301700c835..30bc606439f317506360db742f8fd7fd2d98e900 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,6 +1,6 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=2
 MINOR_VERSION=9
-PATCH_LEVEL=10
+PATCH_LEVEL=11
 MY_PATCH_LEVEL=
 
index d07c979e3b3c2628ed7f5001b5b1a1da90d93317..ccc93d031463d1d4ff1eebb48d90b0488531f2b9 100644 (file)
@@ -32,10 +32,13 @@ protected:
   virtual void derived_mark () const;
   virtual Moment pending_moment () const;
 private:
+
   /* tupletSpannerDuration */
   Moment spanner_duration_;
+
   /* next time to add a stop/start pair */
   Moment next_split_mom_;
+  
   /* Recycle start/stop events if tupletSpannerDuration is set. */
   Music *start_;
   Music *stop_;
@@ -70,6 +73,7 @@ Time_scaled_music_iterator::process (Moment m)
     {
       report_event (stop_);
       report_event (start_);
+      
       next_split_mom_ += spanner_duration_;
       /* avoid sending events twice at the end */
       if (next_split_mom_ == get_music ()->get_length ().main_part_)
@@ -98,6 +102,8 @@ Time_scaled_music_iterator::construct_children ()
   start_->set_spot (*origin);
   start_->set_property ("numerator", mus->get_property ("numerator"));
   start_->set_property ("denominator", mus->get_property ("denominator"));
+  start_->set_property ("tweaks", mus->get_property ("tweaks"));
+  
 
   SCM stop_scm = scm_call_2 (ly_lily_module_constant ("make-span-event"), tuplet_symbol, scm_from_int (STOP));
   stop_ = unsmob_music (stop_scm);
index 513a53b51fdf3980ff60a3b29aeaada15b36be50..53d85bd933df13c31fc3d2b3c028b24ba5b14184 100644 (file)
@@ -116,13 +116,6 @@ Tuplet_engraver::process_music ()
       if (i > 0 && tuplets_[i - 1].bracket_)
        Tuplet_bracket::add_tuplet_bracket (tuplets_[i - 1].bracket_, tuplets_[i].bracket_);
 
-
-      SCM proc = get_property ("tupletNumberFormatFunction");
-      if (ly_is_procedure (proc))
-       {
-         SCM t = scm_apply_0 (proc, scm_list_1 (tuplets_[i].music_->self_scm ()));
-         tuplets_[i].number_->set_property ("text", t);
-       }
     }
 }
 
@@ -166,5 +159,5 @@ ADD_TRANSLATOR (Tuplet_engraver,
                /* doc */ "Catch TupletSpannerEvent and generate appropriate bracket  ",
                /* create */ "TupletBracket TupletNumber ",
                /* accept */ "tuplet-spanner-event",
-               /* read */ "tupletNumberFormatFunction tupletFullLength ",
+               /* read */ "tupletFullLength ",
                /* write */ "");
index 70466e82cf30a2b123a038c24cb1775bc1ceedbc..aa27cbdd7ca2f381a69f1b8e7891b000915cb0e5 100644 (file)
@@ -524,7 +524,6 @@ AncientRemoveEmptyStaffContext = \context {
   harmonicAccidentals = ##t 
   fingeringOrientations = #'(up down)
   stringNumberOrientations = #'(up down)
-  tupletNumberFormatFunction = #denominator-tuplet-formatter
   markFormatter = #format-mark-letters
   rehearsalMark = #1
   subdivideBeams = ##f
index f2571e882321ce45fb75b6d9cf5e4ab7e1561000..0a2dfa969ae449415770ed510eaa9329d5e652fa 100644 (file)
@@ -2807,3 +2807,20 @@ def conv (str):
 conversions.append (((2, 9, 9), conv, """annotatefoo -> annotate-foo"""))
 
 
+def conv (str):
+    str = re.sub (r"""\\set ([a-zA-Z]+.?)tupletNumberFormatFunction *= *#denominator-tuplet-formatter""",
+                  r"""\\override \1TupletNumber #'text = #tuplet-number::calc-denominator-text""", str)
+
+    str = re.sub (r"""\\set ([a-zA-Z]+.?)tupletNumberFormatFunction *= *#fraction-tuplet-formatter""",
+                  r"""\\override \1TupletNumber #'text = #tuplet-number::calc-fraction-text""", str)
+
+    if re.search ('tupletNumberFormatFunction', str):
+        error_file.write ("\n")
+       error_file.write ("tupletNumberFormatFunction has been removed. Use #'text property on TupletNumber")
+        error_file.write ("\n")
+        
+    return str
+
+conversions.append (((2, 9, 11), conv, """\\set tupletNumberFormatFunction -> \\override #'text = """))
+
+
index 084ab18f6b17e35bbe5050508458a9f2ef8ef26d..8efe40eb5be90464cbaa592ed999a1f7e5c39ecd 100644 (file)
@@ -412,11 +412,6 @@ number is specified.")
 
      (tupletFullLength ,boolean? "If set, the tuplet is printed up to
 the start of the next note.")
-     (tupletNumberFormatFunction
-      ,procedure?
-      "Function taking a music as input, producing a string. This function
-is called to determine the text to print on a tuplet bracket.")
-
      (tupletSpannerDuration ,ly:moment? "
 Normally a tuplet bracket is as wide as the
 @code{\\times} expression that gave rise to it.  By setting this
index c07a9537defd0b19f30fd8b5303f40e2213d8883..9ac56f093c70ee8e78ccbf9e386aa53abeec40f4 100644 (file)
        (edge-height . (0.7 . 0.7))
        (shorten-pair . (-0.2 . -0.2))
        (staff-padding . 0.25)
-       
        (direction  . ,ly:tuplet-bracket::calc-direction)
        (positions . ,ly:tuplet-bracket::calc-positions)
        (connect-to-neighbor . ,ly:tuplet-bracket::calc-connect-to-neighbors)
     (TupletNumber
      . (
        (stencil . ,ly:tuplet-number::print)
+       (text . ,tuplet-number::calc-denominator-text)
        (font-shape . italic)
        (font-size . -2)
        (avoid-slur . inside)
index bf98dbab41487de60be66c96050353531f7e01cc..950e552e2acca6906295aeb6c549f657e387289b 100644 (file)
@@ -243,6 +243,23 @@ centered, X==1 is at the right, X == -1 is at the left."
       (ly:grob-translate-axis! g 3.5 X)))
 
 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Tuplets
+
+(define-public (tuplet-number::calc-denominator-text grob)
+  (let*
+      ((mus (ly:grob-property grob 'cause)))
+    
+    (number->string (ly:music-property mus 'denominator))))
+
+
+(define-public (tuplet-number::calc-fraction-text grob)
+  (let*
+      ((mus (ly:grob-property grob 'cause)))
+    (format "~a:~a" 
+      (ly:music-property mus 'denominator)
+      (ly:music-property mus 'numerator))))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Color
 
index f3bd6163828558557a9f30d5c581e28d98eaf690..e687c32faef5cd411d8714de847d378f4a3605c2 100644 (file)
@@ -5,15 +5,6 @@
 ;;;; (c) 1998--2006 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 ;;;;                Jan Nieuwenhuizen <janneke@gnu.org>
 
-(define-public (denominator-tuplet-formatter mus)
-  (number->string (ly:music-property mus 'denominator)))
-
-(define-public (fraction-tuplet-formatter mus)
-  (string-append
-   (number->string (ly:music-property mus 'denominator))
-   ":"
-   (number->string (ly:music-property mus 'numerator))))
-
 ;; metronome marks
 (define-public (format-metronome-markup event context)
   (let* ((dur (ly:music-property event 'tempo-unit))