Fingering vs stem direction

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

Fingering vs stem direction

Schneidy
Hi All,

I'm looking for a function that'll do:

{
  \clef "G_8"
  \override Fingering.staff-padding = #'()
  <a-\tweak X-offset #'-.2 ^1>4
  <b-\tweak X-offset #'.2 _2>
}

As a first step, I've tried to adapt Harm's function found here: http://lilypond.1069038.n5.nabble.com/position-text-opposite-stem-direction-td51758.html#a51759
without succes:

%% After Harm:
#(define (forced-dir grob)
  (let* ((x-parent (ly:grob-parent  grob X))
         (elts (ly:grob-object x-parent 'elements))
         (grob-name (lambda (x) (assq-ref (ly:grob-property x 'meta) 'name)))
         (stems (filter (lambda (x) (eq? 'Stem (grob-name x)))
                                (ly:grob-array->list elts)))
         (stem (list-ref stems 0))
         (stem-dir (ly:grob-property stem 'direction)))

    (if (= stem-dir 1)
        (ly:grob-set-property! grob 'direction up)
        (ly:grob-set-property! grob 'direction down))))
 

{
  \clef "G_8"
  \set fingeringOrientations = #'(forced-dir)
  \override Fingering.staff-padding = #'()
  <a-1>4
  <b-2>
}

Thanks in advance for any help,
Cheers,
Pierre


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

Re: Fingering vs stem direction

Thomas Morley-2
Am Mi., 5. Dez. 2018 um 10:26 Uhr schrieb Pierre Perol-Schneider
<[hidden email]>:

>
> Hi All,
>
> I'm looking for a function that'll do:
>
> {
>   \clef "G_8"
>   \override Fingering.staff-padding = #'()
>   <a-\tweak X-offset #'-.2 ^1>4
>   <b-\tweak X-offset #'.2 _2>
> }
>
> As a first step, I've tried to adapt Harm's function found here: http://lilypond.1069038.n5.nabble.com/position-text-opposite-stem-direction-td51758.html#a51759
> without succes:
>
> %% After Harm:
> #(define (forced-dir grob)
>   (let* ((x-parent (ly:grob-parent  grob X))
>          (elts (ly:grob-object x-parent 'elements))
>          (grob-name (lambda (x) (assq-ref (ly:grob-property x 'meta) 'name)))
>          (stems (filter (lambda (x) (eq? 'Stem (grob-name x)))
>                                 (ly:grob-array->list elts)))
>          (stem (list-ref stems 0))
>          (stem-dir (ly:grob-property stem 'direction)))
>
>     (if (= stem-dir 1)
>         (ly:grob-set-property! grob 'direction up)
>         (ly:grob-set-property! grob 'direction down))))
>
>
> {
>   \clef "G_8"
>   \set fingeringOrientations = #'(forced-dir)
>   \override Fingering.staff-padding = #'()
>   <a-1>4
>   <b-2>
> }
>
> Thanks in advance for any help,
> Cheers,
> Pierre
>

Hi Pierre,

this will not work here for several reasons.
Can't look deeper into it right now (have to run for my regular job).
Probably in the evening.

Though, how do you want the fingerings, if you have real chords (more
than one note)?

Cheers,
  Harm

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

Re: Fingering vs stem direction

Schneidy
Thank you Harm,
In this particular case, there is no chord.
Cheers,
Pierre

Le mer. 5 déc. 2018 à 10:44, Thomas Morley <[hidden email]> a écrit :
Am Mi., 5. Dez. 2018 um 10:26 Uhr schrieb Pierre Perol-Schneider
<[hidden email]>:
>
> Hi All,
>
> I'm looking for a function that'll do:
>
> {
>   \clef "G_8"
>   \override Fingering.staff-padding = #'()
>   <a-\tweak X-offset #'-.2 ^1>4
>   <b-\tweak X-offset #'.2 _2>
> }
>
> As a first step, I've tried to adapt Harm's function found here: http://lilypond.1069038.n5.nabble.com/position-text-opposite-stem-direction-td51758.html#a51759
> without succes:
>
> %% After Harm:
> #(define (forced-dir grob)
>   (let* ((x-parent (ly:grob-parent  grob X))
>          (elts (ly:grob-object x-parent 'elements))
>          (grob-name (lambda (x) (assq-ref (ly:grob-property x 'meta) 'name)))
>          (stems (filter (lambda (x) (eq? 'Stem (grob-name x)))
>                                 (ly:grob-array->list elts)))
>          (stem (list-ref stems 0))
>          (stem-dir (ly:grob-property stem 'direction)))
>
>     (if (= stem-dir 1)
>         (ly:grob-set-property! grob 'direction up)
>         (ly:grob-set-property! grob 'direction down))))
>
>
> {
>   \clef "G_8"
>   \set fingeringOrientations = #'(forced-dir)
>   \override Fingering.staff-padding = #'()
>   <a-1>4
>   <b-2>
> }
>
> Thanks in advance for any help,
> Cheers,
> Pierre
>

Hi Pierre,

this will not work here for several reasons.
Can't look deeper into it right now (have to run for my regular job).
Probably in the evening.

Though, how do you want the fingerings, if you have real chords (more
than one note)?

Cheers,
  Harm

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

Re: Fingering vs stem direction

Urs Liska-3


Am 05.12.18 um 10:56 schrieb Pierre Perol-Schneider:
Thank you Harm,
In this particular case, there is no chord.


So why do you need chords at all?

And what are you actually trying to achieve, forcing the fingering on the opposite side of the stem or apply the X-offset tweaks?

Urs


Cheers,
Pierre

Le mer. 5 déc. 2018 à 10:44, Thomas Morley <[hidden email]> a écrit :
Am Mi., 5. Dez. 2018 um 10:26 Uhr schrieb Pierre Perol-Schneider
<[hidden email]>:
>
> Hi All,
>
> I'm looking for a function that'll do:
>
> {
>   \clef "G_8"
>   \override Fingering.staff-padding = #'()
>   <a-\tweak X-offset #'-.2 ^1>4
>   <b-\tweak X-offset #'.2 _2>
> }
>
> As a first step, I've tried to adapt Harm's function found here: http://lilypond.1069038.n5.nabble.com/position-text-opposite-stem-direction-td51758.html#a51759
> without succes:
>
> %% After Harm:
> #(define (forced-dir grob)
>   (let* ((x-parent (ly:grob-parent  grob X))
>          (elts (ly:grob-object x-parent 'elements))
>          (grob-name (lambda (x) (assq-ref (ly:grob-property x 'meta) 'name)))
>          (stems (filter (lambda (x) (eq? 'Stem (grob-name x)))
>                                 (ly:grob-array->list elts)))
>          (stem (list-ref stems 0))
>          (stem-dir (ly:grob-property stem 'direction)))
>
>     (if (= stem-dir 1)
>         (ly:grob-set-property! grob 'direction up)
>         (ly:grob-set-property! grob 'direction down))))
>
>
> {
>   \clef "G_8"
>   \set fingeringOrientations = #'(forced-dir)
>   \override Fingering.staff-padding = #'()
>   <a-1>4
>   <b-2>
> }
>
> Thanks in advance for any help,
> Cheers,
> Pierre
>

Hi Pierre,

this will not work here for several reasons.
Can't look deeper into it right now (have to run for my regular job).
Probably in the evening.

Though, how do you want the fingerings, if you have real chords (more
than one note)?

Cheers,
  Harm

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

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

Re: Fingering vs stem direction

Schneidy
Hi Urs,

Le mer. 5 déc. 2018 à 11:04, Urs Liska <[hidden email]> a écrit :
>So why do you need chords at all?

Since for fingering orientation to apply, you must use a chord construct

>And what are you actually trying to achieve, forcing the fingering on the opposite side of the stem or apply the X-offset tweaks?

I need both (I find fingerings default settings too close to the stem).

Cheers,
Pierre


Le mer. 5 déc. 2018 à 11:04, Urs Liska <[hidden email]> a écrit :


Am 05.12.18 um 10:56 schrieb Pierre Perol-Schneider:
Thank you Harm,
In this particular case, there is no chord.


So why do you need chords at all?

And what are you actually trying to achieve, forcing the fingering on the opposite side of the stem or apply the X-offset tweaks?

Urs


Cheers,
Pierre

Le mer. 5 déc. 2018 à 10:44, Thomas Morley <[hidden email]> a écrit :
Am Mi., 5. Dez. 2018 um 10:26 Uhr schrieb Pierre Perol-Schneider
<[hidden email]>:
>
> Hi All,
>
> I'm looking for a function that'll do:
>
> {
>   \clef "G_8"
>   \override Fingering.staff-padding = #'()
>   <a-\tweak X-offset #'-.2 ^1>4
>   <b-\tweak X-offset #'.2 _2>
> }
>
> As a first step, I've tried to adapt Harm's function found here: http://lilypond.1069038.n5.nabble.com/position-text-opposite-stem-direction-td51758.html#a51759
> without succes:
>
> %% After Harm:
> #(define (forced-dir grob)
>   (let* ((x-parent (ly:grob-parent  grob X))
>          (elts (ly:grob-object x-parent 'elements))
>          (grob-name (lambda (x) (assq-ref (ly:grob-property x 'meta) 'name)))
>          (stems (filter (lambda (x) (eq? 'Stem (grob-name x)))
>                                 (ly:grob-array->list elts)))
>          (stem (list-ref stems 0))
>          (stem-dir (ly:grob-property stem 'direction)))
>
>     (if (= stem-dir 1)
>         (ly:grob-set-property! grob 'direction up)
>         (ly:grob-set-property! grob 'direction down))))
>
>
> {
>   \clef "G_8"
>   \set fingeringOrientations = #'(forced-dir)
>   \override Fingering.staff-padding = #'()
>   <a-1>4
>   <b-2>
> }
>
> Thanks in advance for any help,
> Cheers,
> Pierre
>

Hi Pierre,

this will not work here for several reasons.
Can't look deeper into it right now (have to run for my regular job).
Probably in the evening.

Though, how do you want the fingerings, if you have real chords (more
than one note)?

Cheers,
  Harm

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

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

Re: Fingering vs stem direction

Thomas Morley-2
In reply to this post by Schneidy
Am Mi., 5. Dez. 2018 um 10:56 Uhr schrieb Pierre Perol-Schneider
<[hidden email]>:
>
> Thank you Harm,
> In this particular case, there is no chord.
> Cheers,
> Pierre

So why use event-chords and a context-property then?

Wouldn't below work already?

#(define (forced-dir-II grob)
  (let* ((x-parent (ly:grob-parent  grob X))
         (stem (ly:grob-object x-parent 'stem))
         (stem-dir (ly:grob-property stem 'direction)))
    (if (= stem-dir 1)
        (ly:grob-set-property! grob 'direction UP)
        (ly:grob-set-property! grob 'direction DOWN))))

#(define (forced-dir-II grob)
  (let* ((x-parent (ly:grob-parent  grob X))
         (stem (ly:grob-object x-parent 'stem))
         (stem-dir (ly:grob-property stem 'direction)))
    (if (= stem-dir 1)
        (ly:grob-set-property! grob 'direction UP)
        (ly:grob-set-property! grob 'direction DOWN))))

{
  \clef "G_8"
  \override Fingering.after-line-breaking = #forced-dir-II
  \override Fingering.staff-padding = #'()
  a4-4
  b-2
  a8-4
  \noBeam
  b-2
  a8-4[
  b-2]
}

How should it behave with flags and beams?


Cheers,
  Harm

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

Re: Fingering vs stem direction

Schneidy
Thank you Harm, that works fine (no beam/flag at that point).
Cheers,
Pierre

Le mer. 5 déc. 2018 à 11:16, Thomas Morley <[hidden email]> a écrit :
Am Mi., 5. Dez. 2018 um 10:56 Uhr schrieb Pierre Perol-Schneider
<[hidden email]>:
>
> Thank you Harm,
> In this particular case, there is no chord.
> Cheers,
> Pierre

So why use event-chords and a context-property then?

Wouldn't below work already?

#(define (forced-dir-II grob)
  (let* ((x-parent (ly:grob-parent  grob X))
         (stem (ly:grob-object x-parent 'stem))
         (stem-dir (ly:grob-property stem 'direction)))
    (if (= stem-dir 1)
        (ly:grob-set-property! grob 'direction UP)
        (ly:grob-set-property! grob 'direction DOWN))))

#(define (forced-dir-II grob)
  (let* ((x-parent (ly:grob-parent  grob X))
         (stem (ly:grob-object x-parent 'stem))
         (stem-dir (ly:grob-property stem 'direction)))
    (if (= stem-dir 1)
        (ly:grob-set-property! grob 'direction UP)
        (ly:grob-set-property! grob 'direction DOWN))))

{
  \clef "G_8"
  \override Fingering.after-line-breaking = #forced-dir-II
  \override Fingering.staff-padding = #'()
  a4-4
  b-2
  a8-4
  \noBeam
  b-2
  a8-4[
  b-2]
}

How should it behave with flags and beams?


Cheers,
  Harm

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

Re: Fingering vs stem direction

Thomas Morley-2
Am Mi., 5. Dez. 2018 um 11:28 Uhr schrieb Pierre Perol-Schneider
<[hidden email]>:
>
> Thank you Harm, that works fine (no beam/flag at that point).
> Cheers,
> Pierre

Ok, then I put not more work on it.

Glad I could help,
  Harm

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