point-and-click to the finger not the moon

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

point-and-click to the finger not the moon

Pierre-Luc Gauthier
Hello there,

I guess my question would be, where does the "point-and-click"
embedded reference (li . col) points to? and how could I make point it
shallower (i.e. make it point to "the finger" and not the moon)

Since am I using lots of \quoteDuring and \cueDuring, I often get in
the situation where it gets quite hard to know where I am in the code
especially in large pieces.

I tried making a very simple command to show me "where am I" in the
code by producing some clickable arbitrary markup. The usage would be
to sprinkle this command in some blind notation (e.g. {s1*8\wtfami
s1*8\wtfami} etc) and later click on these instancies to get to where
the command was called in the code. Producing the grob is working fine
as expected; but when I click on the said grob, it obviously jumps to
the command itself rather than to where it was called.

Thinking out loud : I know some command (e.g. the slur of the
\acciaccatura command) points to internal LilyPond code. I suppose it
is an error as most command I enter points to my own code. So I
suspect there is a way of adjusting how deep the point-and-click
function points to.

Is there a way to "promote" (I have no idea of what I'm talking about)
my \wtfami markup to include its position *where it was called* in the
generated grob?

'hope this makes sense to you all…

MWE :
http://lilybin.com/kbeps8/1
%%%%%%%%%%%%%%%%% BEGIN
\version "2.19.63"

wtfami = <>^\markup {
  \fontsize #5
  \bold
  "!"
}

quoted = \relative c' {
  \repeat unfold 8 {
    c4 \acciaccatura cis8 d4 f
  }
}
\addQuote "quoted" \quoted

someStaff = \new Staff {
  \quoteDuring "quoted" {
    s1*2 |
    \wtfami
    s1*2 |
    \wtfami
    s1*2 |
  }
}

\score {
  \someStaff
  \layout {}
}
%%%%%%%%%%%%%%%%% END

Thanks
--
Pierre-Luc Gauthier

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user

wtfami.ly (458 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: point-and-click to the finger not the moon

Kieren MacMillan
Hi Pierre-Luc,

> where does the "point-and-click"
> embedded reference (li . col) points to? and how could I make point it
> shallower (i.e. make it point to "the finger" and not the moon)

This is something I'm struggling with, as well.

On a related note: Do you use Frescobaldi? I imagine the implementation of a really good solution to this problem would be easier there than "in the wild"… Maybe something like: right-click on a grob to get a list of possible targets in the code (e.g., "Staff, Voice, quoted source, Lilypond definition of 'acciaccatura'"), select item and be taken to that 'level'.

Sorry I don't have an actual answer for you… but I'm interested in hearing where this thread goes.

Best,
Kieren.
________________________________

Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: [hidden email]


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: point-and-click to the finger not the moon

Pierre-Luc Gauthier
Thanks for the reply Kieren,

> On a related note: Do you use Frescobaldi?

Mainly yes.
Although I am using emacs more and more on a daily basis and I expect
to migrate my LilyPond workflow into it the following years.


> I imagine the implementation of a really good solution to this problem would be easier there than "in the wild"…

I'm not sure I understand what you mean.


> Maybe something like: right-click on a grob to get a list of possible targets in the code (e.g., "Staff, Voice, quoted source, Lilypond definition of 'acciaccatura'"), select item and be taken to that 'level'.

IFAIK, no such information are contained in the PDF itself which would
mean Frescobaldi (or any other editor) would have to infer it from the
code (quite the impossible), is that what you mean?


--
Pierre-Luc Gauthier

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: point-and-click to the finger not the moon

Kieren MacMillan
Hi Pierre-Luc,

>> On a related note: Do you use Frescobaldi?
>
> Mainly yes.
> Although I am using emacs more and more on a daily basis and I expect
> to migrate my LilyPond workflow into it the following years.

Interesting!

>> I imagine the implementation of a really good solution to this problem would be easier there than "in the wild"…
>
> I'm not sure I understand what you mean.

Well, an IDE would be able to do more with the information provided by a PDF link than a simple text editor.

>> Maybe something like: right-click on a grob to get a list of possible targets in the code (e.g., "Staff, Voice, quoted source, Lilypond definition of 'acciaccatura'"), select item and be taken to that 'level'.
>
> IFAIK, no such information are contained in the PDF itself which would
> mean Frescobaldi (or any other editor) would have to infer it from the
> code (quite the impossible), is that what you mean?

Yes. Why is that impossible? If the link is attached to (e.g.) a NoteHead grob which is inside a quote defined in VariableA but incorporated into VoiceB and displayed in StaffC, why couldn't the editor work out a target list like:

   StaffC
   StaffC > VoiceB
   StaffC > VoiceB > VariableA

??

Right now, Frescobaldi knows how to "Jump to definition" from some bits of code to others… In fact, given

   \new Staff << \globalStuff \noteStuff >>

one can already [in Frescobaldi] click on either \globalStuff or \noteStuff and be taken to that part of the code. I don't immediately see why what I've outlined above isn't just a fancy version of this existing feature.

Thanks,
Kieren.
________________________________

Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: [hidden email]


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: point-and-click to the finger not the moon

Pierre-Luc Gauthier
>>> Maybe something like: right-click on a grob to get a list of possible targets in the code (e.g., "Staff, Voice, quoted source, Lilypond definition of 'acciaccatura'"), select item and be taken to that 'level'.
>>
>> IFAIK, no such information are contained in the PDF itself which would
>> mean Frescobaldi (or any other editor) would have to infer it from the
>> code (quite the impossible), is that what you mean?
>
> Yes. Why is that impossible? If the link is attached to (e.g.) a NoteHead grob which is inside a quote defined in VariableA but incorporated into VoiceB and displayed in StaffC, why couldn't the editor work out a target list like:
>
>    StaffC
>    StaffC > VoiceB
>    StaffC > VoiceB > VariableA
>
> ??

How could the editor know?
What if VariableA is used by two voices? Which one should it refer to?
And how would it know it refers to that voice in the first place?

I usually write things as separated as possible keeping most the
content out and far from the presentation.
Roughly, oboeI = {lotsOfMusic} which is in its own file (e.g.
oboeI.ily) with no include in *that* file; the editor is in a dead
end.
And somewhere else, in a whole other obscure file, that oboeI variable
gets called in by oboeI-IIPart partcombine stuff, oboeI for clarinet
in A, oboeI for clarinet in Bf, and in the concert pitch score and
finally in the transposed one.
To what voice should it refer to? (let alone what staff uses it‽)
And how could the program (e.g. Frescobaldi) know how to list those
voices (Staff, etc)?
From what I understand, the editor would have to be at least as wise
as LilyPond to figure that out.

> Right now, Frescobaldi knows how to "Jump to definition" from some bits of code to others… In fact, given
>    \new Staff << \globalStuff \noteStuff >>
> one can already [in Frescobaldi] click on either \globalStuff or \noteStuff and be taken to that part of the code. I don't immediately see why what I've outlined above isn't just a fancy version of this existing feature.

Well, in most of my files, Frescobaldi fails to "Jump to [my] definition"s.
It just cannot look around in my whole project(computer) to know where
that definition is.

% \begin{bogus example} :
definitions.ily : someCommand = {…}
music.ily : music = {…}
theContent.ily : <<\someCommand \music>>
engravePlease.ly = \include "music.ily" \include "definitions.ily"
\include "theContent.ily"

--
Pierre-Luc Gauthier

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: point-and-click to the finger not the moon

Kieren MacMillan
Hi Pierre-Luc,

> How could the editor know?
> What if VariableA is used by two voices? Which one should it refer to?

The one you clicked on in the PDF.  ;)

