lilypond-user
[Top][All Lists]
Advanced

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

Re: A work-in-progress guide to extending LilyPond


From: Jean Abou Samra
Subject: Re: A work-in-progress guide to extending LilyPond
Date: Sat, 10 Apr 2021 22:26:21 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1

Le 10/04/2021 à 19:16, Thomas Morley a écrit :

Am Sa., 10. Apr. 2021 um 17:55 Uhr schrieb Thomas Morley
<thomasmorley65@gmail.com>:
I'll  check for your recent changes soon.
Apart from a nit (below) all looks great now.

You did not extend section "Introduction to extending - Printing
values" with other printing procedures.
Mentioned are `display' and `write' from scheme and `ly:message'. In a
later section `displayMusic' and `display-scheme-music'.

Okay, I forgot about this one. I added
some text about (ice-9 format) (not
pretty-print, see below).


Nowadays it's very rare I use `display', `write' or `ly:message',
because all of them don't print (a)lists in a readable structered
format, although my codings always proceed with lots and lots of
printed data.
I nearly always use `pretty-print' and for music-expressions
`display-scheme-music'

I'd like to suggest to mention `pretty-print', at least for printing lists. See:
{
   \override Slur.after-line-breaking =
     #(lambda (grob)
       (let ((cps (ly:grob-property grob 'control-points)))
         (display-scheme-music cps)
         (pretty-print cps)
         (ly:message "~a" cps)
         ))
   b'1( b'')
}
->
(list (cons 0.732364943841144 1.195004)
       (cons 1.76258769418946 3.05939544438528)
       (cons 6.83883925432087 5.14594080151585)
       (cons 8.88241194297576 4.545004))

((0.732364943841144 . 1.195004)
  (1.76258769418946 . 3.05939544438528)
  (6.83883925432087 . 5.14594080151585)
  (8.88241194297576 . 4.545004))

((0.732364943841144 . 1.195004) (1.76258769418946 . 3.05939544438528)
(6.83883925432087 . 5.14594080151585) (8.88241194297576 . 4.545004))

A pity that ly:message does not accept the ~y-formatter.

Now go review https://gitlab.com/lilypond/lilypond/-/merge_requests/721. ;-)


So far the link to the guile manual about format-options may lead wrongly.
Btw, you link to guile-3.0.5 ...

Indeed, thanks for spotting. Fixed now.

Best regards,
Jean




reply via email to

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