lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: \displayLilyMusic -- continued


From: Han-Wen Nienhuys
Subject: Re: \displayLilyMusic -- continued
Date: Wed, 20 Jul 2005 01:33:54 +0200
User-agent: Mozilla Thunderbird 1.0.2-6 (X11/20050513)

Nicolas Sceaux wrote:
Here is a patch for \displayLilyMusic, plus three new files (I don't
know if I can make them appear directly in the patch?)

- scm/display-lily.scm contains the code that makes it possible to
  define display methods;

- in scm/define-music-display-methods.scm the methods are actually
  defined for each music type;

- input/regression/display-lily-tests.ly contains the regression tests
  (should be pretty complete, but eh...);

- ly/music-functions-init.ly has a new definition: \displayLilyMusic,
  which acts like \displayMusic;

- scm/lily.scm loads the new scheme files;

- scm/markups.scm: an obsolete debug function (for displaying markups)
  is removed. One can use \displayLilyMusic instead (with \mark for
  instance)

In addition, (display-lily-init parser) could called somewhere in a .ly
init file.

nicolas

Sorry for the delay. some minor comments.

(define (pitch= pitch1 pitch2)
  (and (= (ly:pitch-notename pitch1) (ly:pitch-notename pitch2))
       (= (ly:pitch-alteration pitch1) (ly:pitch-alteration pitch2))))

this should already work with equal? -- see Pitch::equal_p . The same for duration.

An idea: can you put this functionality in a separate module? The code contains so many functions that I worry about namespace pollution.

;;;
;;; durations
;;;
(define (duration= lydur1 lydur2)
  (and (= (ly:duration-log lydur1) (ly:duration-log lydur2))
       (= (ly:duration-dot-count lydur1) (ly:duration-dot-count lydur2))
       (equal? (ly:duration-factor lydur1) (ly:duration-factor lydur2))))

see above.


;; \acciaccatura \appoggiatura \grace
;; TODO: it would be better to compare ?start and ?stop
;; with startAppoggiaturaMusic and stopAppoggiaturaMusic,
;; using a custom music equality predicate.
(define-extra-display-method GraceMusic (expr)

actually it would be better if we reimplemented acciaccatura and appogiatura further down the back of lily. What we have now is a hack, really.

(define-display-method BreakEvent (br)
  "\\break") ;; TODO: use page-penalty, penalty properties?

Good question. Break penalties are an ugly, rather unused part of the syntax.

(define-display-method AutoChangeMusic (m)
  ;; TODO: do something with the split-list property?

No. Lily constructs the split list, so it should not be part of the input.

can you look at my comments (especially the one about a module) and apply the patch to CVS HEAD?

Thanks for all your hard work and I'm looking forward to having displayLilyMusic in lilypond!


--
 Han-Wen Nienhuys - address@hidden - http://www.xs4all.nl/~hanwen




reply via email to

[Prev in Thread] Current Thread [Next in Thread]