lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: turning a markuplist into a chain of [individual] markups or strings


From: David Kastrup
Subject: Re: turning a markuplist into a chain of [individual] markups or strings
Date: Wed, 22 Jan 2020 18:31:52 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Kieren MacMillan <address@hidden> writes:

> Hi David,
>
>> Uh, a markuplist typically _is_ a list of markups.  Except when it isn't
>> (like when it is the result of calling a markup list command).  But when
>> it isn't, you can only turn it into a list of stencils.
>
> Hmmm… So in my function
>
> #(define-markup-list-command (diffints layout props mus) (ly:music?)
>    (interpret-markup-list layout props
>      (map (lambda (d) (if (zero? d) "0" (format #f "~@d" d)))
>        (let ((muspst (map ly:pitch-semitones (music-pitches mus))))
>          (map - (cdr muspst) muspst)))))
>
> how can I output something where I can throw it into a Lyrics context and 
> have it spaced out one element per note?

Oh.  One element per note is tricky.  How about making this a music
function instead that outputs lyrics?

diffints =
#(define-music-function (mus) (ly:music?)
  #{ \lyricmode { $@(map ...) } #})

That's what I can suggest for now.  But that request seems legitimate
enough that I'll see what it takes to make lyricmode accept a markup
list.  You'd use it presumably as

\markuplist [optional duration]

But I have no idea what to do with things like hyphens at the end.
Probably attach them to the last element.  And the duration would likely
be for all of the syllables?  Or just the last?  Not that it would be
important since one would usually just use this in \lyricsto stuff where
the syllable length gets overridden.

-- 
David Kastrup



reply via email to

[Prev in Thread] Current Thread [Next in Thread]