lilypond-devel
[Top][All Lists]
Advanced

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

Issue 4495 Remove unnecessary #{ .. #} constructs (issue 253310043 by ad


From: dak
Subject: Issue 4495 Remove unnecessary #{ .. #} constructs (issue 253310043 by address@hidden)
Date: Sat, 18 Jul 2015 22:02:54 +0000

One thing that you have to be aware of is that
#{ \music #}
is not equivalent to music but rather to
(ly:music-deep-copy music (*location*))
since it creates a copy of the music and puts the point-and-click
information to the call of the containing music function.

Now I don't really know whether you want the (*location*) here: it would
likely substitute less useful origin information when everything points
to the call of the template.  But for any music that is potentially used
more than once, you definitely want a copy.  If you don't use a copy,
then any \relative or \transpose of the music in one place will appear
in all other places as well, which usually means that you get more
invocations of \relative or \transpose on any particular appearance than
you intended.


https://codereview.appspot.com/253310043/diff/1/ly/staff-tkit.ly
File ly/staff-tkit.ly (right):

https://codereview.appspot.com/253310043/diff/1/ly/staff-tkit.ly#newcode60
ly/staff-tkit.ly:60: #(if dynUp
elseif cascades are bad to read in Scheme's indentation.  Rather use
cond here:

#(cond (dynUp dynamicUp)
       (dynDown dynamicDown)
       (else dynamicNeutral))

https://codereview.appspot.com/253310043/diff/1/ly/vocal-tkit.ly
File ly/vocal-tkit.ly (right):

https://codereview.appspot.com/253310043/diff/1/ly/vocal-tkit.ly#newcode41
ly/vocal-tkit.ly:41: (if v1music
This does not work.  #{ << #*unspecified* >> #} ignores the given
element, but (make-simultanous-music (list ... will not do so.

Instead do something like
(delq! #f
  (list
    (make-two-voice-staff name clef v1name v2name)
    (and v1music ...)
    (and v2music ...)))

https://codereview.appspot.com/253310043/



reply via email to

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