]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 3168: Invert the meaning of instrumentTransposition again.
authorDavid Kastrup <dak@gnu.org>
Tue, 5 Feb 2013 13:48:46 +0000 (14:48 +0100)
committerDavid Kastrup <dak@gnu.org>
Tue, 19 Feb 2013 21:59:06 +0000 (22:59 +0100)
This basically reverts commit 1965ca6b70aaf2c04a25ace9ed3f1fb4e1222f5a
and the preceding one.

Files affected:

lily/note-performer.cc
lily/quote-iterator.cc
ly/music-functions-init.ly
scm/define-context-properties.scm

lily/note-performer.cc
lily/quote-iterator.cc
ly/music-functions-init.ly
scm/define-context-properties.scm

index b0a81195c7185b953fa97c645d83d18eaebd4fc9..ddf9fe39213e0d74910ce75a268808ad254d424c 100644 (file)
@@ -80,7 +80,7 @@ Note_performer::process_music ()
           Moment len = get_event_length (n, now_mom ());
 
           Audio_note *p = new Audio_note (*pitp, len,
-                                          tie_event, transposing.negated ());
+                                          tie_event, transposing);
           Audio_element_info info (p, n);
           announce_element (info);
           notes_.push_back (p);
index 69c580f5d5484fc4e0c8717144e90ffce55a95f8..86d01304a878f28f8ffb1ad27658b3645b84a2b7 100644 (file)
@@ -237,11 +237,21 @@ Quote_iterator::process (Moment m)
       Pitch *quote_pitch = unsmob_pitch (scm_cdar (entry));
 
       /*
-        The pitch that sounds like central C
+        The pitch that sounds when written central C is played.
       */
+      Pitch temp_pitch;
       Pitch *me_pitch = unsmob_pitch (get_music ()->get_property ("quoted-transposition"));
       if (!me_pitch)
         me_pitch = unsmob_pitch (get_outlet ()->get_property ("instrumentTransposition"));
+      else
+        {
+          // We are not going to win a beauty contest with this one,
+          // but it is slated for replacement and touches little code.
+          // quoted-transposition currently has a different sign
+          // convention than instrumentTransposition
+          temp_pitch = me_pitch->negated ();
+          me_pitch = &temp_pitch;
+        }
       SCM cid = get_music ()->get_property ("quoted-context-id");
       bool is_cue = scm_is_string (cid) && (ly_scm2string (cid) == "cue");
 
@@ -263,7 +273,7 @@ Quote_iterator::process (Moment m)
                   if (me_pitch)
                     mp = *me_pitch;
 
-                  Pitch diff = pitch_interval (qp, mp);
+                  Pitch diff = pitch_interval (mp, qp);
                   ev = ev->clone ();
                   ev->make_transposable ();
 
index 061e696d08f01f967924c674367e095cb245086a..2669cc6bfb08916d4bcca73f4c425b9ec6a1921b 100644 (file)
@@ -1339,6 +1339,8 @@ as a first or second voice.")
               'quoted-context-id "cue"
               'quoted-music-name what
               'quoted-voice-direction dir
+               ;; following is inverse of instrumentTransposition for
+               ;; historical reasons
               'quoted-transposition pitch))
 
 transposition =
@@ -1346,8 +1348,7 @@ transposition =
    (_i "Set instrument transposition")
 
    (context-spec-music
-    (make-property-set 'instrumentTransposition
-                       (ly:pitch-negate pitch))
+    (make-property-set 'instrumentTransposition pitch)
     'Staff))
 
 tuplet =
index e9239fc65f8da1f07428c275270cbb99cd607edb..98f52aaa09bf89463d39d27032b0e8374ce8a3cc 100644 (file)
@@ -330,11 +330,10 @@ of numbers for the loudness range of the instrument.")
      (instrumentName ,markup? "The name to print left of a staff.  The
 @code{instrumentName} property labels the staff in the first system, and
 the @code{shortInstrumentName} property labels following lines.")
-     ;; the definition is reversed wrt traditional transposition
-     ;; otherwise \transpose { \transposition .. } won't work
      (instrumentTransposition ,ly:pitch? "Define the transposition of
-the instrument.  Its value is the pitch that sounds like middle@tie{}C.
-This is used to transpose the MIDI output, and @code{\\quote}s.")
+the instrument. Its value is the pitch that sounds when the instrument
+plays written middle C.  This is used to transpose the MIDI output,
+and @code{\\quote}s.")
      (internalBarNumber ,integer? "Contains the current barnumber.
 This property is used for internal timekeeping, among others by the
 @code{Accidental_engraver}.")