lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Change stem direction based on position of note in staff?


From: Stefano Antonelli
Subject: Re: Change stem direction based on position of note in staff?
Date: Fri, 30 Aug 2024 02:10:13 +0000
User-agent: Evolution 3.36.5-0ubuntu1

On Thu, 2024-08-29 at 09:49 +0200, Lukas-Fabian Moser wrote:
> Hi Stefano,

Hi Lukas,

> Am 28.08.24 um 16:59 schrieb Stefano Antonelli:
> > Would it be possible to change the stem direction of a note based
> > on
> > it's position on the staff?
> 
> This is the easiest of your questions, since this can be done using a
> callback on Stem.direction:

<SNIP>

> But this approach doesn't mix well with \voiceOne, polyphony etc.
> since
> these also override Stem.direction, so I don't know if this is good
> enough for you.

Firstly, thanks very much for the help.  This approach does not work
well with polyphony as you suggest.  I did give it a try.

> A more robust solution would involve a (simple) custom engraver that
> does the same thing but without the need to override Stem.direction;
> would you be interested in that?

I very much appreciate the offer.  However, I'm beginning to see why
this approach isn't going to get me what I want because it's not just
the stem directions that need to change.

> The strategies you proposed - if I understand correctly, putting
> notes
> in different voices depending on their pitch / staff position - are
> considerably more involved than just setting the Stem direction
> (whether
> in a callback like I did above or in an engraver).

The approach of moving notes to different voices doesn't solve the core
problem either.  Now that I've thought about it.

The core problem is that I can't just move notes.  The duration of both
notes and rests (silent or otherwise) need to be *recomputed* when two
or more voices are *combined into one*.  If there's a way to do this
with lilypond, I don't know about it.  It seems hard and I would be
surprised if it's something lilypond can do.

Although I wonder if a trip through midi and back could somehow be used
to parse the note durations and rests to create custom combinations of
voices?  If nothing else midi2ly should be able to create a single
voice notation?  I'll have to play with it.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]