[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lilypond-user
Subject:    Re: Getting grob Y position (spacing error)
From:       Gregory Evans <gregoryrowlandevans () gmail ! com>
Date:       2022-12-31 18:43:25
Message-ID: CA+Y=1vg0bXw9PeOgqqWRGsQ_NrSNPr7oOmfkbimCqqv=Qriiiw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi Jean,
I tried experimenting with your engraver in order to better learn how it
works and also to see if I could recreate some of the functionality of the
Johnston example I showed previously. In this engraver, based on the
interruption engraver, the VoiceFollower stencil is written as usual. I
wanted to give this version functionality a little more similar to the way
text spanners work by creating a start and a stop command. So, as the
following note is chosen, it is not the immediately following non-rest
which is selected, rather the first item with a followable value set to ##t.

#(define (Follow_lines_engraver context)
   (let ((followed (make-hash-table)))
     (make-engraver
      (acknowledgers
       ((note-column-interface engraver grob source-engraver)
        (when
            (assoc-get 'followable (ly:grob-property grob 'details '()))
          (for-each
           (match-lambda
            ((mom . elt)
             (when (and (grob::has-interface elt 'note-head-interface)
                        (assoc-get 'follow (ly:grob-property elt 'details '()))
                        (not (hashq-ref followed elt))
                        )
               (hashq-set! followed elt #t)
               (let ((follower (ly:engraver-make-grob engraver
'VoiceFollower '())))
                 (ly:spanner-set-bound! follower LEFT elt)
                 (ly:spanner-set-bound! follower RIGHT grob)
                 (ly:grob-set-property! follower 'color (assoc-get
'follow-color (ly:grob-property elt 'details '())))
                 ))
            ))
           (ly:context-property context 'busyGrobs))))))))

The start and stop commands look like this:

start-follow = \once \override Staff.NoteHead.details.follow = ##t
stop-follow = \once \override Staff.NoteColumn.details.followable = ##t

But I seem to be learning something about lilypond and note columns which I
previously did not understand, which leads to a question. Why is it that
some notes cannot be selected on the right side? Take the following example:
[image: arbitrary-lines.png]
It appears to be the case that there is a limitation to how far to the
right notes can be checked. Let's call the starting note A and the stopping
note B. It seems like the boundary is if the start-offset of B is further
forward than the stop-offset of A. In the above image, a line cannot be
drawn between the 2nd note of the top staff and the 8th note of the middle
staff. Can you explain why this is? Is this a situation where the note
columns are not finished being spaced, similar to my initial confusion
about the timing of skyline calculation? Anyway, the ability to draw lines
between any arbitrary location is not precisely necessary for what I'm
trying to accomplish, I would just like to understand what I don't know!

regards,
GR

p.s. In the Johnston example, notes are able to be used as line anchors
more than once. Would there be a way to include something like a spanner ID?

On Tue, Dec 27, 2022 at 6:24 PM Jean Abou Samra <jean@abou-samra.fr> wrote:

> Le 26/12/2022 à 19:18, Gregory Evans a écrit :
> > Hi Jean,
> > I apologize for my delayed reply.
> >
> > I do not think I can use the VoiceFollower grob because I am not using
> > staff changes.
>
>
>
> You can. A VoiceFollower won't be created automatically without a staff
> change, but you can create it yourself in your Scheme engraver.
>
>
>
> > Attached is a pdf of what I am trying to do. It works successfully if
> > I input the y-position by hand but ideally it would be calculated
> > automatically. You see, they are completely unrelated voices. Also see
> > this image of hocket indications in Ben Johnston's 3rd string quartet
> > which I think would not be done with VoiceFollower:
> >
> >  I have also included the lilypond file for my interruptive polyphony
> > example if that is of any use to you even though it is quite large.
> > While it's true that certain aspects of the process could be
> > simplified (such as removing the use of 'meta as you suggest), there
> > is little reason to revise it if the callback cannot be delayed until
> > after the skyline calculation. Is there no way to simply trigger
> > callback at a later time?
>
>
> "Trigger callback at a later time" sounds like you are thinking
> too much in imperative programming terms of "get parameters, set
> stencil to what I want". That's not how most of LilyPond's backend
> works, with the exception of after-line-breaking and a few other
> properties. Instead, you build callbacks that compute the initial
> values of properties (instead of getting their values and changing
> them). See also this recent discussion:
>
> https://lists.gnu.org/archive/html/lilypond-user/2022-12/msg00001.html
>
> Thus, the question is not "how to trigger this callback at a later
> time, so it knows everything" but "how to ensure that nothing this
> callback depends on also depends on it, so there are no cyclic
> dependencies". The answer is the cross-staff property, as I explained
> previously, on a grob that supports it like VoiceFollower (but
> not NoteHead).
>
> See the attached file for an implementation of your graphical
> notation. I basically started from scratch because it was simpler,
> so its exact behavior might deviate from what you wanted (there
> were some oddities in your original code and I don't know which
> of them were intentional), but it outputs the same thing on the
> excerpt you give, and it should get you going.
>
> By the way, not sure if you or Piaras is the author of the PostScript
> code, but if you are, please read the documentation of \postscript
> <https://lilypond.org/doc/v2.24/Documentation/notation/graphic>
> on why you should only use embedded PostScript code if you absolutely
> need it, which is not the case here (make-path-stencil does the job).
>
> Best,
> Jean
>
>

-- 
gregory rowland evans
http://www.gregoryrowlandevans.com
https://github.com/GregoryREvans
https://soundcloud.com/gregory-rowland-evans

[Attachment #5 (text/html)]

<div dir="ltr"><div class="markdown-here-wrapper" style=""><p style="margin:0px 0px \
1.2em!important">Hi Jean,<br>I tried experimenting with your engraver in order to \
better learn how it works and also to see if I could recreate some of the \
functionality of the Johnston example I showed previously. In this engraver, based on \
the interruption engraver, the VoiceFollower stencil is written as usual. I wanted to \
give this version functionality a little more similar to the way text spanners work \
by creating a start and a stop command. So, as the following note is chosen, it is \
not the immediately following non-rest which is selected, rather the first item with \
a <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px \
0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid \
rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">followable</code> \
value set to <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px \
0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid \
rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">##t</code>.</p>
 <pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em \
0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px \
0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid \
rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre;overflow:auto;border-radius:3px;border:1px \
solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important">#(define \
(Follow_lines_engraver context)  (let ((followed (make-hash-table)))
     (make-engraver
      (acknowledgers
       ((note-column-interface engraver grob source-engraver)
        (when
            (assoc-get &#39;followable (ly:grob-property grob &#39;details &#39;()))
          (for-each
           (match-lambda
            ((mom . elt)
             (when (and (grob::has-interface elt &#39;note-head-interface)
                        (assoc-get &#39;follow (ly:grob-property elt &#39;details \
&#39;()))  (not (hashq-ref followed elt))
                        )
               (hashq-set! followed elt #t)
               (let ((follower (ly:engraver-make-grob engraver &#39;VoiceFollower \
&#39;())))  (ly:spanner-set-bound! follower LEFT elt)
                 (ly:spanner-set-bound! follower RIGHT grob)
                 (ly:grob-set-property! follower &#39;color (assoc-get \
&#39;follow-color (ly:grob-property elt &#39;details &#39;())))  ))
            ))
           (ly:context-property context &#39;busyGrobs))))))))
</code></pre><p style="margin:0px 0px 1.2em!important">The start and stop commands \
look like this:</p> <pre \
style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em \
0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px \
0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid \
rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre;overflow:auto;border-radius:3px;border:1px \
solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important">start-follow = \
\once \override Staff.NoteHead.details.follow = ##t stop-follow = \once \override \
Staff.NoteColumn.details.followable = ##t </code></pre><p style="margin:0px 0px \
1.2em!important">But I seem to be learning something about lilypond and note columns \
which I previously did not understand, which leads to a question. Why is it that some \
notes cannot be selected on the right side? Take the following example:<br><img \
src="cid:ii_lcc9v7vw0" alt="arbitrary-lines.png" width="562" height="173"><br>It \
appears to be the case that there is a limitation to how far to the right notes can \
be checked. Let's call the starting note <code \
style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px \
0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid \
rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">A</code> \
and the stopping note <code \
style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px \
0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid \
rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">B</code>. \
It seems like the boundary is if the start-offset of <code \
style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px \
0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid \
rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">B</code> \
is further forward than the stop-offset of <code \
style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px \
0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid \
rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">A</code>. \
In the above image, a line cannot be drawn between the 2nd note of the top staff and \
the 8th note of the middle staff. Can you explain why this is? Is this a situation \
where the note columns are not finished being spaced, similar to my initial confusion \
about the timing of skyline calculation? Anyway, the ability to draw lines between \
any arbitrary location is not precisely necessary for what I'm trying to accomplish, \
I would just like to understand what I don't know!</p> <p style="margin:0px 0px \
1.2em!important">regards,<br>GR</p><p style="margin:0px 0px 1.2em!important">p.s. In \
the Johnston example, notes are able to be used as line anchors more than once. Would \
there be a way to include something like a spanner ID?</p> <div \
title="MDH:SGkgSmVhbiw8ZGl2PkkgdHJpZWQgZXhwZXJpbWVudGluZyB3aXRoIHlvdXIgZW5ncmF2ZXIgaW4g
 b3JkZXIgdG8gYmV0dGVyIGxlYXJuIGhvdyBpdCB3b3JrcyBhbmQgYWxzbyB0byBzZWUgaWYgSSBj
b3VsZCByZWNyZWF0ZSBzb21lIG9mIHRoZSBmdW5jdGlvbmFsaXR5IG9mIHRoZSBKb2huc3RvbiBl
eGFtcGxlIEkgc2hvd2VkIHByZXZpb3VzbHkuIEluIHRoaXMgZW5ncmF2ZXIsIGJhc2VkIG9uIHRo
ZSBpbnRlcnJ1cHRpb24gZW5ncmF2ZXIsIHRoZSBWb2ljZUZvbGxvd2VyIH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HN0b3BwaW5nIG5v
dGUgYEJgLiBJdCBzZWVtcyBsaWtlIHRoZSBib3VuZGFyeSBpcyBpZiB0aGUgc3RhcnQtb2Zmc2V0
IG9mIGBCYCBpcyBmdXJ0aGVyIGZvcndhcmQgdGhhbiB0aGUgc3RvcC1vZmZzZXQgb2YgYEFgLiBJ
biB0aGUgYWJvdmUgaW1hZ2UsIGEgbGluZSBjYW5ub3QgYmUgZHJhd24gYmV0d2VlbiB0aGUgMm5k
IG5vdGUgb2YgdGhlIHRvcCBzdGFmZiBhbmQgdGhlIDh0aCBub3RlIG9mIHRoZSBtaWRkbGUgc3Rh
ZmYuIENhbiB5b3UgZXhwbGFpbiB3aHkgdGhpcyBpcz8gSXMgdGhpcyBhIHNpdHVhdGlvbiB3aGVy
ZSB0aGUgbm90ZSBjb2x1bW5zIGFyZSBub3QgZmluaXNoZWQgYmVpbmcgc3BhY2VkPyAoc2ltaWxh
ciB0byBteSBpbml0aWFsIGNvbmZ1c2lvbiBhYm91dCB0aGUgdGltaW5nIG9mIHNreWxpbmUgY2Fs
Y3VsYXRpb24pIEFueXdheSwgdGhlIGFiaWxpdHkgdG8gZHJhdyBsaW5lcyBiZXR3ZWVuIGFueSBh
cmJpdHJhcnkmbmJzcDtsb2NhdGlvbiBpcyBub3QgcHJlY2lzZWx5IG5lY2Vzc2FyeSBmb3Igd2hh
dCBJJ20gdHJ5aW5nIHRvIGFjY29tcGxpc2gsIEkgd291bGQganVzdCBsaWtlIHRvIHVuZGVyc3Rh
bmQgd2hhdCBJIGRvbid0IGtub3chPC9kaXY+PGRpdj48YnI+PC9kaXY+PGRpdj5yZWdhcmRzLDwv
ZGl2PjxkaXY+R1I8L2Rpdj4=" \
style="height:0;width:0;max-height:0;max-width:0;overflow:hidden;font-size:0em;padding:0;margin:0"></div></div><div></div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 27, 2022 at 6:24 PM \
Jean Abou Samra &lt;<a href="mailto:jean@abou-samra.fr">jean@abou-samra.fr</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Le 26/12/2022 Ã  \
19:18, Gregory Evans a écrit  :<br> &gt; Hi Jean,<br>
&gt; I apologize for my delayed  reply.<br>
&gt;<br>
&gt; I do not think I can use the VoiceFollower grob because I am not using <br>
&gt; staff changes.<br>
<br>
<br>
<br>
You can. A VoiceFollower won&#39;t be created automatically without a staff<br>
change, but you can create it yourself in your Scheme engraver.<br>
<br>
<br>
<br>
&gt; Attached is a pdf of what I am trying to do. It works successfully if <br>
&gt; I input the y-position by hand but ideally it would be calculated <br>
&gt; automatically. You see, they are completely unrelated voices. Also see <br>
&gt; this image of hocket  indications in Ben Johnston&#39;s 3rd string quartet <br>
&gt; which I think would not be done with VoiceFollower:<br>
&gt;<br>
&gt;   I have also included the lilypond file for my interruptive polyphony <br>
&gt; example if that is of any use to you even though it is quite large. <br>
&gt; While it&#39;s true that certain aspects of the process could be <br>
&gt; simplified (such as removing the use of &#39;meta as you suggest), there <br>
&gt; is little reason to revise it if the callback cannot be delayed until <br>
&gt; after the skyline calculation. Is there no way to simply trigger <br>
&gt; callback at a later time?<br>
<br>
<br>
&quot;Trigger callback at a later time&quot; sounds like you are thinking<br>
too much in imperative programming terms of &quot;get parameters, set<br>
stencil to what I want&quot;. That&#39;s not how most of LilyPond&#39;s backend<br>
works, with the exception of after-line-breaking and a few other<br>
properties. Instead, you build callbacks that compute the initial<br>
values of properties (instead of getting their values and changing<br>
them). See also this recent discussion:<br>
<br>
<a href="https://lists.gnu.org/archive/html/lilypond-user/2022-12/msg00001.html" \
rel="noreferrer" target="_blank">https://lists.gnu.org/archive/html/lilypond-user/2022-12/msg00001.html</a><br>
 <br>
Thus, the question is not &quot;how to trigger this callback at a later<br>
time, so it knows everything&quot; but &quot;how to ensure that nothing this<br>
callback depends on also depends on it, so there are no cyclic<br>
dependencies&quot;. The answer is the cross-staff property, as I explained<br>
previously, on a grob that supports it like VoiceFollower (but<br>
not NoteHead).<br>
<br>
See the attached file for an implementation of your graphical<br>
notation. I basically started from scratch because it was simpler,<br>
so its exact behavior might deviate from what you wanted (there<br>
were some oddities in your original code and I don&#39;t know which<br>
of them were intentional), but it outputs the same thing on the<br>
excerpt you give, and it should get you going.<br>
<br>
By the way, not sure if you or Piaras is the author of the PostScript<br>
code, but if you are, please read the documentation of \postscript<br>
&lt;<a href="https://lilypond.org/doc/v2.24/Documentation/notation/graphic" \
rel="noreferrer" target="_blank">https://lilypond.org/doc/v2.24/Documentation/notation/graphic</a>&gt;<br>
 on why you should only use embedded PostScript code if you absolutely<br>
need it, which is not the case here (make-path-stencil does the job).<br>
<br>
Best,<br>
Jean<br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" \
class="gmail_signature"><div dir="ltr"><div><div dir="ltr">gregory rowland \
evans<br><div><div><a href="http://www.gregoryrowlandevans.com/" \
style="color:rgb(17,85,204)" target="_blank"><font face="times new roman, serif" \
size="1">http://www.gregoryrowlandevans.com</font></a><br></div><div><font size="1" \
face="times new roman, serif"><a href="https://github.com/GregoryREvans" \
style="color:rgb(17,85,204)" \
target="_blank">https://github.com/GregoryREvans</a></font><font face="times new \
roman, serif" size="1"><br></font></div><div><a \
href="https://soundcloud.com/gregory-rowland-evans" style="color:rgb(17,85,204)" \
target="_blank"><font face="times new roman, serif" \
size="1">https://soundcloud.com/gregory-rowland-evans</font></a></div></div></div></div></div></div>



["arbitrary-lines.png" (image/png)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic