From f88a78e145a26da1aaaf42eff75b42fc2271a589 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Tue, 5 Feb 2013 14:48:46 +0100 Subject: [PATCH] Issue 3168: Invert the meaning of instrumentTransposition again. 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 | 2 +- lily/quote-iterator.cc | 14 ++++++++++++-- ly/music-functions-init.ly | 5 +++-- scm/define-context-properties.scm | 7 +++---- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/lily/note-performer.cc b/lily/note-performer.cc index b0a81195c7..ddf9fe3921 100644 --- a/lily/note-performer.cc +++ b/lily/note-performer.cc @@ -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); diff --git a/lily/quote-iterator.cc b/lily/quote-iterator.cc index 69c580f5d5..86d01304a8 100644 --- a/lily/quote-iterator.cc +++ b/lily/quote-iterator.cc @@ -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 (); diff --git a/ly/music-functions-init.ly b/ly/music-functions-init.ly index 061e696d08..2669cc6bfb 100644 --- a/ly/music-functions-init.ly +++ b/ly/music-functions-init.ly @@ -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 = diff --git a/scm/define-context-properties.scm b/scm/define-context-properties.scm index e9239fc65f..98f52aaa09 100644 --- a/scm/define-context-properties.scm +++ b/scm/define-context-properties.scm @@ -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}.") -- 2.39.5