tags:

views:

1841

answers:

3

I would be grateful for any help typesetting music in LaTeX. I've tried to use MusiXTeX but have been very frustrated.

As I understand it, the MusiXTeX notation has a steep learning curve, but I'm OK with that; the notation seems to be well documented. The hardest part is installation and getting a simple "hello world" example to work.

I'm not committed to MusiXTeX; I'll try anything that works with LaTeX. But I've tried other alternatives and been equally frustrated with them.

+13  A: 

How about LilyPond? It uses its own plaintext notation, but uses TeX for output. The engine itself uses a whole slew of measures to analyze the music and produce pretty sheet music, so it's automated to a much greater extent than MusixTex is.

Nikhil Chelliah
I believe LilyPond was one of the alternatives I tried unsuccessfully to use, but it has been a while and I'm not sure. I'll give it another chance.
John D. Cook
I haven't used it recently, either. I do remember that chords were a little frustrating because they don't fit well into a one-dimensional (plaintext) data stream, if that makes sense.
Nikhil Chelliah
Thanks! I just installed LilyPond and the sample application worked. So far so good! But I don't see the connection to LaTeX. It produces a PDF file and a PS file. Looks like I'd need to keep the source in a separate .ly file and include the output as in image in my LaTeX file. Is that right?
John D. Cook
It once used LaTeX, but does not anymore; either that or lilypond-book may have caused the confusion.
JasonFruit
LilyPond has *nothing* to do with TeX/LaTeX. They can be integrated with lilypond-book, but have no other connection.
thSoft
+7  A: 

Lilypond has a preprocessor called lilypond-book that lets you mix LaTeX code with Lilypond code in one source file.

Sample usage: tsst.lytex contains this:

\documentclass{article}
\begin{document}
\begin[quote,fragment,staffsize=26]{lilypond}
c' d' e'
\end{lilypond}
\end{document}

It also supports inline notation (instead of a display), and reading from external files.

Compile it with lilypond-book --pdf tsst.lytex, producing pdf images of each system along with a LaTeX file tsst.tex that includes the snippets, which compiles as usual with pdflatex.

jleedev
Thanks! It's not obvious from the LilyPond home page that there's any connection to LaTeX.
John D. Cook
+1  A: 

If you have simple notations (folk tunes and the like), something like ABC might be a good fit. Simple markup-based notation, but prints to LaTeX. Wikipedia has a good example

X:1
T:The Legacy Jig
M:6/8
L:1/8
R:jig
K:G
GFG BAB | gfg gab | GFG BAB | d2A AFD |
GFG BAB | gfg gab | age edB |1 dBA AFD :|2 dBA ABd |:
efe edB | dBA ABd | efe edB | gdB ABd |
efe edB | d2d def | gfe edB |1 dBA ABd :|2 dBA AFD |]

Which produces

ABC example png

Gregg Lind