Difference between revisions of "LilyPond"
m (category added (Modules, Music, Requests); this is (not yet) a module, so you may remove it if you think it's unsuitable classification) |
(some notes of fonts in LilyPond) |
||
Line 51: | Line 51: | ||
\stopLilyPond | \stopLilyPond | ||
− | There's nothing to say about this tune yet; my friend heard it from | + | There's nothing to say about this tune yet; my friend heard it from Lúnasa. |
</texcode> | </texcode> | ||
Line 64: | Line 64: | ||
* set staff and text size | * set staff and text size | ||
* access most other layout parameters | * access most other layout parameters | ||
+ | |||
+ | LilyPond uses fontconfig for font search. At least on MacOS X it's very restricted what kind of fonts it can use - only single-style TrueType (including dfont). I didn't manage yet to use fonts from the TeX tree. (That doesn't seem to be fontconfig's fault - it writes appropriate font cache files everywhere.) | ||
To remember: | To remember: | ||
− | * see [http://lilypond.org/doc/v2. | + | * see [http://lilypond.org/doc/v2.7/Documentation/out-www/ LilyPond Docs]! |
* How do we handle version/syntax changes of LilyPond? | * How do we handle version/syntax changes of LilyPond? | ||
* !! How do we get clean PDFs (EPS for DVI mode), without anything around the staffs? Is lilypond-book's setup enough? | * !! How do we get clean PDFs (EPS for DVI mode), without anything around the staffs? Is lilypond-book's setup enough? | ||
− | --[[User:Hraban|Hraban]] | + | --[[User:Hraban|Hraban]] 2005-08-20 |
[[Category:Modules]] | [[Category:Modules]] | ||
[[Category:Music]] | [[Category:Music]] | ||
[[Category:Requests]] | [[Category:Requests]] |
Revision as of 22:50, 19 August 2005
< Graphics | Using Graphics > ((Please leave this page orphaned until LilyPond integration is ready!))
LilyPond is a great music engraver, and this page is for future LilyPond integration in ConTeXt. At the moment you can use LilyPond's PDFs as graphics just fine.
Contents
Setup
- First you need a working LilyPond installation plus dependencies like GhostScript.
- see \setupLilyPond
Snippets
There are some notes \LilyPond{ \relative{bes a c b} } embedded in this line.
Sections
E.g. for a songbook you want to place big chunks of LilyPond output (i.e. note staffs) in your text. It behaves like any other graphics, especially similar to embedded MetaPost code:
\section{A Tune} \startLilyPond \relative { \repeat volta 2 { \partial 4 e4 | a2 c4 d | e2 f4 e | d2. c4 | b4. c8 d4 e | a,2 c4 d | e2 f4 e | g,2 a | \partial 2. b2. | } \repeat volta 2 { \partial 4 r4 | f' g f d | e f e c | a b c d | e2. e4 | f g f8 e d4 | e f e c | a c b8 a g4 | } \alternative { { \partial 2. g2. } { \partial 2. a2. } } } \stopLilyPond There's nothing to say about this tune yet; my friend heard it from Lúnasa.
Developer's Corner
I need to figure out how LilyPond's LaTeX integration in lilypond-book works. It is a different approach: LilyPond preprocesses the LaTeX code, replaces LilyPond code with images and runs LaTeX. Instead with ConTeXt, texexec would do this preprocessing step, avoiding the need to run different programs yourself. I guess I can copy the needed setup (LilyPond stub file) from lilypond-book (a messy Python script).
I don't yet know how to prepare \setupLilyPond. It should be able to:
- set the text font (default should be ConTeXt's bodyfont instead of LilyPond's)
- set line width
- set staff and text size
- access most other layout parameters
LilyPond uses fontconfig for font search. At least on MacOS X it's very restricted what kind of fonts it can use - only single-style TrueType (including dfont). I didn't manage yet to use fonts from the TeX tree. (That doesn't seem to be fontconfig's fault - it writes appropriate font cache files everywhere.)
To remember:
- see LilyPond Docs!
- How do we handle version/syntax changes of LilyPond?
- !! How do we get clean PDFs (EPS for DVI mode), without anything around the staffs? Is lilypond-book's setup enough?
--Hraban 2005-08-20