- Music * req = note_reqs_[i];
- Item *note = make_item ("NoteHead", req->self_scm ());
-
- Duration dur = *unsmob_duration (req->get_property ("duration"));
-
- note->set_property ("duration-log", scm_int2num (dur.duration_log ()));
- if (dur.dot_count ())
- {
- Item * d = make_item ("Dots", note->self_scm ());
- Rhythmic_head::set_dots (note, d);
-
- if (dur.dot_count ()
- != robust_scm2int (d->get_property ("dot-count"), 0))
- d->set_property ("dot-count", scm_int2num (dur.dot_count ()));
-
- d->set_parent (note, Y_AXIS);
-
- dots_.push (d);
- }
-
- Pitch *pit =unsmob_pitch (req->get_property ("pitch"));
-
- int pos = pit ? pit->steps () : 0;
- SCM c0 = get_property ("middleCPosition");
- if (scm_is_number (c0))
- pos += scm_to_int (c0);
+ Pitch *pit = unsmob<Pitch> (ev->get_property ("pitch"));
+
+#if 0 /* TODO: should have a mechanism to switch off these warnings. */
+
+ if (!pit)
+ ev->origin ()->warning (_ ("NoteEvent without pitch"));
+#endif
+
+ int pos;
+ if (pit == 0)
+ pos = 0;
+ else if (ly_is_procedure (layout_proc))
+ {
+ SCM pitch = ev->get_property ("pitch");
+ pos = scm_to_int (scm_call_1 (layout_proc, pitch));
+ }
+ else
+ pos = pit->steps ();