]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/lily.scm: remove reduce-no-unit
authorhanwen <hanwen>
Thu, 3 Jul 2003 14:40:58 +0000 (14:40 +0000)
committerhanwen <hanwen>
Thu, 3 Jul 2003 14:40:58 +0000 (14:40 +0000)
(list-insert-separator): use fold-right

* lily/molecule-scheme.cc (ly_molecule_add): take variable number
of arguments.

* NEWS: more neutral language for ancient notation

* lily/chord-tremolo-engraver.cc (acknowledge_grob): only set
inside pointing beaming for chord tremolo.

ChangeLog
NEWS
lily/chord-tremolo-engraver.cc
lily/molecule-scheme.cc
scm/lily.scm
scm/molecule.scm
scm/new-markup.scm

index 0b30e69478146dffed374105f62b39dcb0f97c2d..7174edb19e11f24844cd2e83959ad797ac998c79 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2003-07-03  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
+       * scm/lily.scm: remove reduce-no-unit 
+       (list-insert-separator): use fold-right
+
+       * lily/molecule-scheme.cc (ly_molecule_add): take variable number
+       of arguments. 
+
+       * NEWS: more neutral language for ancient notation 
+
        * lily/chord-tremolo-engraver.cc (acknowledge_grob): only set
        inside pointing beaming for chord tremolo.
 
diff --git a/NEWS b/NEWS
index 3ec2dd4f6b80f2209a0669a1d24227ac8cfede99..fa782857fa1a4103a68ab537e257f7debdddcb27 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -14,8 +14,8 @@ LilyPond identifiers in Scheme, and use Scheme expressions instead of
 LilyPond identifiers.
 
 ** The internal representation of music has been cleaned up completely
-converted to Scheme data structure.  The representation can optionally
-be exported as XML.
+converted to Scheme data structure.  The representation may be
+exported as XML.
 
 ** A new syntax has been added for chords:
 
@@ -30,7 +30,6 @@ and
    \simultaneous { .. } for simultaneous music.
 
 ** A new uniform postfix syntax for articulation has been introduced.
-
 A beamed slurred pair of eighth notes can be entered as
 
        c8-[-( d8-]-) 
@@ -53,11 +52,10 @@ exceptions.
 
        R1*20^\markup { "GP" }
 
-** Ancient notation now supports ligatures in Gregorian square neumes
+** Ancient notation now prints ligatures in Gregorian square neumes
 notation, roughly following the typographical style of the Liber
-hymnarius of Solesmes, published in 1983.  The line breaking and
-horizontal spacing algorithms however are still completely messed up
-by ligatures.
+hymnarius of Solesmes, published in 1983.  Ligatures are still printed
+without the proper line breaking and horizontal spacing.
 
 ** Glissandi can now be printed using the zigzag style.
 
@@ -95,7 +93,7 @@ The syntax is
 
 ** The emacs support has been extended.
 
-** The manual has been completely revised and extended manual.
+** The manual has been completely revised and extended.
 
 
 
index 8d5f7489403838a9fc0a350312850d93f148c82e..983676ccc3e2b55003f2836acf67d3c628b3eb9e 100644 (file)
@@ -25,6 +25,7 @@
 #include "math.h"           // ceil
 
 /**
+
   This acknowledges repeated music with "tremolo" style.  It typesets
   a beam.
 
 
   - create dots if appropriate.
 
-  - create  TremoloBeam iso Beam?
- */
+  - create TremoloBeam iso Beam?
 
+*/
 class Chord_tremolo_engraver : public Engraver
 {
   void typeset_beam ();
-TRANSLATOR_DECLARATIONS(Chord_tremolo_engraver);
+  TRANSLATOR_DECLARATIONS(Chord_tremolo_engraver);
 protected:
   Repeated_music * repeat_;
 
@@ -111,7 +112,6 @@ Chord_tremolo_engraver::try_music (Music * m)
          rp->origin ()->warning ("Chord tremolo is too short to denote properly.");
        }
       
-      Rational written_note_dur = total_dur / Rational (elt_count);
       flags_ = intlog2 (note_dur.den ()) -2 ;
       
       return true;
@@ -169,7 +169,6 @@ Chord_tremolo_engraver::typeset_beam ()
     }
 }
 
-
 void
 Chord_tremolo_engraver::acknowledge_grob (Grob_info info)
 {
@@ -216,7 +215,6 @@ Chord_tremolo_engraver::start_translation_timestep ()
   if (beam_ && stop_mom_ == now_mom ())
     {
       finished_beam_ = beam_;
-
       repeat_ = 0;
       beam_ = 0;
     }
@@ -233,7 +231,6 @@ Chord_tremolo_engraver::stop_translation_timestep ()
       typeset_grob (stem_tremolo_);
       stem_tremolo_ = 0;
     }
-  
 }
 
 
