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.
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:
\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-]-)
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.
** The emacs support has been extended.
-** The manual has been completely revised and extended manual.
+** The manual has been completely revised and extended.
#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_;
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;
}
}
-
void
Chord_tremolo_engraver::acknowledge_grob (Grob_info info)
{
if (beam_ && stop_mom_ == now_mom ())
{
finished_beam_ = beam_;
-
repeat_ = 0;
beam_ = 0;
}
typeset_grob (stem_tremolo_);
stem_tremolo_ = 0;
}
-
}
*/
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 ();
}
;; 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
"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
"
(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))))
(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))
(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