can a Scheme engraver "solve" Issue #34 (grace note bug)? [cross-posted]

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

can a Scheme engraver "solve" Issue #34 (grace note bug)? [cross-posted]

Kieren MacMillan
Hi all,

Here’s the brainstorm I’ve currently got going:

Issue #34, a.k.a. the grace note bug, is one of Lilypond’s longest-standing and most newbie-unfriendly issues. It doesn’t appear in single-staff scores, obviously — only in multi-staff scores where one staff has a grace note [in the note code] and one or more other staves don’t.

So…

Can Someone™ write a Scheme engraver that listens for grace events and automagically adds grace skips of equal duration at the same moment in all other staves of a given score? *Intuitively*, \consist-ing that engraver into a score sounds to me like the perfect (Band-Aid™?) solution, modulo what is apparently a very difficult and/or time-consuming recoding of some deep fundamentals in Lilypond’s timing codebase.

Let me know if I’m just talking nonsense.
If not, let me know how I can help make this "fix" a reality.

Thanks,
Kieren.
________________________________

Kieren MacMillan, composer (he/him/his)
‣ website: www.kierenmacmillan.info
‣ email: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: can a Scheme engraver "solve" Issue #34 (grace note bug)? [cross-posted]

Thomas Morley-2
Am Fr., 7. Feb. 2020 um 14:46 Uhr schrieb Kieren MacMillan
<[hidden email]>:

>
> Hi all,
>
> Here’s the brainstorm I’ve currently got going:
>
> Issue #34, a.k.a. the grace note bug, is one of Lilypond’s longest-standing and most newbie-unfriendly issues. It doesn’t appear in single-staff scores, obviously — only in multi-staff scores where one staff has a grace note [in the note code] and one or more other staves don’t.
>
> So…
>
> Can Someone™ write a Scheme engraver that listens for grace events and automagically adds grace skips of equal duration at the same moment in all other staves of a given score? *Intuitively*, \consist-ing that engraver into a score sounds to me like the perfect (Band-Aid™?) solution, modulo what is apparently a very difficult and/or time-consuming recoding of some deep fundamentals in Lilypond’s timing codebase.
>
> Let me know if I’m just talking nonsense.
> If not, let me know how I can help make this "fix" a reality.
>
> Thanks,
> Kieren.
> ________________________________
>
> Kieren MacMillan, composer (he/him/his)
> ‣ website: www.kierenmacmillan.info
> ‣ email: [hidden email]
>
>

Hi Kieren,

although I did not try, I can't imagine an engraver could work.

Though, maybe checkout the link given here
https://sourceforge.net/p/testlilyissues/issues/34/?page=1&limit=25#2eca

Cheers,
  Harm

Reply | Threaded
Open this post in threaded view
|

Re: can a Scheme engraver "solve" Issue #34 (grace note bug)? [cross-posted]

Han-Wen Nienhuys-3
In reply to this post by Kieren MacMillan
On Fri, Feb 7, 2020 at 2:46 PM Kieren MacMillan <
[hidden email]> wrote:

> Hi all,
>
> Here’s the brainstorm I’ve currently got going:
>
> Issue #34, a.k.a. the grace note bug, is one of Lilypond’s
> longest-standing and most newbie-unfriendly issues. It doesn’t appear in
> single-staff scores, obviously — only in multi-staff scores where one staff
> has a grace note [in the note code] and one or more other staves don’t.
>
> So…
>
> Can Someone™ write a Scheme engraver that listens for grace events and
> automagically adds grace skips of equal duration at the same moment in all
> other staves of a given score? *Intuitively*, \consist-ing that engraver
> into a score sounds to me like the perfect (Band-Aid™?) solution, modulo
> what is apparently a very difficult and/or time-consuming recoding of some
> deep fundamentals in Lilypond’s timing codebase.
>
> Let me know if I’m just talking nonsense.
> If not, let me know how I can help make this "fix" a reality
>


Unfortunately, it's not obvious where to insert the skips. Consider this

staff1 : grace 16th,  whole note

staff2 :  X, whole note

now, if X is a \clef, you probably want to insert the skip after the X, but
if X is a \once \override for the NoteHead, adding a skip after X will make
it inoperable.

I fear this is essentially unsolvable in the current model.

I think the right solution would be to kill grace timing altogether, and
initiate some sort special "embedded" engraving pass that creates the Grace
grobs all at once.

That would have another downside: if we construct the grace note grobs in a
special pass, there is nothing to synchronize them across staves. You could
have two-handed piano music where the left and right hand do grace notes in
a synchronized way. I don't if that exists in practice, but it is one of
the reasons for the current approach.

--
Han-Wen Nienhuys - [hidden email] - http://www.xs4all.nl/~hanwen
Reply | Threaded
Open this post in threaded view
|

Re: can a Scheme engraver "solve" Issue #34 (grace note bug)? [cross-posted]

