Re: context and lilypond

2013-01-22 Thread Henning Hraban Ramm
Am 2013-01-20 um 23:02 schrieb Henning Hraban Ramm:

> I’m working on a sample to use single system inclusion instead of whole page 
> inclusion, will document that at http://wiki.contextgarden.net/LilyPond

Ok, this works now:
Using the code from "Multi Page Filter Setup" and "Sample Include File", 
LilyPond writes single-line EPS/PDF, and ConTeXt can do the page breaking.


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: context and lilypond

2013-01-22 Thread Henning Hraban Ramm

Am 2013-01-21 um 22:29 schrieb Julien Rioux:

> On 20/01/2013 6:12 PM, Henning Hraban Ramm wrote:
>> I thought LilyPond used to write single EPS for every line when using 
>> lilypond-book. (I’d like to do the page breaking with TeX.)
>> Do I mis-remember? I couldn’t find an appropriate command line switch.
>> 
> 
> I think you accomplish that by adding this to your snippet:
> 
> \include "lilypond-book-preamble.ly"

Thanks for the hint! I just copied the setup to my project’s include file, and 
it works - but I don’t understand why - and what part I could perhaps leave out:

> %% toplevel \book gets output per page,
> %% everything else gets output per system/title
> #(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)

Do I need all of this to get single-line output 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: context and lilypond

2013-01-21 Thread Wim van Dommelen

Hi Stefan,

Sorry for my slow reply.

On 21 Jan 2013, at 14:40 , Stefan Thomas wrote:


Dear Wim,
what do You mean by "use the md5"?
Is it a directory, a command?
I have no idea!
Sorry, I'm not an tex-expert, altough I work frequently with latex.


MD5 is an abbreviation of Message Digest Algorithm nr. 5. It  
calculates an (almost) unique "hash" of the digital object you feed  
it. It has nothing to do with (La)TeX, ConTeXt or Lilypond sec.


Although MD5 is not perfect (in the cryptographic sense of perfection)  
it is good enough to see if a file is changed or not because when  
changed it produces a different hash-value (i.e. a 128 bit number). I  
noticed that the ConTeXt filter already calculated and used that  
behind the screen and my suggestion was to use it. In another reply  
that idea was found not feasible so I discarded that.


If you (or anyone else) want more information on this please reply  
private because i.m.h.o. this is outside the scope of the LilyPond  
mailinglist.


Regards,
Wim.

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


Re: context and lilypond

2013-01-21 Thread Julien Rioux

On 20/01/2013 6:12 PM, Henning Hraban Ramm wrote:

I thought LilyPond used to write single EPS for every line when using 
lilypond-book. (I’d like to do the page breaking with TeX.)
Do I mis-remember? I couldn’t find an appropriate command line switch.



I think you accomplish that by adding this to your snippet:

\include "lilypond-book-preamble.ly"

Cheers,
Julien

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


Re: context and lilypond

2013-01-21 Thread Stefan Thomas
Dear Wim,
what do You mean by "use the md5"?
Is it a directory, a command?
I have no idea!
Sorry, I'm not an tex-expert, altough I work frequently with latex.

Could you use the md5? In one of the temporary files it is already
stored, so it is calculated (file xxx.tmp.md5 contains the md5 hash of
xxx.tmp which is a lilypond source-file, stored in the temporary
directory)

If the files are not numbered (sequentially) but named according to
the md5 hash there should be no need to re-render any already done
piece of code after any move. Disadvantage would be that with many
changes (of a piece of Lilypond code) lots of different files will
float around (because a change of the md5 will loose view on the
original one). But that can be solved by some regular cleaning.

> 

> Greetlings, Hraban

Regards,
Wim.

> ---
> 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
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: context and lilypond

2013-01-21 Thread Henning Hraban Ramm
Am 2013-01-21 um 10:05 schrieb Wim van Dommelen:

