[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: improving Janek's \dynamic function (for combo dynamics)
From: |
Thomas Morley |
Subject: |
Re: improving Janek's \dynamic function (for combo dynamics) |
Date: |
Tue, 12 Sep 2017 01:14:25 +0200 |
2017-09-12 0:03 GMT+02:00 Thomas Morley <address@hidden>:
> Hi Xavier,
>
> 2017-09-11 22:05 GMT+02:00 Xavier Scheuer <address@hidden>:
>> Thank you Thomas for working on this.
>>
>> Personally I came recently to think that "Doing The Right Thing™"
>> would be to have on option to **align** texts on dynamics.
>>
>> Something like
>>
>> \override TextScript.align-on-simultaneous-dynamic = ##t
>>
>> and then
>>
>> c'1\mp_\markup \italic "dolce" % would give "mp dolce"
>>
>> We could even have an option to place text right or left from dynamics
>
> Well, I would need to do some tests.
> Reading out DynamicText and TextScript and joining them into a single
> expression for DynamicText.
> Probably not impossible ...
A very first shot.
No security, no conditions, don't use it for typesetting serious
stuff, just an idea:
#(define merge-dyn-txt
(lambda (grob)
(let* ((nc (ly:grob-parent grob X))
(pap-col (ly:item-get-column grob))
(elts-array (ly:grob-object pap-col 'elements))
(elts
(if (ly:grob-array? elts-array)
(ly:grob-array->list elts-array)
'()))
(dyn
(filter
(lambda (d)
(grob::has-interface d 'dynamic-text-interface)
)
elts))
(txt-scrpt
(filter
(lambda (txt)
(eq? (grob::name txt) 'TextScript))
elts)))
(ly:grob-set-property! (car txt-scrpt) 'stencil #f)
(grob-interpret-markup grob
(make-line-markup
(list
(ly:grob-property (car dyn) 'text)
(make-normal-text-markup
(ly:grob-property (car txt-scrpt) 'text))))))))
foo =
\once \override DynamicText.stencil = #merge-dyn-txt
{
\foo
c'1\mp_\markup \italic "dolce"
d'-\tweak stencil #merge-dyn-txt \ffff-\markup \italic "barbaro"
}
Have fun, lol,
Ham
- Re: improving Janek's \dynamic function (for combo dynamics), (continued)
- Re: improving Janek's \dynamic function (for combo dynamics), Kieren MacMillan, 2017/09/11
- Re: improving Janek's \dynamic function (for combo dynamics), Thomas Morley, 2017/09/11
- Re: improving Janek's \dynamic function (for combo dynamics), Kieren MacMillan, 2017/09/11
- Re: improving Janek's \dynamic function (for combo dynamics), David Kastrup, 2017/09/12
- Re: improving Janek's \dynamic function (for combo dynamics), Thomas Morley, 2017/09/12
- Re: improving Janek's \dynamic function (for combo dynamics), Kieren MacMillan, 2017/09/12
- Re: improving Janek's \dynamic function (for combo dynamics), Thomas Morley, 2017/09/12
Re: improving Janek's \dynamic function (for combo dynamics), Xavier Scheuer, 2017/09/11
Re: improving Janek's \dynamic function (for combo dynamics), Thomas Morley, 2017/09/12
Re: improving Janek's \dynamic function (for combo dynamics), Kieren MacMillan, 2017/09/13