Lukas-Fabian Moser
Am 08.02.20 um 21:44 schrieb Han-Wen Nienhuys:
> I think the right solution would be to kill grace timing altogether, and
> initiate some sort special "embedded" engraving pass that creates the Grace
> grobs all at once.
>
> That would have another downside: if we construct the grace note grobs in a
> special pass, there is nothing to synchronize them across staves. You could
> have two-handed piano music where the left and right hand do grace notes in
> a synchronized way. I don't if that exists in practice, but it is one of
> the reasons for the current approach.

I would expect that synchronized grace notes do exist. But more often
than not, at least one solitary grace note is meant to happen "some
infinitesimal amount of time before the main note", without a need to
keep track of (so-to-say) different lengths of infinitesimal moments
across voices/staves.

Hence, in combination with accidentals, the current approach leads to
ugly things like

\version "2.19.82"

<<
   \new Staff { \grace a'8 gis'2 }
   \new Staff { \grace dis'8 e'2 }
 >>

(which I encountered quite a lot when engraving, for instance, examples
from Mozart chamber music).

My standard workaround is to allow LilyPond to use two different points
in grace time:

\version "2.19.82"

<<
   \new Staff { \grace a'8 gis'2 }
   \new Staff { \grace dis'8*1/2 e'2 }
 >>

But that's also not ideal, firstly from a semantic point of view,
secondly because the visual outcome depends on the chosen factor, while
I basically want Lily to put the grace not "as close as
possible/graphically sensible" to the main note.

Best
Lukas


Reply | Threaded
Open this post in threaded view
|

Re: can a Scheme engraver "solve" Issue #34 (grace note bug)? [cross-posted]

benko.pal
In reply to this post by Han-Wen Nienhuys-3
Han-Wen Nienhuys <[hidden email]> ezt írta (időpont: 2020. febr. 8., Szo
21:44):

>
>
> If we construct the grace note grobs in a
> special pass, there is nothing to synchronize them across staves. You could
> have two-handed piano music where the left and right hand do grace notes in
> a synchronized way. I don't if that exists in practice, but it is one of
> the reasons for the current approach.
>

IIRC the flower motif of the Turangalila symphony is notated just like
that.  It's a simple note-for-note example; I'll try to find more complex
examples.

p

>
Reply | Threaded
Open this post in threaded view
|

Re: can a Scheme engraver "solve" Issue #34 (grace note bug)? [cross-posted]

David Kastrup
In reply to this post by Han-Wen Nienhuys-3
Han-Wen Nienhuys <[hidden email]> writes:

> Unfortunately, it's not obvious where to insert the skips. Consider this
>
> staff1 : grace 16th,  whole note
>
> staff2 :  X, whole note
>
> now, if X is a \clef, you probably want to insert the skip after the X, but
> if X is a \once \override for the NoteHead, adding a skip after X will make
> it inoperable.
>
> I fear this is essentially unsolvable in the current model.
>
> I think the right solution would be to kill grace timing altogether, and
> initiate some sort special "embedded" engraving pass that creates the Grace
> grobs all at once.
>
> That would have another downside: if we construct the grace note grobs in a
> special pass, there is nothing to synchronize them across staves. You could
> have two-handed piano music where the left and right hand do grace notes in
> a synchronized way. I don't if that exists in practice, but it is one of
> the reasons for the current approach.

I don't think grace notes are usually synchronized optically.  I may be wrong.

--
David Kastrup

Reply | Threaded
Open this post in threaded view
|

Re: can a Scheme engraver "solve" Issue #34 (grace note bug)? [cross-posted]

Kieren MacMillan
Hi David (et al.),

> I don't think grace notes are usually synchronized optically.

According to our recent "live-from-London" keynote speaker…  ;)

… you are correct — in fact, in one example, she shows how grace groups [of different "sizes"] on two different staves can be compressed [to the right] to be closer to the principal note/beat, thus "ruining" any optical synchronization between the staves.

Cheers,
Kieren.
________________________________

Kieren MacMillan, composer (he/him/his)
‣ website: www.kierenmacmillan.info
‣ email: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: can a Scheme engraver "solve" Issue #34 (grace note bug)? [cross-posted]

David Kastrup
Kieren MacMillan <[hidden email]> writes:

> Hi David (et al.),
>
>> I don't think grace notes are usually synchronized optically.
>
> According to our recent "live-from-London" keynote speaker…  ;)
>
> … you are correct — in fact, in one example, she shows how grace
> groups [of different "sizes"] on two different staves can be
> compressed [to the right] to be closer to the principal note/beat,
> thus "ruining" any optical synchronization between the staves.

Frankly, my own take on what that means would not have been to abolish
grace time: it's still useful for identifying things.  But rather to
reduce NoteColumn/MusicalColumn sharing/alignment during grace time to
being just per-Staff, or possibly as option per-Voice.  That would
allow, for special cases, to still blow it up back to being per Score.

One thing I find irritating about grace time is what it does graphically
and in midi to an appoggiatura.  Those are usually supposed to come
on-time, have at _least_ the nominal duration and steal time from the
_next_ rather than the previous note.

--
David Kastrup
My replies have a tendency to cause friction.  To help mitigating
damage, feel free to forward problematic posts to me adding a subject
like "timeout 1d" (for a suggested timeout of 1 day) or "offensive".