\voffset-0.5in
\advance\vsize by1in
\baselineskip=0pt \lineskiplimit=0pt \lineskip=0pt

 % handle super and sub -scripts w/out math mode for neatness
 % sake. Also better for foreign fonts
\def\sup#1{\raise.6ex\hbox{\superfont #1}}
\def\sub#1{\lower.6ex\hbox{\subfont #1}} 

% handle magic characters for flat and natural
\def\magicB{\ifchord\char91\else\char98\fi}
\def\magicN{\ifchord\char92\else\char110\fi}

\let\suB=\sub
%\catcode`n=13
\catcode`b=13
\catcode`#=12
\catcode`^=13
\catcode`_=13

\def\chordmagic{
 % need sharp character for chord symbols...
 \catcode`#=12
 \catcode`@=6
 \catcode`^=13 \let^=\sup
 \catcode`_=13 \let_=\suB
 \catcode`b=13 \letb=\magicB}

\def\unchordmagic{
 \catcode`#=6
 \catcode`@=12
 \catcode`^=12
 \catcode`_=12
 \catcode`b=11}

\catcode`b=11
\catcode`n=11
\catcode`^=12
\catcode`_=12
\catcode`#=6

% allow nice chord notation
\catcode`*=11

\newif\ifchord \chordfalse
\newif\ifbookmode \bookmodetrue

\def\overheadmode{\bookmodefalse}
\def\bookmode{\bookmodetrue}

\def\bookFonts{
 \font\superfont=rtt-quilscrn at7pt
 \font\subfont=rtt-quilscrn at7pt
 \font\chordfont=rtt-quilscrn at10pt
 \def\chordstrut{\hbox{\vrule width0pt height7pt depth2pt}}
 \def\chordspace{0.6em}
 \font\textfont=rtt-garamdn at12pt
 \def\textstrut{\hbox{\vrule width0pt height8.5pt depth2.7pt}}
 \font\titlefont=rtt-dauphinn at18pt
 \font\subtitlefont=rtt-souvnrl at14pt
 \font\infofont=rtt-souvnrl at10pt}

\def\overheadFonts{
 \font\textfont=rtt-frzquadn at18pt
 \def\textstrut{\hbox{\vrule width0pt height10pt depth3pt}}
 \font\titlefont=rtt-korinab at24pt
 \font\subtitlefont=rtt-korinani at16pt
 \font\infofont=rtt-korinan at14pt}

\def\song{
 \let\title=\undefined
 \let\subtitle=\undefined
 \let\composer=\undefined
 \let\copyright=\undefined
 \ifbookmode
  \bookFonts
 \else
  \overheadFonts
 \fi
 \chordmagic}

\def\Title#1{\def\title{\hbox{\titlefont #1}}}
\def\Subtitle#1{\def\subtitle{\hbox{\subtitlefont #1}}}
\def\Composer#1{\def\composer{\hbox{\infofont #1}}}
\def\Copyright#1#2{\def\copyright{\hbox{\infofont Copyright #1, #2}}}

\newbox\chordline
\newbox\textline
\newbox\stanzabox

\newif\iftext

\def\checkline{
 \textfalse
 \ifdim\wd\textline>0pt \texttrue
 \else \ifdim\wd\chordline>0pt \texttrue
  \fi
 \fi}

\def\startline{
 \setbox\textline=\hbox\bgroup\textstrut%
  \chordfalse\textfont}

\def\endline{
 \egroup
 \checkline
 \setbox\stanzabox=\vbox{
  \unvbox\stanzabox
  \vskip 3pt plus2pt minus2pt
  \box\chordline
  \box\textline}}

\let\xpar=\par
\def\songpar{
 \endline
 \iftext \startline
 \else \stanza
 \fi}

\def\text{
 \centerline{\title}
 \ifx\subtitle\undefined \else \centerline{\subtitle} \fi
 \bigskip
 \begingroup
  \let\par=\songpar \let\end\endsong
  \obeylines%
  \startstanza%
  \let\next}

\let\xend=\end
\def\endsong{
   \endline
  \endstanza
 \endgroup
 \global\let\end=\xend
 \global\let\par=\xpar
 \unchordmagic
 \ifx\composer\undefined \else \bigskip\line{\hss\composer} \fi
 \smallskip\penalty500
 \ifx\copyright\undefined \else \line{\hss\copyright} \fi
 \vfill\supereject}

\def\stanzaskip{}

\def\startstanza{%
 \setbox\stanzabox=\vbox{}%
  \startline}

\def\endstanza{
 \copy\stanzabox
 \stanzaskip
 \vfil \penalty -200\vfilneg}

\def\stanza{\endstanza\penalty-500\startstanza}

\newbox\lastCharBox
\def\fixupFiller{
 \global\setbox\textline=\hbox{%
  \ifvoid\lastCharBox%
   \unhbox\textline \hskip\dimen0%
  \else%
    \unhbox\textline \vrule height0.7ex depth-0.55ex width\dimen0%
  \fi}}

\def\fixchordspacing{
 \begingroup
  \chordfont
  \ifdim\wd\chordline>0pt
   \dimen0=\wd\chordline \advance\dimen0 by\chordspace
   \advance\dimen0 by-\wd\textline
   \ifdim\dimen0>0pt
    \fixupFiller
    \fi
   \fi
  \endgroup}

\def\placechord#1{
 \ifdim\ht\chordline=0pt
  \setbox\chordline=\hbox{\chordstrut \hskip\wd\textline \chordfont #1}
 \else
  \dimen0=\wd\textline \advance\dimen0 by-\wd\chordline
  \setbox\chordline=\hbox{\unhbox\chordline \hskip\dimen0 \chordfont #1}
 \fi}

\def\*#1{%
 \ifbookmode%
   \setbox\lastCharBox=\lastbox \copy\lastCharBox
   \egroup%
  \fixchordspacing%
  \placechord{#1}%
  \startline\unhbox\textline%
 \fi}