Re: [frogs] LSR snippets for contributors and Frogs |
[ Thread Index |
Date Index
| More lilynet.net/frogs Archives
]
- To: Werner LEMBERG <wl@xxxxxxx>
- Subject: Re: [frogs] LSR snippets for contributors and Frogs
- From: Mark Polesky <markpolesky@xxxxxxxxx>
- Date: Sat, 25 Jul 2009 13:46:36 -0700 (PDT)
- Cc: n.puttock@xxxxxxxxx, frogs@xxxxxxxxxxx, graham@xxxxxxxxxxxxxxxxx, john.mandereau@xxxxxxxxx, c_sorensen@xxxxxxx, pnorcks@xxxxxxxxx, t.daniels@xxxxxxxxxxx, v.villenave@xxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1248554796; bh=WMsudJ511A1fPHL5NmDeMWJjHPLecjT6BeBLMdHwvXw=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=00M1j9Z0eoDcZPBC57bRv3RWjNWb/E2EXQr/oZKBLTthEy+cO7ZZMFvTpJk2T6VinOGiCULjkiGn18I7Q+M9Ju0bv2LdzcU5By/fTzTW4MeLTQYZfdUTqdOxiOJ+FayIAaIalg1QDUu3/xXXILWcFZXdy85zP56UX3cZusyZEDs=
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=niVYyG2eIuXX7kkzB5CZB21Netm/qaIEBgOlVAwl93yuqlKOIeBm+4KZLV+7SFDmrwCl4MEI2jHg7HR+Fe6/XrK7xntufJ/q8Zkq//qiiNDBB6+8LjPyj6tumoqlIfAbVMi9AZoerBQSOBibG6dMqrdAK/dSaY7awBTRzPdIVqE=;
Werner LEMBERG wrote:
> > [...] so just to make sure, you can confirm that what you get
> > differs from the output here?
> >
> > http://lsr.dsi.unimi.it/LSR/Item?u=1&id=622
>
> Yes. What I get contains much more empty lines.
Werner,
I think I figured it out. I tweaked a bunch of newlines with
(format #f "~&"). This was very confusing if you can imagine.
Anyway, it's a tiny bit different from my original conception,
but I think it's better anyway. If you don't mind, please
compare your output with the example output I included at the
top of the attached file.
Hopefully it should look exactly the same.
Thanks.
- Mark
%%%% display-ancestry.ly -- Displaying grob ancestry.
\version "2.13.2"
%{
example console output:
...
Preprocessing graphical objects...
------------------------------------
NoteHead
X/Y: NoteColumn
X: PaperColumn
X/Y: System
Y: VerticalAxisGroup
X: NonMusicalPaperColumn
X/Y: System
Y: VerticalAlignment
X: NonMusicalPaperColumn
X/Y: System
Y: System
------------------------------------
Arpeggio
X: PaperColumn
X/Y: System
Y: Stem
X/Y: NoteColumn
X: PaperColumn
X/Y: System
Y: VerticalAxisGroup
X: NonMusicalPaperColumn
X/Y: System
Y: VerticalAlignment
X: NonMusicalPaperColumn
X/Y: System
Y: System
------------------------------------
Accidental
X: AccidentalPlacement
X: PaperColumn
X/Y: System
Y: VerticalAxisGroup
X: NonMusicalPaperColumn
X/Y: System
Y: VerticalAlignment
X: NonMusicalPaperColumn
X/Y: System
Y: System
Y: NoteHead
X/Y: NoteColumn
X: PaperColumn
X/Y: System
Y: VerticalAxisGroup
X: NonMusicalPaperColumn
X/Y: System
Y: VerticalAlignment
X: NonMusicalPaperColumn
X/Y: System
Y: System
Solving 1 page-breaking chunks...[1: 1 pages]
%}
#(define (grob-name grob)
(if (ly:grob? grob)
(assoc-ref (ly:grob-property grob 'meta) 'name)
#f))
#(define (get-ancestry grob)
(if (not (null? (ly:grob-parent grob X)))
(list (grob-name grob)
(get-ancestry (ly:grob-parent grob X))
(get-ancestry (ly:grob-parent grob Y)))
(grob-name grob)))
#(define (format-ancestry lst padding)
(string-append
(symbol->string (car lst))
"\n"
(let ((X-ancestry
(if (list? (cadr lst))
(format-ancestry (cadr lst) (+ padding 3))
(symbol->string (cadr lst))))
(Y-ancestry
(if (list? (caddr lst))
(format-ancestry (caddr lst) (+ padding 3))
(symbol->string (caddr lst)))))
(if (equal? X-ancestry Y-ancestry)
(string-append
(format #f "~&")
(make-string padding #\space)
"X/Y: "
(if (list? (cadr lst))
(format-ancestry (cadr lst) (+ padding 5))
(symbol->string (cadr lst))))
(string-append
(format #f "~&")
(make-string padding #\space)
"X: " X-ancestry
"\n"
(make-string padding #\space)
"Y: " Y-ancestry
(format #f "~&"))))
(format #f "~&")))
#(define (display-ancestry grob)
(display
(string-append
(format #f "~2&\n")
(make-string 36 #\-)
"\n\n"
(format-ancestry (get-ancestry grob) 0)
(format #f "~2&"))))
\relative {
\once \override NoteHead #'before-line-breaking = #display-ancestry
f
\once \override Accidental #'before-line-breaking = #display-ancestry
\once \override Arpeggio #'before-line-breaking = #display-ancestry
<f as c>\arpeggio
}