lilypond-user
[Top][All Lists]
Advanced

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

Re: v2.15.24: void-, scheme- or music-function in toc-section?


From: Thomas Morley
Subject: Re: v2.15.24: void-, scheme- or music-function in toc-section?
Date: Mon, 16 Jan 2012 11:51:58 +0100

Hi David,

2012/1/16 David Kastrup <address@hidden>:
> Thomas Morley <address@hidden> writes:
>
>> % full code -> attached file
>>
>> indexItems =
>> #(define-music-function (parser location text) (markup?)
>> (let* ((text-rev (if (string? text)
>>                          text
>>                          (markup->string text)))
>>
>>       (args (string-split text-rev #\#))
>>       (initial (string-upcase (substring (car args) 0 1))))
>> #{
>>        \abcTocItem $text-rev
>>        \indexItem $text-rev
>>        \indexSection $initial
>>        \customTocItem $text-rev
>> #}))
>
> Looks to me like you are missing the actual music.  Try doing something
> like
>
> indexItems =
> #(define-music-function (parser location text music) (markup? ly:music?)
> (let* ((text-rev (if (string? text)
>                         text
>                         (markup->string text)))
>
>      (args (string-split text-rev #\#))
>      (initial (string-upcase (substring (car args) 0 1))))
> #{
>       \abcTocItem $text-rev
>       \indexItem $text-rev
>       \indexSection $initial
>       \customTocItem $text-rev
>       $music
> #}))
>
>
> --
> David Kastrup

thanks for your reply, following your suggestion leads to a syntax like

\version "2.15.24"

        \bookpart {
                \score {
                        \new Staff
                        \indexItems "Symphony No. 5#Ludwig van Beethoven"
                        { c'1 }
                }
       }

I'd prefer not to insert \indexItems into the music. So Jan-Peter's
proposal fits more to my needs.

BTW: I thought the 2.15.24-define-music-function not always needs to
return music.

http://lilypond.org/doc/v2.15/Documentation/changes-big-page.html

"The construct #{ … #} can now be used not just for constructing
sequential music lists, but also for single music events, void music
expressions, post events, markups (mostly freeing users from having to
use the markup macro), markup lists, number expressions, context
definitions and modifications, and a few other things. If it encloses
nothing or only a single music event, it no longer returns a
sequential music list but rather a void music expression or just the
music event itself, respectively."

Did I misunderstood (because of my insufficient english-skills)?


Cheers,
  Harm



reply via email to

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