Re: Graphical markup between objects?

2024-07-30 Thread Fennel
Hi all,

Fixed the fork objects such that they correctly render the apex of the fork 
halfway on the part of the two fingerings. Check it out!

-Fennel

On Tuesday, June 25th, 2024 at 12:34 PM, Fennel  wrote:

> Thanks. As far as the "fork" style is concerned, Aaron, your example is 
> great! Learning a lot :)
>
> It seems like it would be great if the stencil that you've made could be 
> wrapped into the style property, as that's what Lilypond seems to want the 
> user-settable property. The [documentation 
> page](https://lilypond.org/doc/v2.24/Documentation/internals/fingerglidespanner)
>  suggests that valid styles depend on valid stencils, but I can't seem to 
> find a snippet in LSR showing how to actually make that happen.
>
> -Fennel

test.ly
Description: Binary data


test.pdf
Description: Adobe PDF document


Re: Graphical markup between objects?

2024-06-25 Thread Fennel
Thanks. As far as the "fork" style is concerned, Aaron, your example is great! 
Learning a lot :)

It seems like it would be great if the stencil that you've made could be 
wrapped into the style property, as that's what Lilypond seems to want the 
user-settable property. The [documentation 
page](https://lilypond.org/doc/v2.24/Documentation/internals/fingerglidespanner)
 suggests that valid styles depend on valid stencils, but I can't seem to find 
a snippet in LSR showing how to actually make that happen.

-Fennel

Re: Graphical markup between objects?

2024-06-23 Thread Thomas Morley
Am So., 23. Juni 2024 um 19:48 Uhr schrieb Fennel :
>
>
> Wondering if it's possible to override the behavior of the glide line such 
> that the glide will draw to the next fingering regardless of what the second 
> number is.
>
> - Fennel

It's not possible. Think of chords with multiple fingerings, how to decide?
But you can fake it:

{
  b1-\glide -1 b'-\tweak text "2" -1
}

Cheers,
  Harm



Re: Graphical markup between objects?

2024-06-23 Thread Fennel


Wondering if it's possible to override the behavior of the glide line such that 
the glide will draw to the next fingering regardless of what the second number 
is.

- Fennel

On Thursday, May 30th, 2024 at 12:28 AM, Werner LEMBERG  wrote:

> 
> 
> > I was looking for something like "shift line" or "line between
> > fingerings", the latter of which seems to point to the correct page.
> 
> 
> https://gitlab.com/lilypond/lilypond/-/merge_requests/2357
> 
> 
> Werner



Re: Graphical markup between objects?

2024-05-29 Thread Werner LEMBERG


> I was looking for something like "shift line" or "line between
> fingerings", the latter of which seems to point to the correct page.

https://gitlab.com/lilypond/lilypond/-/merge_requests/2357


Werner



Re: Graphical markup between objects?

2024-05-29 Thread Aaron Hill

On 2024-05-28 10:43 am, Fennel wrote:

indicating a “fork”, or the use of two different fingers across
strings at the same “fret”. Is attaching lines like this a
supported feature at the moment, and if not, does anyone have any
ideas on what writing scripts to support this behavior would look
like?



Spent some time working on your "fork" scenario.  Not sure if I got it 
entirely correct.  Attached is the source.  Hope this either gives you 
something you can use directly, or at a minimum gives you something to 
work from.



-- Aaron Hill\version "2.25.13"


#(define (finger-glide-fork::print grob)
  (let* ((thickness (* (ly:grob-property grob 'thickness 1)
   (ly:staff-symbol-line-thickness grob)))
 (left-bound-info (ly:grob-property grob 'left-bound-info))
 (right-bound-info (ly:grob-property grob 'right-bound-info))
 (left-padding (assoc-get 'padding left-bound-info 0.5))
 (right-padding (assoc-get 'padding right-bound-info 0.5))
 (left-bound (ly:spanner-bound grob LEFT))
 (system (ly:grob-system grob))
 (left-relative-coord (ly:grob-relative-coordinate left-bound system X))
 (left-X (assoc-get 'X left-bound-info))
 (x-start (- left-X left-relative-coord (- left-padding)))
 (right-X (assoc-get 'X right-bound-info))
 (x-end (- right-X left-relative-coord (+ right-padding)))
 (y-start (assoc-get 'Y left-bound-info))
 (y-end (assoc-get 'Y right-bound-info))

 (details (ly:grob-property grob 'details '()))
 (fork-height (assoc-get 'fork-height details 0.5))
 (direction (ly:grob-property left-bound 'direction))
 (minmax (if (< 0 direction) max min))
 (apex-delta (* direction fork-height))
 (fork-apex-x (/ (+ x-start x-end) 2))
 (fork-apex-y (minmax (+ y-start apex-delta)
  (+ y-end apex-delta
(ly:stencil-add
  (make-line-stencil
thickness x-start y-start fork-apex-x fork-apex-y)
  (make-line-stencil
thickness fork-apex-x fork-apex-y x-end y-end))
))

#(define (ly:pitch=? p q) (not (or (ly:pitch$duration <$second -1> #}
#{ <$first \glide -1>$duration <$second -1>
   <$second \glide -1> <$first -1> #}))

testCases =
{
  \cadenzaOn
  \set fingeringOrientations = #'(up)
  \makeGlide e'' e'' 4
  \makeGlide e'' f'' 4
  \makeGlide e'' g'' 4
  \makeGlide e'' a'' 4
  \makeGlide e'' b'' 4
  \bar "."
  \set fingeringOrientations = #'(down)
  \makeGlide f' f' 4
  \makeGlide f' e' 4
  \makeGlide f' d' 4
  \makeGlide f' c' 4
  \makeGlide f' b 4
  \bar "|."
}

\paper {
  #(set-paper-size "ledger")
  indent = 0 ragged-right = ##f line-width = 13\in
}

\markup \huge { "Test cases using original" \concat { \bold \typewriter 
"finger-glide::print" : } }
\new Staff { \testCases }
\markup \vspace #1

\markup \huge { "Test cases using custom" \concat { \bold \typewriter 
"finger-glide-fork::print" : } }
\new Staff {
  \override FingerGlideSpanner.details.fork-height = 1.5
  \override FingerGlideSpanner.thickness = 2.5
  \override FingerGlideSpanner.stencil = #finger-glide-fork::print
  \testCases
}
\markup \vspace #1


Re: Graphical markup between objects?

2024-05-29 Thread Fennel
I was looking for something like "shift line" or "line between fingerings", the 
latter of which seems to point to the correct page. 

-fennel



Re: Graphical markup between objects?

2024-05-28 Thread Werner LEMBERG


> > Before you go create something yourself, have you looked at what
> > LilyPond supports [1]?  There are built-in options to change the
> > style of the FingerGlideSpanner.  Your "V"-bend shape probably
> > could be added as a new style.
>
> This is exactly what I was looking for! I was unaware that this
> existed; I would have never thought to look for glide.

It seems we have a documentation buglet in the Notation Reference.
Can you suggest one or more index entries that would have helped you
find the proper place in the manual?


Werner



Re: Graphical markup between objects?

2024-05-28 Thread Fennel
Ooh ooh ooh!

This is exactly what I was looking for! I was unaware that this existed; I 
would have never thought to look for glide.

Thank you

-fennel



Re: Graphical markup between objects?

2024-05-28 Thread Aaron Hill

On 2024-05-28 10:43 am, Fennel wrote:

I would like to draw lines between fingerings to indicate shifts,
pivots, etc. on an unfretted string instrument.

Say I have something like the following:

\version "2.24.3"
\relative c' {
c4-1 d-2
}



Before you go create something yourself, have you looked at what 
LilyPond supports [1]?  There are built-in options to change the style 
of the FingerGlideSpanner.  Your "V"-bend shape probably could be added 
as a new style.



[1]: 
https://lilypond.org/doc/v2.25/Documentation/notation/gliding-fingers



-- Aaron Hill



Re: Graphical markup between objects?

2024-05-28 Thread Fennel
Hi Kieren,

Yes, this is a good start! I’d like the fingerings to be engraved as they would 
if they were actual fingering objects. For example, the desired result for the 
following snippet would ideally look like below:

\version "2.24.3"
\relative c' {
 c-1 d''-2
}

[image.png]
instead of being displayed purely horizontally as a TextSpanner would.

-fennel

​
On Tuesday, May 28th, 2024 at 2:35 PM, Kieren MacMillan 
kie...@kierenmacmillan.info wrote:

> Hi Fennel,
>
>> I would like to draw lines between fingerings to indicate shifts, pivots, 
>> etc. on an unfretted string instrument.
>> Say I have something like the following:
>> \version "2.24.3"
>> \relative c' {
>> c4-1 d-2
>> }
>>
>> I would like to produce something similar to the following:
>> 
>> I know that this is achievable using markup and \draw-line as specified 
>> here, but as changes are made to my project and the spacing between notes 
>> changes, I’d have to go back and manually tweak all of the coordinates for 
>> all of the lines in the project, and there will be quite a few.
>
> Maybe this will point you in the right direction?
>
> %%% SNIPPET BEGINS
> \version "2.25.11"
>
> oneTotwo = \relative c' {
> \once \override TextSpanner.style = #'line
> \once \override TextSpanner.thickness = #2
> \once \override TextSpanner.bound-details.left.stencil-align-dir-y = #CENTER
> \once \override TextSpanner.bound-details.right.stencil-align-dir-y = #CENTER
> \once \override TextSpanner.bound-details.left.text = \markup \fontsize #-3 
> \concat { \number "1" \hspace #0.2 }
> \once \override TextSpanner.bound-details.right.text = \markup \fontsize #-3 
> \concat { \hspace #0.2 \number "2" }
> c4\startTextSpan d\stopTextSpan
> }
>
> \score { \oneTotwo }
>
> \score {
> \oneTotwo
> \layout { ragged-right = ##f }
> }
> %%% SNIPPET ENDS
>
> You’d probably want to build a music function to wrap all that stuff so you’d 
> just have to write
>
> \fingspan #'(1 2)
>
> or some such thing.
>
> Hope that helps!
> Kieren.
> __
>
> My work day may look different than your work day. Please do not feel 
> obligated to read or respond to this email outside of your normal working 
> hours.

Re: Graphical markup between objects?

2024-05-28 Thread Kieren MacMillan
Hi Fennel,

> I would like to draw lines between fingerings to indicate shifts, pivots, 
> etc. on an unfretted string instrument.
> Say I have something like the following:
> \version "2.24.3"
> \relative c' {
> c4-1 d-2
> }
> 
> I would like to produce something similar to the following:
> 
> I know that this is achievable using markup and \draw-line as specified here, 
> but as changes are made to my project and the spacing between notes changes, 
> I’d have to go back and manually tweak all of the coordinates for all of the 
> lines in the project, and there will be quite a few.

Maybe this will point you in the right direction?

%%%  SNIPPET BEGINS
\version "2.25.11"

oneTotwo = \relative c' {
\once \override TextSpanner.style = #'line
\once \override TextSpanner.thickness = #2
\once \override TextSpanner.bound-details.left.stencil-align-dir-y = #CENTER
\once \override TextSpanner.bound-details.right.stencil-align-dir-y = 
#CENTER
\once \override TextSpanner.bound-details.left.text = \markup \fontsize #-3 
\concat { \number "1" \hspace #0.2 }
\once \override TextSpanner.bound-details.right.text = \markup \fontsize 
#-3 \concat { \hspace #0.2 \number "2" }
c4\startTextSpan d\stopTextSpan
}

\score { \oneTotwo }

\score {
  \oneTotwo
  \layout { ragged-right = ##f }
}
%%%  SNIPPET ENDS

You’d probably want to build a music function to wrap all that stuff so you’d 
just have to write

   \fingspan #'(1 2)

or some such thing.

Hope that helps!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.