+ }
+}
+
+
+/*
+ We add the properties, one by one for each Script. We could save a
+ little space by tacking the props onto the Script grob (i.e. make
+ ScriptStaccato , ScriptMarcato, etc. )
+ */
+void make_script_from_event (Grob *p,
+ SCM * descr, Context *tg,
+ SCM art_type,
+ int index)
+{
+ SCM alist = tg->get_property ("scriptDefinitions");
+ SCM art = scm_assoc (art_type, alist);
+
+ if (art == SCM_BOOL_F)
+ {
+ warning (_("Don't know how to interpret articulation:"));
+ warning (_("Scheme encoding: "));
+ scm_write (art_type, scm_current_error_port ());
+ return ;
+ }
+
+ art = gh_cdr (art);
+
+ *descr = art;
+
+
+ copy_property (p, ly_symbol2scm ("script-stencil"), art);
+ copy_property (p, ly_symbol2scm ("direction"), art);
+ copy_property (p, ly_symbol2scm ("side-relative-direction"), art);
+
+ int prio =0;
+ SCM sprio = scm_assoc (ly_symbol2scm ("script-priority"), art);
+ if (gh_pair_p (sprio))
+ prio = gh_scm2int (gh_cdr (sprio));
+
+
+ /*
+ Make sure they're in order of user input by adding index i.
+ Don't use the direction in this priority. Smaller means closer
+ to the head.
+ */
+ prio += index;
+
+ Side_position_interface::set_axis (p, Y_AXIS);
+ p->set_property ("script-priority", gh_int2scm (prio));
+}
+
+void
+Script_engraver::process_music ()
+{
+ for (int i=0; i < scripts_.size (); i++)
+ {
+ Music* l=scripts_[i].event_;
+
+ Grob * p = make_item ("Script");
+
+ make_script_from_event (p, &scripts_[i].description_, daddy_context_,
+ l->get_property ("articulation-type"),
+ i);
+
+ scripts_[i].script_ = p;
+