Home | Site Map
Sunlight

Music with Embedded TEX

As standard, Embedded TEX 3.0 supports Lilypond, the open source music typesetting system. This allows you to generate professional quality music directly in your documents - perfect for students, teachers, forewords to pieces and anyone discussing music.

Before you can make use of Embedded TEX to write mathematics in Word, you will need to install Embedded TEX.

Music in Microsoft Word

From the Insert menu, choose Object...

Insert Object

Choose "Embedded TEX" from the list and click OK.

Insert Object

This dialog box is the "preview dialog". To switch to music mode, select the Lilypond application, and the Music template. To start with, we'll just add a couple of notes:

Preview Dialog

As you can see, Lilypond has automatically formatted the music in style. Click OK to see this fragment in Word.

Simple Music Fragment

If you want to change a music fragment, just double-click on it.

Making Music by Default

The default settings when you insert a new Embedded TEX object are designed for mathematics. If you would prefer to insert music by default, you can do so from the configuration utility. On your Start menu, choose All Programs, Sunlight, then Configure Embedded TEX.

Configuration Dialog

Right-click lilypond in the application list and choose "Set as default". Right-click Music in the template list and choose "Set as default". The application and template will turn bold to indicate they are the new defaults. Click OK to save.

Optimising for Printing

The default Embedded TEX environment is set up to produce output for your screen. This generates the smallest files. However, if your document is intended for the printer, you may instead wish to change the fragment to be optimised for printing.

Preview Dialog

This give you a high-quality fragment on paper, which takes a little more time to generate, and will make your document size slightly larger.

Notes in Lilypond

Lilypond notes are specified using their pitch and their length. The basic pitch is specified by the seven letters of the scale, c to b:

c d e f g a b
Music

To raise the pitch by an octave, use the single quote character:

c d e f g a b c' d' e' f' g' a' b' c''
Music

Notice that two quote characters raise the pitch by two octaves. To lower the pitch, use a comma:

c b, a, g, f, e, d, c,
Music

You can switch to bass clef by using the \clef command:

\clef bass c b, a, g, f, e, d, c,
Music

To make a note sharp, append is to the note. To make it flat, add es.

c' dis' ees' fisis' geses'
Music

To specify the length of a note, put a number after it. When you set the length of a note, notes that follow it that do not have a length will use that length. To obtain a dotted note, just add a period after the number.

c'1 c'2 c'4 c'8 c'16 c'32 c'64 c' c'4. c'8
Music

To set the key signature, use the command \key pitch type, where type is either \major or \minor.

\key des \major ges'8 g' ges' g' ges' g' ges' g' ges' aeses' ges' aeses' ges' aeses' ges' aeses'
Music

Rests are just like notes, using the name r.

c'8 r fis' g' r4 g' r1
Music

For a complete guide to Lilypond, consult the documentation.