index 8ba102f34d2f040090861360dd3644a6c5f3b2be..1bef34afedc501c468df32b180f21bfe4f0a08b9 100644 (file)
@@ -123,20 +123,28 @@ LY_DEFINE(ly_molecule_combined_at_edge,
   
  */
 LY_DEFINE(ly_molecule_add , 
-         "ly:molecule-add", 2, 0, 0, (SCM first, SCM second),
-         "Combine two molecules."
+         "ly:molecule-add", 0, 0, 1, (SCM args),
+         "Combine molecules. Takes any number of arguments."
          )
 {
-  Molecule * m1 = unsmob_molecule (first);
-  Molecule * m2 = unsmob_molecule (second);
+#define FUNC_NAME __FUNCTION__
+  SCM_VALIDATE_REST_ARGUMENT (args);
+
   Molecule result;
 
+  while (!SCM_NULLP (args))
+    {
+      Molecule * m = unsmob_molecule (gh_car (args));
 
-  if (m1)
-    result = *m1;
-  if (m2)
-    result.add_molecule (*m2);
+      if (!m)
+       SCM_ASSERT_TYPE(m, gh_car (args), SCM_ARGn, __FUNCTION__,
+                       "Molecule");
+
+      result.add_molecule (*m);
 
+      args = gh_cdr (args);
+    }
+  
   return result.smobbed_copy ();
 }
 
index 7aa5cbdc17d4487cc446a3b7cb2469e38ae11e63..aa6856af3acf3532f9b342b3a4752a3434fe0394 100644 (file)
 
 ;; TODO: use the srfi-1 partition function.
 (define-public (uniq-list list)
+  "Uniq LIST, assuming that it is sorted"
   (if (null? list) '()
       (if (null? (cdr list))
          list
@@ -218,25 +219,16 @@ L1 is copied, L2 not.
   "map F to contents of X"
   (cons (f (car x)) (f (cdr x))))
 
-;; TODO: remove.
-(define-public (reduce-no-unit operator list)
-  "reduce OP [A, B, C, D, ... ] =
-   A op (B op (C ... ))
-"
-      (if (null? (cdr list)) (car list)
-         (operator (car list) (reduce-no-unit operator (cdr list)))))
 
-(define-public (list-insert-separator list between)
+(define-public (list-insert-separator lst between)
   "Create new list, inserting BETWEEN between elements of LIST"
-  (if (null? list)
-      '()
-      (if (null? (cdr list))
-         list
-         (cons (car list)
-               (cons between (list-insert-separator (cdr list) between)))
-  
-  )))
-
+  (define (conc x y )
+    (if (eq? y #f)
+       (list x)
+       (cons x  (cons between y))
+       ))
+  (fold-right conc #f lst)
+  )
 
 ;;;;;;;;;;;;;;;;
 ; other
index c994c926299da008c4a5fceeec2d9df2f3d1d647..605cccb515c860065875d399dce0bf8acae26911 100644 (file)
@@ -60,13 +60,9 @@ encloses the contents.
 "
   (let* ((xext (ly:get-extent grob grob 0))
         (yext (ly:get-extent grob grob 1))
-        (mol (ly:make-molecule '() '(10000 . -10000) '(10000 . -10000)))
-        (thick 0.1)
-        )
+        (thick 0.1))
 
-    (set! mol (ly:molecule-add mol (box-molecule xext (cons (- (car yext) thick) (car yext) ))))
-    (set! mol (ly:molecule-add mol (box-molecule xext (cons  (cdr yext) (+ (cdr yext) thick) ))))
-    (set! mol (ly:molecule-add mol (box-molecule (cons (cdr xext) (+ (cdr xext) thick)) yext)))
-    (set! mol (ly:molecule-add mol (box-molecule (cons (- (car xext) thick) (car xext)) yext)))
-    mol
-  ))
+    (ly:molecule-add (box-molecule xext (cons (- (car yext) thick) (car yext) ))
+                    (box-molecule xext (cons  (cdr yext) (+ (cdr yext) thick) ))
+                    (box-molecule (cons (cdr xext) (+ (cdr xext) thick)) yext)
+                    (box-molecule (cons (- (car xext) thick) (car xext)) yext))))
index f04cf768d8e3b980ee2089bf75e1b7d922e248ff..a29b9027a8183e5a9153b6e9db82533920f8c8ce 100644 (file)
@@ -73,18 +73,12 @@ for the reader.
    (map (lambda (x) (interpret-markup grob props x)) (car rest)))
   )
 
-(define (combine-molecule-list lst)
-  (if (null? (cdr lst)) (car lst)
-      (ly:molecule-add (car lst) (combine-molecule-list (cdr lst)))
-      ))
 
 (define-public (combine-markup grob props . rest)
   (ly:molecule-add
    (interpret-markup grob props (car rest))
    (interpret-markup grob props (cadr rest))))
   
-;   (combine-molecule-list (map (lambda (x) (interpret-markup grob props x)) (car rest))))
-
 (define (font-markup qualifier value)
   (lambda (grob props . rest)
     (interpret-markup grob (cons (cons `(,qualifier . ,value) (car props)) (cdr props)) (car rest))
@@ -223,15 +217,12 @@ for the reader.
        (dot (ly:find-glyph-by-name font "dots-dot"))
        (dotwid  (interval-length (ly:molecule-get-extent dot X)))
        (dots (if (> dot-count 0)
-                (reduce-no-unit        ; TODO: use reduce.
-                 (lambda (x y)
-                   (ly:molecule-add x y))
+                (ly:molecule-add
                  (map (lambda (x)
                         (ly:molecule-translate-axis
                          dot  (* (+ 1 (* 2 x)) dotwid) X) )
                       (iota dot-count 1)))
-                #f
-                ))
+                #f))
        
        (flaggl (if (> log 2)
                   (ly:molecule-translate