%\message{Version 1.1 -- January 10, 1994}
%
%		Local Macros for MusicTeX
%			C. H. Walshaw
%
% 	Copyright Chris Walshaw. Permission is granted to use and
%	copy provided that this copyright notice remains attached.
%	This code may not be sold.
%
%	These macros define both single notes and groups of notes 
%	with computed slopes. All macros commence with a "Z" to
%	distinguish them as my own. This is followed by either a
%	"u" or an "l" which determines whether the staffs and
%	beams are upper or lower. Finally comes a list of note
%	values, where
%		a = a semiquaver
%		b = a quaver
%		c = a dotted quaver
%		d = a crotchet
%		f = a dotted crotchet
%		h = a minim
%		l = a dotted minim
%		p = a semi breve
%

% single notes
\def\Zua#1{\ccu{#1}\qsk}%
\def\Zla#1{\ccl{#1}}%
\def\Zub#1{\cu{#1}\qsk}%
\def\Zlb#1{\cl{#1}}%
\def\Zuc#1{\pt{#1}\cu{#1}\qsk}%
\def\Zlc#1{\pt{#1}\cl{#1}\qsk}%
\def\Zud{\qu}%
\def\Zld{\ql}%
\def\Zuf#1{\pt{#1}\qu{#1}\qsk}%
\def\Zlf#1{\pt{#1}\ql{#1}\qsk}%
\def\Zuh{\hu}%
\def\Zlh{\hl}%
\def\Zul#1{\pt{#1}\hu{#1}\qsk}%
\def\Zll#1{\pt{#1}\hl{#1}\qsk}%
\def\Zup{\wh}%
\def\Zlp{\wh}%

% rests
\def\Zlaz{\qs}%
\def\Zlbz{\ds}%
\def\Zlcz{\ds\qs}%
\def\Zldz{\qp}%
\def\Zlfz{\qp\ds}%
\def\Zlhz{\hpause}%
\def\Zllz{\hpause\qp}%
\def\Zlpz{\pause}%

\def\Zu{}
\def\Zl{}

% sets of double notes
\def\Zlaa#1#2{\Ibbl0{#1}{#2}1\qb0{#1}\tqb0{#2}}%
\def\Zuaa#1#2{\Ibbu0{#1}{#2}1\qh0{#1}\tqh0{#2}}%
\def\Zlbb#1#2{\Ibl0{#1}{#2}1\qb0{#1}\tqb0{#2}}%
\def\Zubb#1#2{\Ibu0{#1}{#2}1\qh0{#1}\tqh0{#2}}%

% sets of double notes
% the first dotted
\def\Zuca#1#2{\Ibu0{#1}{#2}2\pt {#1}\qh0{#1}\qsk\tbbu0\tbu0\qh0{#2}}%
\def\Zlca#1#2{\Ibl0{#1}{#2}2\pt {#1}\qb0{#1}\qsk\tbbl0\tbl0\qb0{#2}}%

% sets of double notes
% the second dotted
\def\Zuac#1#2{\Ibbu0{#1}{#2}1\rlap{\qsk\tbbu0}\qh0{#1}\pt {#2}\tbu0\qh0{#2}\qsk}
\def\Zlac#1#2{\Ibbl0{#1}{#2}1\rlap{\qsk\tbbl0}\qb0{#1}\pt {#2}\tbl0\qb0{#2}\qsk}

% sets of triple notes
\def\Zlaaa#1#2#3{\Ibbl0{#1}{#3}2\qb0{#1}\qb0{#2}\tqb0{#3}}%
\def\Zuaaa#1#2#3{\Ibbu0{#1}{#3}2\qh0{#1}\qh0{#2}\tqh0{#3}}%
\def\Zlbbb#1#2#3{\Ibl0{#1}{#3}2\qb0{#1}\qb0{#2}\tqb0{#3}}%
\def\Zubbb#1#2#3{\Ibu0{#1}{#3}2\qh0{#1}\qh0{#2}\tqh0{#3}}%

% sets of triple notes
% the first dotted
\def\Zucab#1#2#3{\Ibu0{#1}{#3}3\pt {#1}\qh0{#1}\qsk\tbbu0\qh0{#2}\tbu0\qh0{#3}}%
\def\Zlcab#1#2#3{\Ibl0{#1}{#3}3\pt {#1}\qb0{#1}\qsk\tbbl0\qb0{#2}\tbl0\qb0{#3}}%

%sets of triple notes
%first cut, second dotted
\def\Zlacb#1#2#3{\Ibbl0{#1}{#3}3\rlap{\qsk\tbbl0}\qb0{#1}\pt {#2}\qb0{#2}\qsk\tqb0{#3}}%
\def\Zuacb#1#2#3{\Ibbu0{#1}{#3}3\rlap{\qsk\tbbl0}\qb0{#1}\pt {#2}\qb0{#2}\qsk\tqb0{#3}}%

