lilypond-user
[Top][All Lists]
Advanced

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

Re: Writing to the console (debug info)


From: Olivier Biot
Subject: Re: Writing to the console (debug info)
Date: Tue, 18 Dec 2012 18:21:23 +0100

On Dec 14, 2012 6:39 PM, "Olivier Biot" <address@hidden> wrote:

> Hi all,
>
> Is there a way to write text to the console in LilyPond?
>
> I'd like to display the file currently processed to keep track of problems on a 60 part etude

On Sat, Dec 15, 2012 at 7:40 AM, Mark Witmer <address@hidden> wrote:

You can do that with Scheme.  I don't know if there's a LilyPond command for it.

#(display <your object here>) will display what you give it, either a plain string or an _expression_. The results aren't always totally useful (give it a \paper{} block, for example, and it will just say #<Output_def>) but that's a start. #(newline) will move to the next line if you want cleaner output.

There's also a procedure called 'format' that is more like printf.

http://www.gnu.org/software/guile/docs/docs-1.8/guile-ref/Formatted-Output.html#index-format-3918

-Mark


Hi Mark,

Thank you for this pointer!

I tried using the Guile "display" method as follows at the top of my LilyPond input file:

pieceStr = "N° 1."
#(display (string-append "[i] Converting Kummer Op 125 " pieceStr))

In this case, the output shows up at the end of processing the file:
%%% begin log
Starting lilypond.exe 2.16.1 [01.ly]...

Processing `C:/Users/Olivier/Dropbox/Music/Kummer op. 125/LilyPond/attempt2/parts/01.ly'

Parsing...

Interpreting music...[8][16]

Preprocessing graphical objects...

Finding the ideal number of pages...

Fitting music on 1 page...

Drawing systems...

Layout output to `01.ps'...

Converting to `./01.pdf'...

[i] Converting Kummer Op 125 N° 1.

Success: compilation successfully completed

Completed successfully in 2.2".


%%% end log

Whereas if I use "'ly:warning" instead of "display" as follows:

#(ly:debug (string-append "[i] Converting Kummer Op 125 " pieceStr))

The debug statement appears before parsing, which is more useful to me:

%%% begin log
Starting lilypond.exe 2.16.1 [01.ly]...

Processing `C:/Users/Olivier/Dropbox/Music/Kummer op. 125/LilyPond/attempt2/parts/01.ly'

Parsing...

warning: [!] Converting Kummer Op 125 N° 1.

Interpreting music...[8][16]

Preprocessing graphical objects...

Finding the ideal number of pages...

Fitting music on 1 page...

Drawing systems...

Layout output to `01.ps'...

Converting to `./01.pdf'...

Success: compilation successfully completed

Completed successfully in 2.1".


%%% end log

There's apparently also a "ly:debug" method but I can't get it to diusplay anything, probably there's a way to set the debug loglevel in Guile but I didn't manage to find yet how to do so.

Best regards,

Olivier

reply via email to

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