]> git.donarmstrong.com Git - lilypond.git/commitdiff
*** empty log message ***
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 28 Nov 2004 17:37:42 +0000 (17:37 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 28 Nov 2004 17:37:42 +0000 (17:37 +0000)
ChangeLog
Documentation/topdocs/NEWS.texi
Documentation/user/notation.itely
flower/include/rational.hh
lily/accidental-placement.cc
lily/moment.cc
ly/grace-init.ly
ly/music-functions-init.ly

index 8f955af3d0f8808083510e04e568777b921a37cb..f7b206304a6541fab8dddf8843a16a7bbe572322 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-11-28  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * lily/accidental-placement.cc (position_accidentals): shortcut if
+       no accidentals to place.
+
 2004-11-28  Nicolas Sceaux  <nicolas.sceaux@free.fr>
 
        * scm/define-grob-properties.scm (all-user-grob-properties): fixed
index 85e561a6d67eebd68e6127ebb3edc736a972a47b..4f57ab62512ccd7a06fd8b5150e5592f5e21759b 100644 (file)
@@ -7,6 +7,10 @@
 @unnumbered New features in 2.5 since 2.4
 
 @itemize @bullet
+@item
+LilyPond will now avoid line breaks that cause long texts to stick
+outside of the page staff.
+
 @item
 Grace notes following a main note, used to be entered by letting the
 grace notes follow a skip in a parallel expression, for example,
@@ -18,10 +22,10 @@ grace notes follow a skip in a parallel expression, for example,
 @end verbatim
 
 @noindent
-This can verbose input can now be shortened, by doing
+This can now be shortened by doing
 
 @example
-\afterGrace { d1 } { c16[ d] 
+\afterGrace @{ d1 @} @{ c16[ d] @
 @end example 
 
 @item
index 236dcdbf55ad740ffe1078db4583c44f7d768c7d..9434abfebf6b94d83564b4c42bf191188a7b545f 100644 (file)
@@ -2512,7 +2512,7 @@ If you want to end a note with a grace, use the @code{\afterGrace}
 command. It takes two arguments: the main note, and the grace notes
 following the main note. 
 
-@lilypond[raggedright, verbatim,relative=2]
+@lilypond[raggedright, verbatim,relative=2,fragment]
 c1 \afterGrace d1 { c16[ d] } c4   
 @end lilypond
 
index 361b075f7e5b2ed22aa650f723aa91640ca5a268..11cf97736d2004072ff5a941abe47c875530341c 100644 (file)
@@ -33,8 +33,10 @@ public:
   void set_infinite (int sign);
   bool is_infinity () const;
   void invert ();
-  int num () const { return sign_ * num_; }
-  int den () const { return den_; }
+  int numerator () const { return sign_ * num_; }
+  int denominator () const { return den_; }
+  int num () const { return numerator(); }
+  int den () const { return denominator(); }
 
   Rational trunc_rat () const;
   Rational div_rat (Rational) const;
index 8845454aa172dc21c29eb4796583cd10f3d75f01..b81e4d5702a4cc654f571ec4c2528ae8334f3a22 100644 (file)
@@ -254,7 +254,9 @@ Accidental_placement::position_accidentals (Grob * me)
     return SCM_UNSPECIFIED;
   
   SCM accs = me->get_property ("accidental-grobs");
-
+  if (!scm_is_pair (accs))
+    return SCM_UNSPECIFIED;
+    
   /*
     TODO: there is a bug in this code. If two accs are on the same
     Y-position, they share an Ape, and will be printed in overstrike.
index 4ac319df5bd0041159377021f5c61640e3b8f889..ea5ec2e7df8e848e7c525af56b9e7c146a2cae18 100644 (file)
@@ -132,6 +132,26 @@ LY_DEFINE (ly_div_moment,"ly:div-moment",
   return (*ma / *mb).smobbed_copy ();
 }
 
+LY_DEFINE (ly_moment_main_numerator,"ly:moment-main-numerator",
+          1, 0, 0, (SCM mom),
+          "Extract numerator from main timing.")
+{
+  Moment *ma = unsmob_moment (mom);
+  SCM_ASSERT_TYPE (ma, mom, SCM_ARG1, __FUNCTION__, "moment");
+
+  return scm_from_int (ma->main_part_.numerator ()); 
+}
+
+LY_DEFINE (ly_moment_main_denominator,"ly:moment-main-denominator",
+          1, 0, 0, (SCM mom),
+          "Extract denominator from main timing.")
+{
+  Moment *ma = unsmob_moment (mom);
+  SCM_ASSERT_TYPE (ma, mom, SCM_ARG1, __FUNCTION__, "moment");
+
+  return scm_from_int (ma->main_part_.denominator ()); 
+}
+
 LY_DEFINE (ly_moment_less_p,"ly:moment<?",
           2, 0, 0, (SCM a, SCM b),
           "Compare two moments.")
index 282e31e087d86b2e4011410be7bf35d67d5ac720..4a08d8695d5595ff7922c68396d2e507aa5b33e4 100644 (file)
@@ -2,32 +2,26 @@
 
 
 startGraceMusic =  {
-%    \context Voice \applycontext #set-start-grace-properties
 }
 
 stopGraceMusic =  { 
-%    \context Voice \applycontext #set-stop-grace-properties
 }
 
 startAppoggiaturaMusic =
  {
-%    \context Voice \applycontext #set-start-grace-properties
     s1*0(
 }
 
 stopAppoggiaturaMusic =  { 
-%    \context Voice \applycontext #set-stop-grace-properties
     s1*0)
 }
 
 startAcciaccaturaMusic =  {
-%    \context Voice \applycontext #set-start-grace-properties
     s1*0(
     \override Stem  #'stroke-style = #"grace"
 }
 
 stopAcciaccaturaMusic =  {
     \revert Stem #'stroke-style
-%    \context Voice \applycontext #set-stop-grace-properties
     s1*0)
 }
index c38e5a771c5dc2428ec9546454276cab3a178360..1d29068a7d07b52c361304b95a9853dc7e748f82 100644 (file)
@@ -11,6 +11,7 @@ oldaddlyrics = #(def-music-function (parser location music lyrics) (ly:music? ly
                           'elements (list music lyrics)))
 
 grace = #(def-grace-function startGraceMusic stopGraceMusic)
+
 acciaccatura = #(def-grace-function startAcciaccaturaMusic stopAcciaccaturaMusic)
 appoggiatura = #(def-grace-function startAppoggiaturaMusic stopAppoggiaturaMusic)
 
@@ -113,6 +114,32 @@ killCues =
          mus)) music))
    
 
+afterGraceFraction = #(cons 6 8)
+
+afterGrace =
+#(def-music-function
+  (parser location main grace)
+  (ly:music? ly:music?)
+
+  (let*
+      ((main-length (ly:music-length main))
+       (fraction  (ly:parser-lookup parser 'afterGraceFraction)))
+    
+    (make-simultaneous-music
+     (list
+      main
+      (make-sequential-music
+       (list
+
+       (make-music 'SkipMusic
+                   'duration (ly:make-duration
+                              0 0
+                              (* (ly:moment-main-numerator main-length)
+                                 (car fraction))
+                              (* (ly:moment-main-denominator main-length)
+                                 (cdr fraction)) ))
+       (make-music 'GraceMusic
+                   'element grace)))))))
 
 %{