Ordering of Script glyphs

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

Ordering of Script glyphs

Andrew Bernard
Is there any way to instruct lilypond to always place accents above a note first, and then blowing marks? They are all Scripts. I am fully aware of LSR 447 and 965 but I have thousands and I don't want to \tweak each one. LSR 255 does not seem to apply, for some reason. If I specify string number before or after upbow or downbow it makes no difference, and seems to vary in a manner that looks to me random, sometimes one way, sometimes the next. I want to achieve a consistent style: accents - bowing - string number vertically stacked.

Andrew


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

Re: Ordering of Script glyphs

Lukas-Fabian Moser
Am 20.02.19 um 13:52 schrieb Andrew Bernard:
Is there any way to instruct lilypond to always place accents above a note first, and then blowing marks? They are all Scripts. I am fully aware of LSR 447 and 965 but I have thousands and I don't want to \tweak each one. LSR 255 does not seem to apply, for some reason. If I specify string number before or after upbow or downbow it makes no difference, and seems to vary in a manner that looks to me random, sometimes one way, sometimes the next. I want to achieve a consistent style: accents - bowing - string number vertically stacked.

(In my tests, accents are put nearer to the note heads than bowing marks, as you desire... but maybe that's sheer luck.)

You might redefine your bowings and accents:

upbow = -\tweak script-priority [some-number] \upbow

accent = -\tweak script-priority [some-number] \accent
dashLarger = \accent

Redefining dashLarger seems to be necessary in order to let -> reflect the new definition. Of course, this has to be repeated for staccato etc., but only once.

I'm not quite sure what you mean by string numbers - Roman numbers indicating I, II, III, IV? Are these text-scripts?

Lukas


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

Re: Ordering of Script glyphs

Lukas-Fabian Moser
> I'm not quite sure what you mean by string numbers - Roman numbers
> indicating I, II, III, IV? Are these text-scripts?
>
Please forget this stupid question - I didn't know about LilyPonds
StringNumber facility (never having used them before, even though I am a
string player... quite embarrassing ;-).)

Lukas


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

Re: Ordering of Script glyphs

Thomas Morley-2
In reply to this post by Andrew Bernard
Am Mi., 20. Feb. 2019 um 16:42 Uhr schrieb Andrew Bernard
<[hidden email]>:
>
> Is there any way to instruct lilypond to always place accents above a note first, and then blowing marks? They are all Scripts. I am fully aware of LSR 447 and 965 but I have thousands and I don't want to \tweak each one. LSR 255 does not seem to apply, for some reason. If I specify string number before or after upbow or downbow it makes no difference, and seems to vary in a manner that looks to me random, sometimes one way, sometimes the next. I want to achieve a consistent style: accents - bowing - string number vertically stacked.
>
> Andrew

Probably a starting point:

foo =
\override ScriptColumn.before-line-breaking =
#(lambda (grob)
  (let* ((scripts-array (ly:grob-object grob 'scripts))
         (scripts-list
           (if (ly:grob-array? scripts-array)
               (ly:grob-array->list scripts-array)
               '())))
    ;; print some info:
    ;(pretty-print
    ;  (map
    ;    (lambda (script)
    ;      (let* ((art-type
    ;              (ly:prob-property
    ;                (ly:grob-property script 'cause)
    ;                'articulation-type)))
    ;      (list
    ;        (grob::name script)
    ;        (list 'articulation-type
    ;              art-type)
    ;        (list 'script-priority
    ;              (ly:grob-property script 'script-priority))
    ;        (list 'outside-staff-priority
    ;              (ly:grob-property script 'outside-staff-priority)))))
    ;  scripts-list))

    (for-each
      (lambda (script)
        (let* ((art-type
                (ly:prob-property
                  (ly:grob-property script 'cause)
                  'articulation-type)))
          (if (string? art-type)
              (ly:grob-set-property! script 'script-priority
                (case (string->symbol art-type)
                  ;; TODO fill up:
                  ((accent) 1)
                  ((downbow) 2)
                  ((upbow) 2)
                  ((fermata) 4000)
                  ((trill) 2000)
                  ((staccato) 0)
                  (else 50)
                  )))))
      scripts-list)

    (ly:script-column::before-line-breaking grob)))


{
  \foo
  c'
    ^.^>^\2\upbow^\3^1^"foo"
    _\2_\downbow_2_\4_>
    \trill
    \fermata
}

Cheers,
  Harm

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