Jean Abou Samra <j...@abou-samra.fr> writes:

> Le 12/12/2021 à 22:52, Lukas-Fabian Moser a écrit :
>> Hi Jean,
>>
>>> Use a real dynamic script. These care care of spacing for you.
>>>
>>> \version "2.22.1"
>>>
>>> psubito =
>>> #(make-dynamic-script #{ \markup { p \normal-text \italic "subito" } #})
>>>
>>> { d'16_\psubito \cresc \repeat unfold 14 d'16 d'\f | }
>>
>> Maybe I'm going too far in my belief that "standard tasks best
>> should not require # characters and scheme", but shouldn't we
>> provide a LilyPond syntax interface for this? It's not so uncommon
>> to want custom dynamic expressions after all:
>>
>> dynamic =
>> #(define-music-function (text) (markup?) (make-dynamic-script text))
>>
>> {
>>   c\dynamic sfpmf
>>   c\dynamic \markup { \normal-text \italic subito f }
>> }
>
>
>
> I was thinking exactly along the same lines ;-)
>
> I would approve a patch adding this function.

One could cheat: make-dynamic-script is currently defined as

#(define (make-dynamic-script str)
   (make-music 'AbsoluteDynamicEvent
              'text str))

and one could instead define it as

make-dynamic-script =
#(define-event-function (str) (ly:markup?)
   (make-music 'AbsoluteDynamicEvent 'text str))

which would retain the old functionality while also providing

\make-dynamic-script

which of course does not follow naming conventions.  Sigh.  At any rate,
it should be defined using define-event-function rather than
define-music-function .

-- 
David Kastrup

Reply via email to