2017-09-16 22:21 GMT+02:00 David Kastrup <d...@gnu.org>:
> Thomas Morley <thomasmorle...@gmail.com> writes:
>
>> 2017-09-16 21:49 GMT+02:00 David Kastrup <d...@gnu.org>:
>>
>>> And, uh, it is lacking regtests and documentation. Because someone for
>>> some reason finds it less challenging to implement functionality than
>>> inventing examples using it...
>>
>> Absolutely no idea which person you may have in mind ...
>>
>>> If you are testing things out anyway, at least regtests should not be
>>> too far away...
>>
>> Will do, at least for regtests and as soon as I find some time.
>
> Thanks. Sorry for my mental laziness.
You? Lazy? Rubbish!
Here my suggestion for a regtest. Not sure if we discuss/demonstrate
problems in regtests, though.
Ofcourse the title would be removed (only done for demonstration here)
and surpressing the warning probably needs to be adjusted, depending
how 5194 will be done finally.
Cheers,
Harm
\version "2.21.0"
\header {
texidoc = "Lone post-events are integrated into surrounding expressions.
Making it possible to attach them to expressions stored in variables.
If no preceding expression is suitable they are attached to an empty chord and a
warning is printed.
Though, as a consequence post-events may not be detected correctly, if not
inside of sequential music.
"
title =
\markup \rounded-box \smaller \medium \wordwrap-string \texidoc
}
#(ly:expect-warning "Adding <>")
nEv = c'4
seqM = { d'4 e' }
addStaccato =
#(define-music-function (mus)(ly:music?)
;; Adds staccato to every note-event
(music-map
(lambda (m) (if (music-is-of-type? m 'note-event) #{ $m -. #} m))
mus))
addMarkup =
#(define-music-function (mus)(ly:music?)
;; add TextScript, relying on DynamicText
(music-map
(lambda (m)
(if (music-is-of-type? m 'note-event)
(let* ((arts (ly:music-property m 'articulations '()))
(dyn-present?
(any
(lambda (a) (music-is-of-type? a 'absolute-dynamic-event))
arts)))
(if dyn-present?
#{ $m _"Dynamic present " #}
#{ $m _"Dynamic not present " #}))
m))
mus))
{
%% tenuto is added to <>, a warning is issues (surpressed here)
%% a Slur starts at \nEv
-- \nEv (
%% a Slur-ending is applied to the last element of sequential music.
\seqM )
%% every note gets a staccato
\addStaccato { \nEv \seqM }
\textLengthOn
%% presence of an absolute-dynamic-event is detected wrongly
\addMarkup \nEv \f ^"Selected wrongly"
%% works within sequential music
\addMarkup { \nEv \f }
%% for reference
\addMarkup c'\f
}
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user