% sets of triple notes
% the second dotted
\def\Zubca#1#2#3{\Ibu0{#1}{#3}3\qh0{#1}\pt {#2}\qh0{#2}\qsk\tbbu0\tqh0{#3}}%
\def\Zlbca#1#2#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aabaa#1#2#3#4#5{\Ibl0{#1}{#5}4\nbbl0\qb0{#1}\tbbl0\qb0{#2}\qb0{#3}\nbbl0\qb0{#4}\tbl0\qb0{#5}}%

\def\Zubaab#1#2#3#4{\Ibu0{#1}{#4}3\qh0{#1}\nbbu0\qh0{#2}\tbbu0\qh0{#3}\tbu0\qh0{#4}}%
\def\Zlbaab#1#2#3#4{\Ibl0{#1}{#4}3\qb0{#1}\nbbl0\qb0{#2}\tbbl0\qb0{#3}\tbl0\qb0{#4}}%

\def\Zucaaa#1#2#3#4{\Ibu0{#1}{#4}4\pt {#1}\qh0{#1}\qsk\nbbu0\qh0{#2}\qh0{#3}\tbbu0\tbu0\qh0{#4}}%
\def\Zlcaaa#1#2#3#4{\Ibl0{#1}{#4}4\pt {#1}\qb0{#1}\qsk\nbbl0\qb0{#2}\qb0{#3}\tbbl0\tbl0\qb0{#4}}%

% sets of triplets
\def\ZlCaaa#1#2#3#4{\Ibbl0{#1}{#3}2\qb0{#1}\zcharnote {#4}{\sevenrm 3}\qb0{#2}\tqb0{#3}}%
\def\ZuCaaa#1#2#3#4{\Ibbu0{#1}{#3}2\qh0{#1}\zcharnote {#4}{\kern \Internote\sevenrm 3}\qh0{#2}\tqh0{#3}}%
\def\ZlCbbb#1#2#3#4{\Ibl0{#1}{#3}2\qb0{#1}\zcharnote {#4}{\sevenrm 3}\qb0{#2}\tqb0{#3}}%
\def\ZuCbbb#1#2#3#4{\Ibu0{#1}{#3}2\qh0{#1}\zcharnote {#4}{\kern \Internote\sevenrm 3}\qh0{#2}\tqh0{#3}}%

% sets of quadruplets
\def\ZlDaaaa#1#2#3#4#5{\Ibbl0{#1}{#4}3\qb0{#1}\zcharnote {#5}{\kern \Internote\sevenrm 4}\qb0{#2}\qb0{#3}\tqb0{#4}}%
\def\ZuDaaaa#1#2#3#4#5{\Ibbu0{#1}{#4}3\qh0{#1}\zcharnote {#5}{\kern 3\Internote\sevenrm 4}\qh0{#2}\qh0{#3}\tqh0{#4}}%
\def\ZlDbbbb#1#2#3#4#5{\Ibl0{#1}{#4}3\qb0{#1}\zcharnote {#5}{\kern \Internote\sevenrm 4}\qb0{#2}\qb0{#3}\tqb0{#4}}%
\def\ZuDbbbb#1#2#3#4#5{\Ibu0{#1}{#4}3\qh0{#1}\zcharnote {#5}{\kern 3\Internote\sevenrm 4}\qh0{#2}\qh0{#3}\tqh0{#4}}%

% gracing macros
\def\grace{\tinynotesize\vnotes 0.7\elemskip\off\Internote}
\def\egrace{\off\Internote\enotes\normalnotesize}

% grace notes on their own
\def\Zuz#1{\cccu{#1}}
\def\Zuzz#1#2{\Ibbbu1{#1}{#2}1\qh1{#1}\tqh1{#2}}
\def\Zuzzz#1#2#3{\Ibbbu1{#1}{#3}2\qh1{#1}\qh1{#2}\tqh1{#3}}
\def\Zuzzzz#1#2#3#4{\Ibbbu1{#1}{#4}3\qh1{#1}\qh1{#2}\qh1{#3}\tqh1{#4}}
\def\Zuzzzzz#1#2#3#4#5{\Ibbbu1{#1}{#5}4\qh1{#1}\qh1{#2}\qh1{#3}\qh1{#4}\tqh1{#5}}
\def\Zuzzzzzz#1#2#3#4#5#6{\Ibbbu1{#1}{#6}5\qh1{#1}\qh1{#2}\qh1{#3}\qh1{#4}\qh1{#5}\tqh1{#6}}
\def\Zuzzzzzzz#1#2#3#4#5#6#7{\Ibbbu1{#1}{#7}6\qh1{#1}\qh1{#2}\qh1{#3}\qh1{#4}\qh1{#5}\qh1{#6}\tqh1{#7}}%
\def\Zuzzzzzzzz#1#2#3#4#5#6#7#8{\Ibbbu1{#1}{#7}7\qh1{#1}\qh1{#2}\qh1{#3}\qh1{#4}\qh1{#5}\qh1{#6}\qh1{#7}\tqh1{#8}}%

