]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/quote-iterator.cc
Update d/copyright
[lilypond.git] / lily / quote-iterator.cc
index 69c580f5d5484fc4e0c8717144e90ffce55a95f8..d35bb54b2c9d336cf668b60c0e42e0583e5a7f34 100644 (file)
@@ -128,15 +128,16 @@ Quote_iterator::construct_children ()
   SCM name = get_music ()->get_property ("quoted-context-type");
   SCM id = get_music ()->get_property ("quoted-context-id");
 
-  if (scm_is_string (id)
-      && scm_is_symbol (name))
+  if (scm_is_symbol (name))
     {
-      Context *cue_context = get_outlet ()->find_create_context (name,
-                                                                 ly_scm2string (id), SCM_EOL);
+      Context *cue_context =
+        get_outlet ()->find_create_context (name,
+                                            robust_scm2string (id, ""),
+                                            SCM_EOL);
       quote_outlet_.set_context (cue_context);
     }
   else
-    quote_outlet_.set_context (get_outlet ());
+    quote_outlet_.set_context (get_outlet ()->get_default_interpreter ());
 
   event_vector_ = get_music ()->get_property ("quoted-events");
 
@@ -237,11 +238,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 +274,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 ();