/*
This file is part of LilyPond, the GNU music typesetter.
- Copyright (C) 1997--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ Copyright (C) 1997--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
LilyPond is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
if (!stem_)
make_stem (gi);
- if (Stem::duration_log (stem_) != d->duration_log ())
+ int ds = Stem::duration_log (stem_);
+ int dc = d->duration_log ();
+
+ // half notes and quarter notes all have compatible stems.
+ // Longas are done differently (oops?), so we can't unify
+ // them with the other stemmed notes.
+ if (ds == 1)
+ ds = 2;
+ if (dc == 1)
+ dc = 2;
+ // whole notes and brevis both have no stems
+ if (ds == -1)
+ ds = 0;
+ if (dc == -1)
+ dc = 0;
+
+ if (ds != dc)
{
- // FIXME:
- gi.event_cause ()->origin ()->warning (_f ("adding note head to incompatible stem (type = %d)",
- 1 << Stem::duration_log (stem_)));
+ gi.event_cause ()->origin ()->warning (_f ("adding note head to incompatible stem (type = %d/%d)",
+ ds < 0 ? 1 << -ds : 1,
+ ds > 0 ? 1 << ds : 1));
gi.event_cause ()->origin ()->warning (_ ("maybe input should specify polyphonic voices"));
}