- if (gthis && gthis->get_score_context ())
- return gthis->get_score_context ()->find_create_context (n, id, operations);
+ if (gthis)
+ {
+ if (gthis->get_score_context ())
+ return gthis->get_score_context ()->find_create_context (n, id, operations);
+
+ // Special case: If we use \set Timing.xxx = whatever before
+ // Score is established, the alias of Score to Timing will not
+ // be taken into account. We check for this particular case
+ // here. Aliases apart from Score-level ones don't warrant
+ // context creation as they could create unwanted contexts, like
+ // RhythmicVoice instead of Voice. Creating a Score context,
+ // however, can't really do anything wrong.
+
+ SCM score_name = default_child_context_name ();
+ SCM score_def = find_context_def (get_output_def (), score_name);
+
+ if (Context_def *cd = unsmob_context_def (score_def))
+ {
+ if (cd->is_alias (n))
+ return create_context (cd, id, operations);
+ }
+ }
+