lilypond-user
[Top][All Lists]
Advanced

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

Re: getting score information


From: Timothy Lanfear
Subject: Re: getting score information
Date: Fri, 11 Oct 2019 22:19:12 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

On 10/10/2019 09:24, Michael Käppler wrote:

For your second question, try this as a starting point:

%%%
\version "2.19.80"

get-layout-header = #(define-scheme-function (score)
                       (ly:score?)
                       (let* ((output-defs (ly:score-output-defs score))
                              (header (ly:module->alist (ly:score-header score)))
                              (title (assoc-get 'title header))
                              (composer (assoc-get 'composer header))
                              ;; Look for sym in all output definitions
                              ;; is there a way to determine of which type an output definition is?
                              (get-sym (lambda (sym)
                                         (car (filter (lambda (el)
                                                        (not (null? el)))
                                                      (map (lambda (output-def)
(ly:output-def-lookup output-def sym))
output-defs)))))
                              (indent (get-sym 'indent)))
                         (display indent)
                         (newline)
                         (display title)
                         (newline)
                         (display composer)))

On the question "is there a way to determine of which type an output definition is?", look up is-layout or is-midi in the output definition, e.g.

(ly:output-def-lookup output-def 'is-layout #f)

--
Timothy Lanfear, Bristol, UK.




reply via email to

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