lilypond-user
[Top][All Lists]
Advanced

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

Re: Is Lilypond right for me?


From: Amelie Zapf
Subject: Re: Is Lilypond right for me?
Date: Tue, 11 Mar 2003 00:36:47 +0100

Hi Alex,

> I have tried incorporating music into my TeX documents by using MusiXTeX,
> but so far unsuccessfully -- I've been having troubles installing MusiXTeX
> correctly.  In an attempt to find perhaps a better solution, I discovered
> the Lilypond website and became curious.

MusiXTeX is quite a painful path. Unless you're masochistically inclined, I 
wouldn't recommend it.

> I'm wondering -- will Lilypond allow me to combine math and music
> typesetting into a single document?  Can I install and use it on my Mac
> (again, running OS X)?  Do I need a different TeX implementation?

Yes, read the manual section about the nifty little script "lilypond-book". 
That does just that.

You write mixed Lilypond/LaTeX code in a file with the extension ".tex",
then run:

lilypond-book myfile.tex
latex myfile.latex

and you're done.

I've attached an example (.ps.gz) generated in this manner from the following 
mixed code:

\documentclass[12pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\begin{document}

\title{Example}
\author{Amy Zapf}

\maketitle

\section{The formula:}
\[
E=m\cdot c^{2}\]
\section{The music:}

\begin[16pt]{lilypond}
\include "english.ly"
MellowD = \notes \relative c' {
 \partial 8*3
 f8 a c 
 ef4 r r2
 d4 bf8 a g4 df' c2 f,4 g a bf8 a g4. f8 f2 r
 f8 ( g a f g a bf g a bf c4~c bf8 a ) g2 f-\fermata \bar "|."
}

Werdz = \lyrics {
 And Ein -- stein said:
 En -- er -- gy e -- quals mass times the square of the speed of light.
 A -- men.
}

global = {
        \time 4/4
}

Key = \notes \key f \major

\score {
        \context Staff = test <
         \property Staff.automaticMelismata = ##t
         \Key
         \clef treble
         \addlyrics
         \context Voice \MellowD
         \context Lyrics = bottom \Werdz
        >
        \midi {
                \tempo 4=110
        }
        \paper {
                linewidth = 12.0\cm
                \translator {
                        \ScoreContext
                        BarNumber \override #'padding = #3
                        skipBars = ##t
                }
        }
}
\end{lilypond}

\end{document}


All the best and may you always rest on a bed of Lilies!

Amy


-- 
Amelie Zapf
Louey & Amy P.A. & Entertainment Service GbR
Weichselstr. 17, 12045 Berlin
http://www.loueymoss.com

Attachment: example_mathnmusic.ps.gz
Description: GNU Zip compressed data


reply via email to

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