[Top][All Lists]

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

Re: Create engravers for merging rests (issue 321930043 by address@hidde

From: david . nalesnik
Subject: Re: Create engravers for merging rests (issue 321930043 by address@hidden)
Date: Thu, 18 May 2017 07:15:23 -0700
File ly/ (right):
ly/ #(use-modules (scm merge-rests-engraver))
I'm not sure why you are defining a separate module.  The usual
procedure would be to add your functionality to an existing file in the
load list or add your new file to the load list (in scm/lily.scm -- see

The Span_stem_engraver, for example, puts the bulk of its code in
scm/music-functions-init.scm.  (There is also some code in
scm.scheme-engravers.scm -- I'm not sure if you ought to add something
File scm/merge-rests-engraver.scm (right):
scm/merge-rests-engraver.scm:14: (eq?
Here (and elsewhere) use eqv? to compare numbers.
scm/merge-rests-engraver.scm:23: (define-public merge-rests-engraver
Here (and below) use the scheme-engraver macro for consistency.  As far
as I'm aware, all Scheme engravers in the code base use this now.  See
scm/scheme-engravers.scm or input/regression/ for
scm/merge-rests-engraver.scm:35: (if (eq? 'Rest (assoc-ref
(ly:grob-property grob 'meta) 'name))
(See comment about recognizing grobs below.)
scm/merge-rests-engraver.scm:39: (eq?
scm/merge-rests-engraver.scm:44: (eq? (ly:grob-property mmrest
'measure-count) 1))
scm/merge-rests-engraver.scm:70: (let* ((curr-rests '())
let* not needed -- use let
scm/merge-rests-engraver.scm:81: (if (eq? 'MultiMeasureRest (assoc-ref
(ly:grob-property grob 'meta) 'name))
You could use grob::name here.  Ordinarily, though, objects are
recognized by their interfaces.  So, here you should try

(if (grob::has-interface grob 'multi-measure-rest-interface)

reply via email to

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