Re: How does the lilypond-book-preamble work?

2017-01-02 Thread Klaus Blum
Hi everybody, 


Noeck wrote
> I think it boils down to coding an output-classic-framework for the svg
> backend. And I still wonder how that can be missing, while svg output
> works nicely without the collect/print machinery of the
> lilypond-book-preamble.

I've run into the very same problem. 
Has anyone found out new things to enlighten us? 

Thanks for any hint, 
Klaus



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/How-does-the-lilypond-book-preamble-work-tp191523p198766.html
Sent from the User mailing list archive at Nabble.com.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: How does the lilypond-book-preamble work?

2016-06-11 Thread Noeck
Hi Henning,

> Did you call LilyPond with -dbackend=svg ?

thanks for sharing your settings! Unfortunately, I get the same error
when switching to the svg backend.

I think it boils down to coding an output-classic-framework for the svg
backend. And I still wonder how that can be missing, while svg output
works nicely without the collect/print machinery of the
lilypond-book-preamble.

>> And as I said, I don't need the tex/texi/count files, just the png or
>> svg (of course I can delete them afterwards by hand).
> 
> Did you try
> #(ly:set-option (quote delete-intermediate-files))
> ?

Yes, but it does not delete them. Only the ps and log file. The tex,…
files are probably required by lilypond book and not intermediate in
this sense. Just unwanted.

Thanks anyways.
Joram

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: How does the lilypond-book-preamble work?

2016-06-11 Thread Noeck
Hi Karl,

thanks for your reply. I put some comments between inline:

> Theese:
>  print-book-with-defaults-as-systems
>  print-book-with-defaults
>  collect-music-for-book
>  collect-scores-for-book
> are defined in scm/lily-library.scm, take a look there.

I did a few more hops through the code. But not so successful. I was
more after some enlightment what these functions are intended for. My
guess is now: They collect all scores in the document and produce output
for them. I need only one score per document and hope for a limited
amount of magic in the background. But without, the cropping does not
happen.

>> #(ly:set-option 'backend 'eps)  % what if I want svg?
> 
> Can't you convert your intermediary eps's or final ps/pdf's to svg ?
> Inkscape claims to be able to do that:

Well, yes. But I want it to be scriptable and as few as possible tools
and steps required.

> Why don't you include the ly/lilypond-book-preamble.ly verbatim in
> some test ly file of yours...

I did that and should have posted the error:
/home/joram/Technik/sw/ly/lilypond/compiled/share/lilypond/2.19.22/scm/lily-library.scm:259:5:
In procedure module-lookup in expression (process-procedure book paper ...):
/home/joram/Technik/sw/ly/lilypond/compiled/share/lilypond/2.19.22/scm/lily-library.scm:259:5:
unbound variable: output-classic-framework

Not knowing scheme, I didn't know what the error is telling me.

> Doing that I find that scm/framework-svg.scm is missing the
> output-classic-framework procedure which the other framework-*.scm
> have. Perhaps adding that will solve your problem.

To me it looks like I would have to invent quite a lot of other
functions like dump-stencils-as-SVGs etc. That's beyond my abilities I
guess.

My summary: I still see no path towards an SVG output of snippets.

Cheers,
Joram

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: How does the lilypond-book-preamble work?

2016-06-11 Thread Henning Hraban Ramm
Am 2016-06-11 um 16:48 schrieb Noeck :

> could someone explain to me how lilypond-book (esp. the preamble) works?
> The preamble supresses the tagline and crops the output which is what I want.

Have a look at this:
http://wiki.contextgarden.net/LilyPond#Sample_Include_File
There I stripped the lilypond-book-preamble code to the necessary bits to get 
single-line EPS snippets.

> But I can't tweak the output to SVG.

Did you call LilyPond with -dbackend=svg ?
I never used it, can’t help you with that.

> And as I said, I don't need the tex/texi/count files, just the png or
> svg (of course I can delete them afterwards by hand).

Did you try
#(ly:set-option (quote delete-intermediate-files))
?


Greetlings, Hraban
---
fiëé visuëlle
Henning Hraban Ramm
http://www.fiee.net
http://angerweit.tikon.ch/lieder/
https://www.cacert.org (I'm an assurer)





___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: How does the lilypond-book-preamble work?

2016-06-11 Thread Urs Liska


Am 11.06.2016 um 15:18 schrieb k...@aspodata.se:
>> #(ly:set-option 'backend 'eps)  % what if I want svg?
> Can't you convert your intermediary eps's or final ps/pdf's to svg ?
> Inkscape claims to be able to do that:
>
>  
> https://en.wikipedia.org/wiki/Wikipedia:Graphic_Lab/Resources/PDF_conversion_to_SVG
>

I didn't test it in *this* context, but Inkscape notoriously fails using
embedded fonts, so it just takes *anything* instead of Emmentaler,
usually resulting in files being a complete mess.
Except there have been improvments since I last tried it.

