+ Real volume = 0.5;
+ if (gh_number_p (svolume))
+ volume = gh_scm2double (svolume);
+
+ /*
+ properties override default equaliser setting
+ */
+ SCM min = get_property ("midiMinimumVolume");
+ SCM max = get_property ("midiMaximumVolume");
+ if (gh_number_p (min) || gh_number_p (max))
+ {
+ Interval iv (0, 1);
+ if (gh_number_p (min))
+ iv[MIN] = gh_scm2double (min);
+ if (gh_number_p (max))
+ iv[MAX] = gh_scm2double (max);
+ volume = iv[MIN] + iv.length () * volume;
+ }
+ else
+ {
+ /*
+ urg, code duplication:: staff_performer
+ */
+ SCM s = get_property ("midiInstrument");
+
+ if (!gh_string_p (s))
+ s = get_property ("instrument");
+
+ if (!gh_string_p (s))
+ s = ly_str02scm ("piano");
+
+
+ SCM eq = get_property ("instrumentEqualizer");
+ if (gh_procedure_p (eq))
+ {
+ s = gh_call1 (eq, s);
+ }
+
+ if (gh_pair_p (s))
+ {
+ Interval iv;
+ iv[MIN] = gh_scm2double (ly_car (s));
+ iv[MAX] = gh_scm2double (ly_cdr (s));
+ volume = iv[MIN] + iv.length () * volume;
+ }
+ }
+