>> The snippet buffers are just numbered, so if you insert one before the 
>> first, all others will get re-rendered, too.
>> I guess we could change that behaviour, e.g. use keywords or some UID per 
>> buffer.
>> I’ll discuss that with Aditya (author of t-filter).
> 
> Could you use the md5? In one of the temporary files it is already stored, so 
> it is calculated (file xxx.tmp.md5 contains the md5 hash of xxx.tmp which is 
> a lilypond source-file, stored in the temporary directory)
> 
> If the files are not numbered (sequentially) but named according to the md5 
> hash there should be no need to re-render any already done piece of code 
> after any move. Disadvantage would be that with many changes (of a piece of 
> Lilypond code) lots of different files will float around (because a change of 
> the md5 will loose view on the original one). But that can be solved by some 
> regular cleaning.

Without changing the filter module we can’t access the MD5 before the buffer 
and the hash are written to files, and then the name is already there.

See my other mail (yesterday night): Since we can’t set a "default buffer name 
conversion"* but can set a single buffer's name, we can (and I will) just go 
that route.

> it’s as simple as adding [name=something] to \startlilypond, e.g. 
> [name=\currentcomponent]


*) Aditya told me, when I asked if I can set e.g. [name=\currentcomponent] as 
default:
> The name key is reset at every `\startexternalfilter`; otherwise it will be 
> difficult to mix `name=` with normal usage.




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: context and lilypond

2013-01-21 Thread Wim van Dommelen


On 20 Jan 2013, at 12:45 , Henning Hraban Ramm wrote:




Move?


The snippet buffers are just numbered, so if you insert one before  
the first, all others will get re-rendered, too.
I guess we could change that behaviour, e.g. use keywords or some  
UID per buffer.

I’ll discuss that with Aditya (author of t-filter).


Could you use the md5? In one of the temporary files it is already  
stored, so it is calculated (file xxx.tmp.md5 contains the md5 hash of  
xxx.tmp which is a lilypond source-file, stored in the temporary  
directory)


If the files are not numbered (sequentially) but named according to  
the md5 hash there should be no need to re-render any already done  
piece of code after any move. Disadvantage would be that with many  
changes (of a piece of Lilypond code) lots of different files will  
float around (because a change of the md5 will loose view on the  
original one). But that can be solved by some regular cleaning.







Greetlings, Hraban


Regards,
Wim.


---
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


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


Re: context and lilypond

2013-01-20 Thread Stefan Thomas
Dear Henning,
I've tried to add the path to the  filter-command with

>  filtercommand={/home/stefan/lilypond/usr/bin/lilypond
> -dbackend=eps -dinclude-eps-fonts -dno-gs-load-fonts
> -o"lilytemp/\externalfilterbasefile" "\externalfilterinputfile"}]
>

but it doesn't work!
Any ideas?
2013/1/20 Henning Hraban Ramm 

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


Re: context and lilypond

2013-01-20 Thread Henning Hraban Ramm
Am 2013-01-20 um 23:02 schrieb Henning Hraban Ramm:

> I’m working on a sample to use single system inclusion instead of whole page 
> inclusion, will document that at http://wiki.contextgarden.net/LilyPond

Ok, there’s now an example how to include all pages of a multi-page score. It 
uses a bit of Lua code, so works only with ConTeXt MkIV (based on LuaTeX).

I thought LilyPond used to write single EPS for every line when using 
lilypond-book. (I’d like to do the page breaking with TeX.)
Do I mis-remember? I couldn’t find an appropriate command line switch.

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: context and lilypond

2013-01-20 Thread Stefan Thomas
Dear Henning,
off course: lilypond is installed.
It is installed in ~/lilypond/
How can I "tell" texec where to find it?

2013/1/20 Henning Hraban Ramm 