Urs
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: How does the lilypond-book-preamble work?

2016-06-11 Thread karl
Joram:
> could someone explain to me how lilypond-book (esp. the preamble) works?
> 
> I read this in ly/lilypond-book-preamble.ly:
> 
> several define ...-handler  % what is that?

  #(define default-toplevel-book-handler
print-book-with-defaults-as-systems )

  #(define toplevel-book-handler
(lambda ( . rest)
(set! output-empty-score-list #f)
(apply print-book-with-defaults rest)))

  #(define toplevel-music-handler
(lambda ( . rest)
 (apply collect-music-for-book rest)))

  #(define toplevel-score-handler
(lambda ( . rest)
 (apply collect-scores-for-book rest)))

  #(define toplevel-text-handler
(lambda ( . rest)
 (apply collect-scores-for-book rest)))

Theese:
 print-book-with-defaults-as-systems
 print-book-with-defaults
 collect-music-for-book
 collect-scores-for-book
are defined in scm/lily-library.scm, take a look there.

> #(ly:set-option 'backend 'eps)  % what if I want svg?

Can't you convert your intermediary eps's or final ps/pdf's to svg ?
Inkscape claims to be able to do that:

 
https://en.wikipedia.org/wiki/Wikipedia:Graphic_Lab/Resources/PDF_conversion_to_SVG

> #(ly:set-option (quote no-point-and-click)) % ok
> #(define inside-lilypond-book #t)   % consequences?

$ find . -type f -print0 | xargs -0 grep 'inside-lilypond-book'
./Documentation/misc/ChangeLog-2.10:inside-lilypond-book
./input/regression/abc2ly/out-test-baseline/share/lilypond/current/ly/lilypond-book-preamble.ly:#(define
 inside-lilypond-book #t)
./input/regression/out-test-baseline/share/lilypond/current/ly/lilypond-book-preamble.ly:#(define
 inside-lilypond-book #t)
./input/regression/musicxml/out-test-baseline/share/lilypond/current/ly/lilypond-book-preamble.ly:#(define
 inside-lilypond-book #t)
./ly/lilypond-book-preamble.ly:#(define inside-lilypond-book #t)

seems to be there for your convenience, i.e. you can check in your
ly/scm code if you are using lilypond-book.

> #(define version-seen #t)   % ok, I can omit the version
> 
> From the code, I could not find how the cropping, removing of indent,
> removing of the tagline, output as png happens and where the tex, texi
> and count files are produced (I don't need them).

Why don't you include the ly/lilypond-book-preamble.ly verbatim in
some test ly file of yours, like:

  \version "2.19.16"

  \header {
tagline = ""
  }

  #(define default-toplevel-book-handler
print-book-with-defaults-as-systems )

  #(define toplevel-book-handler
(lambda ( . rest)
(set! output-empty-score-list #f)
(apply print-book-with-defaults rest)))

  #(define toplevel-music-handler
(lambda ( . rest)
 (apply collect-music-for-book rest)))

  #(define toplevel-score-handler
(lambda ( . rest)
 (apply collect-scores-for-book rest)))

  #(define toplevel-text-handler
(lambda ( . rest)
 (apply collect-scores-for-book rest)))

  #(set! output-empty-score-list #t)

  #(ly:set-option 'backend 'svg)
  #(ly:set-option (quote no-point-and-click))
  %#(define inside-lilypond-book #t)
  %#(define version-seen #t)

  \score {
\new Staff { a4 b c d }
  }

Doing that I find that scm/framework-svg.scm is missing the
output-classic-framework procedure which the other framework-*.scm
have. Perhaps adding that will solve your problem.

Regards,
/Karl Hammar

---
Aspö Data
Lilla Aspö 148
S-742 94 Östhammar
Sweden
+46 173 140 57

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


How does the lilypond-book-preamble work?

2016-06-11 Thread Noeck
Hi,

could someone explain to me how lilypond-book (esp. the preamble) works?

I read this in ly/lilypond-book-preamble.ly:

several define ...-handler  % what is that?
#(ly:set-option 'backend 'eps)  % what if I want svg?
#(ly:set-option (quote no-point-and-click)) % ok
#(define inside-lilypond-book #t)   % consequences?
#(define version-seen #t)   % ok, I can omit the version

From the code, I could not find how the cropping, removing of indent,
removing of the tagline, output as png happens and where the tex, texi
and count files are produced (I don't need them).

I want to do sth similar with a few modifications:
The preamble supresses the tagline and crops the output which is what I
want.

But I can't tweak the output to SVG. Does that even make sense?  I mean,
is cropping possible with SVG? Firefox can show the svg and it is a
vector graphic (no pixels) but is the reader required to have the fonts
installed? Or will it display in a browser if it is capable of SVG
rendering?
And as I said, I don't need the tex/texi/count files, just the png or
svg (of course I can delete them afterwards by hand).

TIA,
Joram




signature.asc
Description: OpenPGP digital signature
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user