My apologies - the previous post was meant to be a private answer
to Han-Wen. Here is the general comment:
Lily presently has a problem with contexts in that the context of
stems, beams, and note heads can not be separated. Musically, they
are separate ideas.
For example (from Scarlatti), the musical structure of a passage
in thirds might be :
{[a8 b c] [b c d] [c d e] [d e f]}{c8 d e d e f e f g f g a'}
Using capital letters as an ASCII equivalent of diamond note heads,
if this passage is repeated half a dozen times, Scarlatti would
play it:
{[a8 b c] [b c d] [c d e] [d e f]}{C8 D E D E F E F G F G A'}
...
{[A8 B C] [B C D] [C D E] [D E F]}{c8 d e d e f e f g f g a'}
...
{[a8 b c] [B C D] [c d e] [D E F]}{C8 D E d e f E F G f g a'}
...
{[a8 b c] [b c d] [c d e] [d e f]}{c8 d e d e f e f g f g a'}
...
{[A8 B C] [B C D] [C D E] [D E F]}{C8 D E D E F E F G F G A'}
...
{[A8 b C] [b C d] [C d E] [d E f]}{C8 d E d E f E f G f G a'}
...
Guitar players have similar problems with harmonics and body thumps
intermixed with notes, and there are many equivalent cases in modern
music, and in traditional poly-rhythmic music.
A separation of contexts can be hacked when note sizes are the same
by putting each {} set in a separate voice, e.g.
Voice<{[a8 b c] [b c d] [c d e] [d e f]}>
...
Voice<{\times 1/2 {c4 d e d e f e f g f g a'}}>
so that only one set of beams appears and the stems overlap,
but that is NOT the meaning of the music! And, it doesn't
work for crushed grace-notes or Scarlatti acciacaturae, because
the stems don't overlap with note heads of differing size.
So, that's the problem. Any comments as to the best solution?
John