lilypond-user
[Top][All Lists]
Advanced

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

Re: Determining what parameters exist for an item


From: Thomas Morley
Subject: Re: Determining what parameters exist for an item
Date: Sun, 24 Jan 2016 19:45:05 +0100

Hi Kieren,

2016-01-24 18:22 GMT+01:00 Kieren MacMillan <address@hidden>:
> Hi David,
>
>> it would be easier if you did not do creative editing in order to
>> let everything disappear not meeting your preconceptions.
>
> It’s not clear what you’re talking about… but anyway…
>
> It’s still perfectly clear to me — and, it seems, Charles and others — that 
> Lilypond has grobs, and those grobs have properties, and those properties 
> have values, and the default values of some of those properties are not 
> easily determinable by the [beginning?] user.
>
> Three examples which I just pulled at total random are
>     Beam.beam-thickness (via beam-interface)

Beam.beam-thickness is in the IR ;)

>     NoteHead.break-visibility (via item-interface)
>     KeyCancellation.font-size (via font-interface)

These are _not_set!


If you really want to see all of the default properties and their
values for a certain grob, try the code below.
1. I think you'll agree that we don't want to put it in the docs,
repeating it for every single grob ...
2. It doesn't work for NoteHead.
Reason: in output-lib.scm are some procedures doing
(symbol->string style)
without testing whether style may be '()
(Already fixed locally, I'll provide a patch)


\version "2.19.35"

#(define (supported-properties iface)
  (let ((iface-info (hashq-get-handle (ly:all-grob-interfaces) iface)))
    (last iface-info)))

#(define (print-all-grob-properties-key-values grob)
  (let ((ifaces (assoc-get 'interfaces (ly:grob-property grob 'meta))))
    (for-each
      (lambda (iface)
        (format #t "\n~a\n" (string-upcase (symbol->string iface)))
          (for-each
            (lambda (p)
            (ly:grob-property grob p)
              (format #t "\n\t~a:\n\t~a" p (ly:grob-property grob p))
              )
            (supported-properties iface)))
      ifaces)))
%%{
\new ChordNames
\chordmode
{
  \applyOutput ChordNames.ChordName
    #(lambda (grob ctx p)
      (format #t "\n~a in context: ~a:\n" grob ctx)
      (print-all-grob-properties-key-values grob))
  c1
}
%}
%%{
\new Staff
{
  \key cis \major
  c1
  \applyOutput Staff.KeyCancellation
    #(lambda (grob ctx p)
      (format #t "\n~a in context: ~a:\n" grob ctx)
      (print-all-grob-properties-key-values grob))

  \key ces \major
  c1
}
%}
%{
\new Staff
{
  \applyOutput Score.NoteHead
    #(lambda (grob ctx p)
      (format #t "\n~a in context: ~a:\n" grob ctx)
      (print-all-grob-properties-key-values grob))
  c1
}
%}


Cheers,
  Harm



reply via email to

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