- /*
- Crude hack for spacing graces: we take the shortest space
- available (namely the space for the global shortest note), and
- multiply that by grace-space-factor
- */
- dist = options->get_duration_space (options->global_shortest_, expand_only);
-
- Real grace_fact
- = robust_scm2double (me->get_property ("grace-space-factor"), 1);
-
- dist *= grace_fact;
+ Grob *grace_spacing = unsmob<Grob> (lc->get_object ("grace-spacing"));
+ if (grace_spacing)
+ {
+ Spacing_options grace_opts;
+ grace_opts.init_from_grob (grace_spacing);
+ Real len = grace_opts.get_duration_space (delta_t.grace_part_);
+ Real min = grace_opts.increment_;
+ ret = Spring (len, min);
+ // Grace notes should not stretch very much
+ ret.set_inverse_stretch_strength (grace_opts.increment_ / 2.0);
+ }
+ else // Fallback to the old grace spacing: half that of the shortest note
+ ret = Spring (options->
+ get_duration_space (options->global_shortest_) / 2.0,
+ options->increment_ / 2.0);