[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Ordering of Script glyphs
From: |
Thomas Morley |
Subject: |
Re: Ordering of Script glyphs |
Date: |
Fri, 22 Feb 2019 00:52:12 +0100 |
Am Mi., 20. Feb. 2019 um 16:42 Uhr schrieb Andrew Bernard
<address@hidden>:
>
> 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