Create Song Books in XeLaTeX

Recently, I decided to digitise my songbook (lyrics with chords annotated) using the TeX typesetting system. TeX provides amazing packages for typesetting songbooks. Since my collection had mostly Malayalam songs, XeLaTeX was my choice of TeX engine which has better support for non-Roman scripts – like Malayalam, Tamil etc.

There are several TeX packages available for typesetting song lyrics and chord books. I am using the songbook package which is fairly advanced in its features. The following gist is a sample source code for generating lyrics of a famous Malayalam Melody – “തേരിറങ്ങും മുകിലെ”, annotated with the chords.

\setmainfont[Script=Malayalam, HyphenChar="00AD]{Rachana}
\newfontfamily\malayalamfont[Script=Malayalam, HyphenChar="00AD]{Rachana}
\newfontfamily\malayalamfonttt[Script=Malayalam, HyphenChar="00AD]{Rachana}
\newfontfamily\malayalamfontsf[Script=Malayalam, HyphenChar="00AD]{Rachana}

	\STitle{തേരിറങ്ങും മുകിലെ}{Am}
	  \Ch{Am}{തേരിറങ്ങും} മുകി\Ch{Em}{ലെ}
	  \Ch{G}{മഴ} തൂവലൊന്നു തരു\Ch{Am}{മോ}
	  \Ch{Am}{നോവറിഞ്ഞ} മിഴിയി\Ch{Em}{ൽ}
	  \Ch{G}{ഒരു} സ്നേഹനിദ്രയെഴു\Ch{Am}{താമോ}

Running the command xelatex songbook.tex produces a PDF with the following output:

As specified in the script, it uses Rachana font released by Swathanthra Malayalam Computing.