> Am 2013-01-20 um 22:49 schrieb Stefan Thomas:
>
> > t-filter: command : lilypond -dbackend=eps -dinclude-eps-fonts
> -dno-gs-
> > load-fonts -o"lilytemp/contexttest-temp-lilypond-0"
> "lilytemp/contexttest-temp-
> > lilypond-0.tmp"
> > t-filter: state :
> > t-filter: cached output file
> lilytemp/contexttest-temp-lilypond-0.pdf m
> > issing. Rerunning filter
> > t-filter: file lilytemp/contexttest-temp-lilypond-0.pdf cannot
> be found
> >
> > t-filter: current filter : lilypond
> > t-filter: base file : contexttest-temp-lilypond-0
> > t-filter: input file : lilytemp/contexttest-temp-lilypond-0.tmp
> > t-filter: output file : lilytemp/contexttest-temp-lilypond-0.pdf
>
> There's no output file created, probably LilyPond isn’t installed or not
> in the PATH (the call after ": command :" must be able to work). Otherwise
> you’d get LilyPond’s status messages.
>
>
> Greetlings, Hraban
> ---
> http://www.fiee.net/texnique/
> http://wiki.contextgarden.net
> 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: context and lilypond

2013-01-20 Thread Henning Hraban Ramm
Am 2013-01-20 um 12:45 schrieb Henning Hraban Ramm:

> The snippet buffers are just numbered, so if you insert one before the first, 
> all others will get re-rendered, too.
> I guess we could change that behaviour, e.g. use keywords or some UID per 
> buffer.
> I’ll discuss that with Aditya (author of t-filter).

Ok, it’s as simple as adding [name=something] to \startlilypond, e.g. 
[name=\currentcomponent]; it’s currently not possible to set that as default or 
to insert a different numbering mechanism.

I’m working on a sample to use single system inclusion instead of whole page 
inclusion, will document that at http://wiki.contextgarden.net/LilyPond


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: context and lilypond

2013-01-20 Thread Henning Hraban Ramm
Am 2013-01-20 um 19:39 schrieb Stefan Thomas:

> Dear Henning,
> thanks for Your explanations, but I couldn't manage a working piece of code, 
> untortunately.
> As You suggested, I've saved Your code as t-lilyfilter.tex. In which folder 
> shall I store it?

As long as you're testing: in your project folder.
Later you might want to move it to a generic location e.g. 
texmf-local/tex/context/third/lilyfilter/t-lilyfilter.tex

> And where in the file should be the line "\usemodule[lilyfilter]"?

Somewhere before \startlilypond

> I've tried it with the following code:
> 
> \setupoutput[pdftex]

You normally don’t need that.

> \setupbodyfont[plr,11pt]
> \mainlanguage[de]
> \language[de]

If you set german as mainlanguage, you don’t need to switch to german.

>  \usemodule[lilyfilter]
> \starttext
> \title{Title}
> This is some text
> \startlilypond
> \relative{c4 d e f g1 }
> \stoplilypond
> \stoptext

Otherwise this should work so far.

What’s your problem? Which ConTeXt distribution (TeX Live? Standalone?) and 
version? What did you call (texexec = MkII or context = MkIV?) What were the 
error messages?


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: context and lilypond

2013-01-20 Thread Stefan Thomas
Dear Henning,
thanks for Your explanations, but I couldn't manage a working piece of
code, untortunately.
As You suggested, I've saved Your code as t-lilyfilter.tex. In which folder
shall I store it?
And where in the file should be the line "\usemodule[lilyfilter]"?
I've tried it with the following code:

\setupoutput[pdftex]
\setupbodyfont[plr,11pt]
\mainlanguage[de]
\language[de]
 \usemodule[lilyfilter]
\starttext
\title{Title}
This is some text
\startlilypond
\relative{c4 d e f g1 }
\stoplilypond
\stoptext

2013/1/20 Henning Hraban Ramm 

