lilypond-user
[Top][All Lists]
Advanced

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

RE: getting score information


From: jaap de wolff
Subject: RE: getting score information
Date: Sat, 12 Oct 2019 10:02:01 +0200

> -----Oorspronkelijk bericht-----
> Van: lilypond-user <lilypond-user-bounces+jaap=address@hidden>
> Namens Timothy Lanfear
> Verzonden: Friday, October 11, 2019 11:19 PM
> Aan: Michael Käppler <address@hidden>; jaap de wolff <jaap@de-
> wolff.org>; address@hidden
> Onderwerp: Re: getting score information
> 
> 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.
> 
> 
Thank you both.
The answer you gave is not the answer I was looking for, but it gave me insight 
in a major thinking error, and has enough information to help me.

First of all, my expectation was that global information was included in the 
score:
I expected information from the \header part to be present in the 
ly:score-header.
Same about the ly:score-output-defs.
And whatever I tried I was not able to extract that.
Because of this wrong expectation I was not able to find anything.
With your information I have a clear direction where to find my information

Jaap






reply via email to

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