+ if (key_req_)
+ {
+ SCM pitchlist = key_req_->get_property ("pitch-alist");
+ SCM proc = ly_scheme_function ("alterations-in-key");
+
+ SCM acc = scm_call_1 (proc, pitchlist);
+
+ Pitch key_do (0,
+ scm_to_int (scm_caar (pitchlist)),
+ scm_to_int (scm_cdar (pitchlist)));
+
+ Pitch c_do (0, 0, 0);
+
+ SCM c_pitchlist
+ = ly_transpose_key_alist (pitchlist,
+ pitch_interval (key_do, c_do).smobbed_copy ());
+
+ /* MIDI keys are too limited for lilypond scales.
+ We check for minor scale and assume major otherwise. */
+ SCM minor = scm_c_eval_string ("minor");
+ audio_ = new Audio_key (scm_to_int (acc),
+ SCM_BOOL_T != scm_equal_p (minor, c_pitchlist));
+
+ Audio_element_info info (audio_, key_req_);
+ announce_element (info);
+ key_req_ = 0;
+ }