Songbook generator powered by LaTeX
The Great LaTeX Songbook is a template for generating songbooks in a modern layout with support for lyrics, chords, chord diagrams and tablatures. It features:
- Multiple instruments: compile multiple songbooks, one for each instrument. Define which parts of the song will show up for all instruments (e.g. lyrics and chords) and which parts will show up only for individual instruments (e.g. a solo).
- Lyrics and chords: lyrics with section and chord changes via
leadsheets
- Chord diagrams: chord diagrams via
guitarchordschemes
- Tablature and sheet music: tablature and sheet music excerpts via
musixtex
Requires LaTeX. On Mac OS (using brew):
brew install --cask mactex-no-gui
Also requires fswatch
if you want to keep watching and recompiling files:
brew install fswatch
Clone the repo:
git clone [email protected]:jpesce/great-latex-songbook.git
Generate PDFs for all instruments and clean up:
make all
Generate PDF for one instrument (e.g. ukulele):
make instrument-ukulele
Recompile when files change (requires fswatch
):
make watch
Add a new tex
file to src/songs/
. Here’s Guided By Voices’ You’re Not an Airplane as an example (see leadsheets’ documentation for the complete syntax):
\begin{song}{
title=You're Not an Airplane,
band=Guided by Voices,
composer=Tobin Sprout
}
\begin{intro}
\writechord{E} \writechord{D} \writechord{A}
\end{intro}
\begin{verse}
Well, ^{A}come on now and see the course that ^{Asus}never fields the game of choice\\
and ^{A}cold allies of steel couldn't ^{Asus}buy the way it feels\\
^{E}Rusty and divided steel the ^{D}race is yet to ^{A}come
\end{verse}
\end{song}
\newpage
Then add it to src/songs.tex
in your position of choice
\input{src/songs/your-new-song-file.tex}
To add a notation section, use MusiXTeX. Here’s The Beatles’ Two of Us intro on ukulele (see the complete syntax on MusiXTeX’s documentation):
\begin{music}
\setlines14
\setstaffs1{1}
\setclefsymbol1{\tabclef}
\nobarnumbers
\let\extractline\leftline
\startextract
\Notes \tab{3}{2} \tab{1}{2} \tab{3}{2} \tab{1}{2} \en
\bar
\Notes \tab{3}{2} \tab{1}{2} \tab{3}{2} \tab{2}{0} \en
\endextract
\end{music}
![intro](https://private-user-images.githubusercontent.com/1228352/256343856-a179c5e3-8396-4a10-be92-4ef2a401f811.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NTc2MTksIm5iZiI6MTczODk1NzMxOSwicGF0aCI6Ii8xMjI4MzUyLzI1NjM0Mzg1Ni1hMTc5YzVlMy04Mzk2LTRhMTAtYmU5Mi00ZWYyYTQwMWY4MTEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDdUMTk0MTU5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZTIxYWIwNmI3NTRhYjQ5M2JhYTIxODhmNjRiZmNhZDdhZjQ0Y2U0MGI3OGU3ZjE3NTIwNDk5NWQzODY1NzA3MCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.t7ISnh3OdLfeqeVclfte0MPRUodzzp4FnOGELAmqZF4)
Some parts may only be relevant to certain instruments. For example, the intro shown before is tabbed specifically for ukulele. To make it appear only on the ukulele songbook use the following command:
\ifx\instrument\ukulele
% Ukulele-specific part
\fi
Chord diagrams are drawings that usually appear before the lyrics and show chord fingerings for a specific instrument.
Chord definitions for each instrument are located in src/chords/chords-instrument-name.tex
. See guitarchordschemes’ documentation for the complete syntax.
After defining the chord names, simply add them at the beggining of the song:
\gchord
\cchord
\cbbasschord
Note: Make sure all chord names are defined for all instruments or create a conditional section if the chord name is only defined for a certain instrument.
Add an entry in src/instruments-available.tex
:
\def\newinstrument{ukulele}
+ \def\newinstrument{newinstrument}
Create a chords definition file for the new instrument at src/chords/chords-newinstrument.tex
. Remember to wrap it with a conditional section:
\ifx\instrument\newinstrument
% Here be chords
\fi
Include the new chord definition file in src/songbook.tex
\input{src/chords/chords-ukulele.tex}
+ \input{src/chords/chords-newinstrument.tex}
Add a command to makefile
’s all
target:
all: $(INPUT_PATH)
+ make instrument-newinstrument
make instrument-ukulele
make instrument-generic
The project name is a reference to The Great American Songbook