I suppose in the *extremely rare* circumstance that a single grob is contained at exactly the same [physical] spot in the same parent (e.g., Staff) context in two or more different Voice contexts and the source of that grob is a variable… well, I guess the editor would have to give up or present multiple targets. But I've never had or seen that situation in my 16 years of using Lilypond — I can't even quite figure out how it could happen…

> From what I understand, the editor would have to be at least as wise
> as LilyPond to figure that out.

No… it already has the PDF to work backwards from (which Lilypond doesn't).

> Well, in most of my files, Frescobaldi fails to "Jump to [my] definition"s.
> It just cannot look around in my whole project(computer) to know where
> that definition is.
>
> % \begin{bogus example} :
> definitions.ily : someCommand = {…}
> music.ily : music = {…}
> theContent.ily : <<\someCommand \music>>
> engravePlease.ly = \include "music.ily" \include "definitions.ily"
> \include "theContent.ily"

I still don't see how that path can't be navigated in reverse (i.e., from the PDF back to the source locations): if you can do it manually (which I'm sure you can), then it almost certainly can be automated.

Cheers,
Kieren.
________________________________

Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: [hidden email]


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: point-and-click to the finger not the moon

Pierre-Luc Gauthier
2017-06-14 17:34 GMT-04:00 Kieren MacMillan <[hidden email]>:
>> How could the editor know?
>> What if VariableA is used by two voices? Which one should it refer to?
>
> The one you clicked on in the PDF.  ;)

Oooh, so you mean that grobs now containing mostly a
textedit:///path/to/file:line:column:something could then include much
more stuff.
A sort of dictionary containing lots of information (voice staff and
so many possible mores! ;-) ) that some editor could fetch and
interpret and link to. That sounds awesome (from my
no-so-much-of-a-real-programmer point of view) !

If I understand correctly that implies LilyPond should provide each
grob with such information encapsulation for an eventual
"point-and-choose-and-click" interface.

So is /that/ what your saying?

--
Pierre-Luc Gauthier

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: point-and-click to the finger not the moon

Kieren MacMillan
Hi Pierre-Luc,

> Oooh, so you mean that grobs now containing mostly a
> textedit:///path/to/file:line:column:something could then include much
> more stuff. A sort of dictionary containing lots of information (voice staff and
> so many possible mores! ;-) ) that some editor could fetch and
> interpret and link to.

Precisely.  =)

> If I understand correctly that implies LilyPond should provide each
> grob with such information encapsulation for an eventual
> "point-and-choose-and-click" interface.
>
> So is /that/ what your saying?

Yes. My intuition says that if it simply gave the TOP-LEVEL file:line:column, the editor could take it from there — if not, then a contextid:moment should certainly be enough.

Anyway, I think we can at least agree that:
    (1) the current situation is insufficient; and
    (2) it's not a moon-shot to a much more useful situation.

More soon!
Kieren.
________________________________

Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: [hidden email]


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user