\def\Zlz#1{\cccl{#1}}
\def\Zlzz#1#2{\Ibbbl1{#1}{#2}1\qb1{#1}\tqb1{#2}}
\def\Zlzzz#1#2#3{\Ibbbl1{#1}{#3}2\qb1{#1}\qb1{#2}\tqb1{#3}}
\def\Zlzzzz#1#2#3#4{\Ibbbl1{#1}{#4}3\qb1{#1}\qb1{#2}\qb1{#3}\tqb1{#4}}
\def\Zlzzzzz#1#2#3#4#5{\Ibbbl1{#1}{#5}4\qb1{#1}\qb1{#2}\qb1{#3}\qb1{#4}\tqb1{#5}}
\def\Zlzzzzzz#1#2#3#4#5#6{\Ibbbl1{#1}{#6}5\qb1{#1}\qb1{#2}\qb1{#3}\qb1{#4}\qb1{#5}\tqb1{#6}}
\def\Zlzzzzzzz#1#2#3#4#5#6#7{\Ibbbl1{#1}{#7}6\qb1{#1}\qb1{#2}\qb1{#3}\qb1{#4}\qb1{#5}\qb1{#6}\tqb1{#7}}%
\def\Zlzzzzzzzz#1#2#3#4#5#6#7#8{\Ibbbl1{#1}{#7}7\qb1{#1}\qb1{#2}\qb1{#3}\qb1{#4}\qb1{#5}\qb1{#6}\qb1{#7}\tqb1{#8}}%

% grace notes within beams
\def\Zucza#1#2#3{\Ibu0{#1}{#3}3\pt {#1}\qh0{#1}\qsk\enotes\grace\Zlz#2\egrace\notes\tbbu0\tbu0\qh0{#3}}%
\def\Zlcza#1#2#3{\Ibl0{#1}{#3}3\pt {#1}\qb0{#1}\qsk\enotes\grace\Zuz#2\egrace\notes\tbbl0\tbl0\qb0{#3}}%

\def\Zuczza#1#2#3#4{\Ibu0{#1}{#4}3\pt {#1}\qh0{#1}\qsk\enotes\grace\Zlzz#2#3\egrace\notes\tbbu0\tbu0\qh0{#4}}%
\def\Zlczza#1#2#3#4{\Ibl0{#1}{#4}3\pt {#1}\qb0{#1}\qsk\enotes\grace\Zuzz#2#3\egrace\notes\tbbl0\tbl0\qb0{#4}}%

\def\Zuczzza#1#2#3#4#5{\Ibu0{#1}{#5}3\pt {#1}\qh0{#1}\qsk\enotes\grace\Zlzzz#2#3#4\egrace\notes\tbbu0\tbu0\qh0{#5}}%
\def\Zlczzza#1#2#3#4#5{\Ibl0{#1}{#5}3\pt {#1}\qb0{#1}\qsk\enotes\grace\Zuzzz#2#3#4\egrace\notes\tbbl0\tbl0\qb0{#5}}%

\def\Zuazc#1#2#3{\Ibbu0{#1}{#3}2\rlap{\qsk\tbbu0}\qh0{#1}\enotes\grace\Zlz#2\egrace\notes\pt {#3}\tbu0\qh0{#3}\qsk}
\def\Zlazc#1#2#3{\Ibbl0{#1}{#3}2\rlap{\qsk\tbbl0}\qb0{#1}\enotes\grace\Zuz#2\egrace\notes\pt {#3}\tbl0\qb0{#3}\qsk}

\def\Zuazzc#1#2#3#4{\Ibbu0{#1}{#4}2\rlap{\qsk\tbbu0}\qh0{#1}\enotes\grace\Zlzz#2#3\egrace\notes\pt {#4}\tbu0\qh0{#4}\qsk}
\def\Zlazzc#1#2#3#4{\Ibbl0{#1}{#4}2\rlap{\qsk\tbbl0}\qb0{#1}\enotes\grace\Zuzz#2#3\egrace\notes\pt {#4}\tbl0\qb0{#4}\qsk}