>
> Am 2013-01-20 um 10:40 schrieb Stefan Thomas:
>
> > Dear community,
> > when I want to use lilypond within context (the latex alternative
> system), do I have to install the lilypond-module separately?
> > Can give someone  a short example of code of a document with lilypond
> code?
> > Does context cooperate with the latest stable version of lilypond?
>
> Hi Stefan,
> you don’t need the (deprecated) LilyPond module any more at all.
>
> Use the filter module, as mentioned in
> http://wiki.contextgarden.net/LilyPond
> (Anything below the section "Deprecation Warning" is invalid/unnecessary.)
>
> You can save the following snippet as "t-lilyfilter.tex" and
> \usemodule[lilyfilter]
>
> --- >8 ---
>
> \startmodule[lilyfilter]
>
> \def\readPDFfile#1{\externalfigure[#1]}
>
> \usemodule[filter]
> \defineexternalfilter[lilypond]
> [continue=yes,
> readcommand=\readPDFfile,
> directory=lilytemp/,
> output={\externalfilterbasefile.pdf},
> filtercommand={lilypond -dbackend=eps -dinclude-eps-fonts
> -dno-gs-load-fonts -o"lilytemp/\externalfilterbasefile"
> "\externalfilterinputfile"}]
>
> \stopmodule
>
> --- 8< ---
>
> This is very simple, but enough for my needs. For more options, have a
> look at the documentation of t-filter.
>
> Then, in your component (or single document) file, you say e.g.
>
> --- >8 ---
>
> \startlilypond
> \include "lily_settings.ly"
> global = {
> \clef treble
> \key a \major
> \time 4/4
> }
>
> oberstimme = \relative c'' {
> \repeat volta 2 {
> a2^\markup{1.} b4 a |
> gis2 a\fermata |
> cis^\markup{2.} d4 cis |
> b2 cis\fermata |
> a^\markup{3.} fis4 d |
> e2 a,\fermata
> }
> }
>
> text = \lyricmode {
> White sand and grey sand.
> Who’ll buy my grey sand?
> Who’ll buy my white sand?
> }
>
> \score {
> <<
> \context Staff = Oben <<
> \global
> \context Voice = "eins" \oberstimme
> >>
> \lyricsto "eins" \new Lyrics { \text }
> >>
> \layout { }
> }
> \stoplilypond
>
> --- 8< ---
>
> The old LilyPond module doesn’t allow for variable definitions (global =
> {}) within \start...\stoplilypond
>
> There’s no further configuration, you keep all settings in an include file
> (here: lily_settings.ly).
> My usual contains stuff like...
>
> --- >8 ---
>
> \version "2.14.0"
> #(ly:set-option (quote no-point-and-click))
> #(set-global-staff-size 14)
>
> \paper {
> #(define dump-extents #t)
> indent = 0\mm
> ragged-bottom = ##t
> ragged-last-bottom = ##t
> print-page-number = ##f
> line-width = 120\mm
> oddFooterMarkup  = ##f
> oddHeaderMarkup  = ##f
> bookTitleMarkup  = ##f
> scoreTitleMarkup = ##f
> }
>
> #(define (conditional-string-downcase str condition)
>   (if condition
>   (string-downcase str)
>   str))
>
> #(define (pitch-alteration-semitones pitch)
>  (inexact->exact (round (* (ly:pitch-alteration pitch) 2
>
> #(define ((chord-name->german-markup-text-alteration
>  B-instead-of-Bb) pitch lowercase?)
>  "Return pitch markup for PITCH, using german note names.
> If B-instead-of-Bb is set to #t, real german names are returned.
> Otherwise, semi-german names (with Bb and below keeping the
> british names).  Alterations are indicated with -es and -is
> instead of the flat and sharp symbols."
>  (let* ((name (ly:pitch-notename pitch))
> (alt-semitones  (pitch-alteration-semitones pitch))
> (n-a (if (member (cons name alt-semitones) `((6 . -1) (6 . -2)))
>  (cons 7 (+ (if B-instead-of-Bb 1 0) alt-semitones))
>  (cons name alt-semitones
>(make-line-markup
> (list
>  (make-simple-markup
>   (conditional-string-downcase
>(vector-ref #("C" "D" "E" "F" "G" "A" "H" "B") (car n-a))
>   lowercase?))
>  (let ((alteration (/ (cdr n-a) 2)))
>(cond
>   ((= alteration FLAT) (make-simple-markup "es"))
>   ((= alteration SHARP) (make-simple-markup "is"))
>   (else empty-markup)))
>
> smN = \override NoteHead #'font-size = #-3
> smn = \once \override NoteHead #'font-size = #-3
> nmN = \override NoteHead #'font-size = #0
> opC = \once \override Cho

Re: context and lilypond

2013-01-20 Thread Henning Hraban Ramm

Am 2013-01-20 um 12:49 schrieb David Kastrup:

> Henning Hraban Ramm  writes:
> 
>> But at least my usage of t-filter only uses one-page LilyPond
>> snippets. With a bit of Lua to detect the results of a LP run it
>> shouldn’t be that complicated to use single system images like
>> lilypond-book.
> 
> It would be interesting to figure out the minimum requirements to let
> LilyPond-book offer a generic (namely, not backend-specific) interface
> to image-including applications, and how to best pass information (XML?
> line-based?).

Wasn’t there already some output file that just contains the number of 
generated lines?
Cant’t check at the moment, my children need me...

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: context and lilypond

2013-01-20 Thread David Kastrup
Henning Hraban Ramm  writes:

> But at least my usage of t-filter only uses one-page LilyPond
> snippets. With a bit of Lua to detect the results of a LP run it
> shouldn’t be that complicated to use single system images like
> lilypond-book.

It would be interesting to figure out the minimum requirements to let
LilyPond-book offer a generic (namely, not backend-specific) interface
to image-including applications, and how to best pass information (XML?
line-based?).

-- 
David Kastrup

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


Re: context and lilypond

2013-01-20 Thread Henning Hraban Ramm
Am 2013-01-20 um 12:17 schrieb David Kastrup:

>>> What are the performance characteristics?  One point of LilyPond-book is
>>> that it compiles a large number of fragments with a single run of
>>> LilyPond.  That makes, for example, compilation times of our manuals
>>> less unbearable.
>> 
>> LilyPond gets called for every single snippet (but only once, as long
>> as it doesn’t change or move),
> 
> Move?

The snippet buffers are just numbered, so if you insert one before the first, 
all others will get re-rendered, too.
I guess we could change that behaviour, e.g. use keywords or some UID per 
buffer.
I’ll discuss that with Aditya (author of t-filter).

>> so it’s probably not suitable for a manual. But it’s good enough for
>> my songbooks.
> 
> What would be involved to make it collect jobs?  Doing more than one job
> on a single call is not a prerequisite of LilyPond.  Now LilyPond-book
> also sifts out duplicates which is nice when compiling a dozen
> translations.  Demanding that from Context would likely be excessive
> (though I think that the underlying engines can do checksums).  But
> combining several files on a single command line?  That does not sound
> too unreasonable.

The filter modules uses MD5 checksums to find changed snippets.
If I understand it right, ATM LilyPond is called for every single snippet, and 
the resulting PDF is placed immediately (so the buffer file could even get 
overwritten later). If we would collect those buffers, ConTeXt couldn’t check 
the size of the resulting image (PDF) and would need another run.
I have no idea what the best approach would be. I can live with the current 
(rather slow) speed; TeX still needs more time than LilyPond, while I don’t 
change or move a lot of my songs.

But at least my usage of t-filter only uses one-page LilyPond snippets. With a 
bit of Lua to detect the results of a LP run it shouldn’t be that complicated 
to use single system images like lilypond-book.

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: context and lilypond

2013-01-20 Thread David Kastrup
Henning Hraban Ramm  writes:

> Am 2013-01-20 um 11:37 schrieb David Kastrup:
>
>> What are the performance characteristics?  One point of LilyPond-book is
>> that it compiles a large number of fragments with a single run of
>> LilyPond.  That makes, for example, compilation times of our manuals
>> less unbearable.
>
> LilyPond gets called for every single snippet (but only once, as long
> as it doesn’t change or move),

Move?

> so it’s probably not suitable for a manual. But it’s good enough for
> my songbooks.

What would be involved to make it collect jobs?  Doing more than one job
on a single call is not a prerequisite of LilyPond.  Now LilyPond-book
also sifts out duplicates which is nice when compiling a dozen
translations.  Demanding that from Context would likely be excessive
(though I think that the underlying engines can do checksums).  But
combining several files on a single command line?  That does not sound
too unreasonable.

-- 
David Kastrup


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


Re: context and lilypond

2013-01-20 Thread Henning Hraban Ramm
Am 2013-01-20 um 11:37 schrieb David Kastrup:

> What are the performance characteristics?  One point of LilyPond-book is
> that it compiles a large number of fragments with a single run of
> LilyPond.  That makes, for example, compilation times of our manuals
> less unbearable.

LilyPond gets called for every single snippet (but only once, as long as it 
doesn’t change or move), so it’s probably not suitable for a manual. But it’s 
good enough for my songbooks.


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: context and lilypond

2013-01-20 Thread David Kastrup
Henning Hraban Ramm  writes:

> Am 2013-01-20 um 10:40 schrieb Stefan Thomas:
>
>> Dear community,
>> when I want to use lilypond within context (the latex alternative
>> system), do I have to install the lilypond-module separately?
>> Can give someone  a short example of code of a document with lilypond code?
>> Does context cooperate with the latest stable version of lilypond?
>
> Hi Stefan,
> you don’t need the (deprecated) LilyPond module any more at all.
>
> Use the filter module, as mentioned in http://wiki.contextgarden.net/LilyPond
> (Anything below the section "Deprecation Warning" is invalid/unnecessary.)
>
> You can save the following snippet as "t-lilyfilter.tex" and 
> \usemodule[lilyfilter]
>
> --- >8 ---
>
> \startmodule[lilyfilter]
>
> \def\readPDFfile#1{\externalfigure[#1]}
>
> \usemodule[filter]
> \defineexternalfilter[lilypond]
>   [continue=yes,
>   readcommand=\readPDFfile,
>   directory=lilytemp/,
>   output={\externalfilterbasefile.pdf},
>   filtercommand={lilypond -dbackend=eps -dinclude-eps-fonts 
> -dno-gs-load-fonts -o"lilytemp/\externalfilterbasefile" 
> "\externalfilterinputfile"}]
>
> \stopmodule

What are the performance characteristics?  One point of LilyPond-book is
that it compiles a large number of fragments with a single run of
LilyPond.  That makes, for example, compilation times of our manuals
less unbearable.

-- 
David Kastrup


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


Re: context and lilypond

2013-01-20 Thread Henning Hraban Ramm

Am 2013-01-20 um 10:40 schrieb Stefan Thomas:

> Dear community,
> when I want to use lilypond within context (the latex alternative system), do 
> I have to install the lilypond-module separately?
> Can give someone  a short example of code of a document with lilypond code?
> Does context cooperate with the latest stable version of lilypond?

Hi Stefan,
you don’t need the (deprecated) LilyPond module any more at all.

Use the filter module, as mentioned in http://wiki.contextgarden.net/LilyPond
(Anything below the section "Deprecation Warning" is invalid/unnecessary.)

You can save the following snippet as "t-lilyfilter.tex" and 
\usemodule[lilyfilter]

--- >8 ---

\startmodule[lilyfilter]

\def\readPDFfile#1{\externalfigure[#1]}

\usemodule[filter]
\defineexternalfilter[lilypond]
[continue=yes,
readcommand=\readPDFfile,
directory=lilytemp/,
output={\externalfilterbasefile.pdf},
filtercommand={lilypond -dbackend=eps -dinclude-eps-fonts 
-dno-gs-load-fonts -o"lilytemp/\externalfilterbasefile" 
"\externalfilterinputfile"}]

\stopmodule

--- 8< ---

This is very simple, but enough for my needs. For more options, have a look at 
the documentation of t-filter.

Then, in your component (or single document) file, you say e.g.

--- >8 ---

\startlilypond
\include "lily_settings.ly"
global = {
\clef treble
\key a \major
\time 4/4
}

oberstimme = \relative c'' {
\repeat volta 2 {
a2^\markup{1.} b4 a |
gis2 a\fermata |
cis^\markup{2.} d4 cis |
b2 cis\fermata |
a^\markup{3.} fis4 d |
e2 a,\fermata
}
}

text = \lyricmode {
White sand and grey sand.
Who’ll buy my grey sand?
Who’ll buy my white sand?
}

\score {
<<
\context Staff = Oben <<
\global
\context Voice = "eins" \oberstimme
>>
\lyricsto "eins" \new Lyrics { \text }
>>
\layout { }
}
\stoplilypond

--- 8< ---

The old LilyPond module doesn’t allow for variable definitions (global = {}) 
within \start...\stoplilypond

There’s no further configuration, you keep all settings in an include file 
(here: lily_settings.ly).
My usual contains stuff like...

--- >8 ---

\version "2.14.0"
#(ly:set-option (quote no-point-and-click))
#(set-global-staff-size 14)

\paper {
#(define dump-extents #t)
indent = 0\mm
ragged-bottom = ##t
ragged-last-bottom = ##t
print-page-number = ##f
line-width = 120\mm
oddFooterMarkup  = ##f
oddHeaderMarkup  = ##f
bookTitleMarkup  = ##f
scoreTitleMarkup = ##f
}

#(define (conditional-string-downcase str condition)
  (if condition
  (string-downcase str)
  str))

#(define (pitch-alteration-semitones pitch)
 (inexact->exact (round (* (ly:pitch-alteration pitch) 2

#(define ((chord-name->german-markup-text-alteration
 B-instead-of-Bb) pitch lowercase?)
 "Return pitch markup for PITCH, using german note names.
If B-instead-of-Bb is set to #t, real german names are returned.
Otherwise, semi-german names (with Bb and below keeping the
british names).  Alterations are indicated with -es and -is
instead of the flat and sharp symbols."
 (let* ((name (ly:pitch-notename pitch))
(alt-semitones  (pitch-alteration-semitones pitch))
(n-a (if (member (cons name alt-semitones) `((6 . -1) (6 . -2)))
 (cons 7 (+ (if B-instead-of-Bb 1 0) alt-semitones))
 (cons name alt-semitones
   (make-line-markup
(list
 (make-simple-markup
  (conditional-string-downcase
   (vector-ref #("C" "D" "E" "F" "G" "A" "H" "B") (car n-a)) 
  lowercase?))
 (let ((alteration (/ (cdr n-a) 2)))
   (cond
  ((= alteration FLAT) (make-simple-markup "es"))
  ((= alteration SHARP) (make-simple-markup "is"))
  (else empty-markup)))

smN = \override NoteHead #'font-size = #-3
smn = \once \override NoteHead #'font-size = #-3
nmN = \override NoteHead #'font-size = #0
opC = \once \override ChordNames.ChordName #'stencil = #addBrackets
cnh = \once \override NoteHead #'style = #'cross
ccJ = \set chordChanges = ##t
ccN = \set chordChanges = ##f

\layout {
#(layout-set-staff-size 14) % resets fonts!
#(define fonts (make-pango-font-tree "TeX Gyre Schola" "LMSans10" 
"LMTypewriter10 Regular" (/ 14 20)))
\context { \Score
%\dynamicUp % doesn’t work
\remove "Bar_number_engraver"
\override PaperColumn #'keep-inside-line = ##t
}
\context { \Staff
\override TimeSignature #'style = #'numbered
}
\context { \ChordNames
chordChanges = ##t
chordNameLowercaseMinor = ##t
chordRootNamer = #(chord-name->german-markup-text-alteration #t)