lilypond-devel
[Top][All Lists]
Advanced

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

Re: key-performer.cc: use Pitch::negated for readability (issue 33350004


From: dak
Subject: Re: key-performer.cc: use Pitch::negated for readability (issue 333500043 by address@hidden)
Date: Wed, 17 Jan 2018 00:41:46 -0800

Reviewers: Dan Eble,

Message:
On 2018/01/17 00:18:54, Dan Eble wrote:
https://codereview.appspot.com/333500043/diff/1/lily/key-performer.cc
File lily/key-performer.cc (right):


https://codereview.appspot.com/333500043/diff/1/lily/key-performer.cc#newcode71
lily/key-performer.cc:71: key_do.negated ().smobbed_copy ());
LGTM, but ...

I also have a hard time understanding the existing code in this
function.

Isn't it sufficient to check whether the interval between
pitch-alist[0] and
pitch-alist[2] is a minor third, i.e. 3 half-steps?  I don't see why
the key
signature would need to be transposed to C for that.  Maybe there's a
music-theoretical concern I'm overlooking.

Microtonality?  User-specified signatures/scales?  I am not going to
upset stuff here without good reason.

Description:
key-performer.cc: use Pitch::negated for readability

This one had been irritating my comprehension, partly because the
argument order for pitch_interval in this use case is not readily
obvious.

Please review this at https://codereview.appspot.com/333500043/

Affected files (+1, -3 lines):
  M lily/key-performer.cc


Index: lily/key-performer.cc
diff --git a/lily/key-performer.cc b/lily/key-performer.cc
index 5de378eda49832c11a8366d155044b23373912ac..f14e29e505f563ddaa7151a0fc8a9b3aa1c71dd7 100644
--- a/lily/key-performer.cc
+++ b/lily/key-performer.cc
@@ -66,11 +66,9 @@ Key_performer::process_music ()
                     scm_to_int (scm_caar (pitchlist)),
                     ly_scm2rational (scm_cdar (pitchlist)));

-      Pitch c_do;
-
       SCM c_pitchlist
         = ly_transpose_key_alist (pitchlist,
- pitch_interval (key_do, c_do).smobbed_copy ());
+                                  key_do.negated ().smobbed_copy ());

       /* MIDI keys are too limited for lilypond scales.
          We check for minor scale and assume major otherwise.  */





reply via email to

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