\def\Zuazzzc#1#2#3#4#5{\Ibbu0{#1}{#5}2\rlap{\qsk\tbbu0}\qh0{#1}\enotes\grace\Zlzzz#2#3#4\egrace\notes\pt {#5}\tbu0\qh0{#5}\qsk}
\def\Zlazzzc#1#2#3#4#5{\Ibbl0{#1}{#5}2\rlap{\qsk\tbbl0}\qb0{#1}\enotes\grace\Zuzzz#2#3#4\egrace\notes\pt {#5}\tbl0\qb0{#5}\qsk}

\def\Zlaza#1#2#3{\Ibbl0{#1}{#3}2\qb0{#1}\enotes\grace\Zuz#2\egrace\notes\tqb0{#3}}%
\def\Zuaza#1#2#3{\Ibbu0{#1}{#3}2\qh0{#1}\enotes\grace\Zlz#2\egrace\notes\tqh0{#3}}%
\def\Zlbzb#1#2#3{\Ibl0{#1}{#3}2\qb0{#1}\enotes\grace\Zuz#2\egrace\notes\tqb0{#3}}%
\def\Zubzb#1#2#3{\Ibu0{#1}{#3}2\qh0{#1}\enotes\grace\Zlz#2\egrace\notes\tqh0{#3}}%

\def\Zlazza#1#2#3#4{\Ibbl0{#1}{#4}2\qb0{#1}\enotes\grace\Zuzz#2#3\egrace\notes\tqb0{#4}}%
\def\Zuazza#1#2#3#4{\Ibbu0{#1}{#4}2\qh0{#1}\enotes\grace\Zlzz#2#3\egrace\notes\tqh0{#4}}%
\def\Zlbzzb#1#2#3#4{\Ibl0{#1}{#4}2\qb0{#1}\enotes\grace\Zuzz#2#3\egrace\notes\tqb0{#4}}%
\def\Zubzzb#1#2#3#4{\Ibu0{#1}{#4}2\qh0{#1}\enotes\grace\Zlzz#2#3\egrace\notes\tqh0{#4}}%

\def\Zlazzza#1#2#3#4#5{\Ibbl0{#1}{#5}2\qb0{#1}\enotes\grace\Zuzzz#2#3#4\egrace\notes\tqb0{#5}}%
\def\Zuazzza#1#2#3#4#5{\Ibbu0{#1}{#5}2\qh0{#1}\enotes\grace\Zlzzz#2#3#4\egrace\notes\tqh0{#5}}%
\def\Zlbzzzb#1#2#3#4#5{\Ibl0{#1}{#5}2\qb0{#1}\enotes\grace\Zuzzz#2#3#4\egrace\notes\tqb0{#5}}%
\def\Zubzzzb#1#2#3#4#5{\Ibu0{#1}{#5}2\qh0{#1}\enotes\grace\Zlzzz#2#3#4\egrace\notes\tqh0{#5}}%

\def\Zlazaza#1#2#3#4#5{\Ibbl0{#1}{#5}3\qb0{#1}\enotes\grace\Zuz#2\egrace\notes\qb0{#3}\enotes\grace\Zuz#4\egrace\notes\tqb0{#5}}%
\def\Zuazaza#1#2#3#4#5{\Ibbu0{#1}{#5}3\qh0{#1}\enotes\grace\Zlz#2\egrace\notes\qh0{#3}\enotes\grace\Zlz#4\egrace\notes\tqh0{#5}}%
\def\Zlbzbzb#1#2#3#4#5{\Ibl0{#1}{#5}3\qb0{#1}\enotes\grace\Zuz#2\egrace\notes\qb0{#3}\enotes\grace\Zuz#4\egrace\notes\tqb0{#5}}%
\def\Zubzbzb#1#2#3#4#5{\Ibu0{#1}{#5}3\qh0{#1}\enotes\grace\Zlz#2\egrace\notes\qh0{#3}\enotes\grace\Zlz#4\egrace\notes\tqh0{#5}}%

% other symbols
\def\uroll#1{\zcharnote{#1}{\raise -0.5\qn@width\hbox to \qn@width{\hss\hdslur{1.4\qn@width}\hss}}}
\def\lroll#1{\zcharnote{#1}{\raise  0.5\qn@width\hbox to \qn@width{\hss\huslur{1.4\qn@width}\hss}}}

\def\rolls{
\kern -1\noteskip
\def\Xdfl{\uroll}
\def\Xdsh{\lroll}
}

\def\staccato{
\kern -1\noteskip
\def\Xdfl{\lpz}
\def\Xdsh{\upz}
}

%ties
\def\Zltie#1{\zcharnote #1{\huslur{0.6\noteskip}}}
\def\Zutie#1{\zcharnote #1{\hdslur{0.6\noteskip}}}

%first/second repeat
\def\Zrepeat#1{\uptext{\kern -2\Internote\sevenrm #1}}

% spacing for accidentals
\def\sk{\qsk}

