% {cim} cim szovegiro zeneszerzo utem elojegyzes
\makeatletter%
\newcommand*{\cim}[6][18]{
  \begin{center}{\Large\bf#2}\end{center}%
  \sskip[-1.5em]
  \mbox{%
    \rlap{\parbox[t]{\textwidth}{\flushleft{#3~}}}%
    \rlap{\parbox[t]{\textwidth}{\flushright{~#4}}}%
  }%

  \sskip[.3em]
  \generalmeter{#5}  \generalsignature{#6}
  \stafftopmarg=#1pt % a sorok tavolsaga
  \resetlyrics
 }
%
\newcommand*{\SzovegAttr}{}
\newcommand*{\sskip}[1][12pt]{\addvspace{#1}}
\newcommand*{\HS}[1][.5mm]{\hspace{#1}}
\newcommand*{\hyp}{\rlap{~\lyrhyphenchar}}
\newcommand*{\hypT}{\forcelyrhyphenstrue}
\newcommand*{\hypF}{\forcelyrhyphensfalse}
\newcommand*{\chmeter}[2]{\rlap{\loffset{1.3}{\meterfrac{#1}{#2}}}\qsk}%
%
\newcommand{\FILEBE}{\read-1to\FN\INPUT{\FN}}
\newcommand{\INPUT}[2][\textwidth]{
  \begin{center}\begin{minipage}[t]{#1}\begin{music}
    \nobarnumbers
    \nostartrule
    \input{#2}
  \end{music}\end{minipage}\end{center} \sskip[8.5mm] }
%
% ide rakjuk a szovegmagassag beallitasat
\newcommand{\duma}[2][0]{\setsongraise1{#1pt}\setlyrics{duma}{#2}\assignlyrics{1}{duma}}
\newcommand{\rizsa}[1]{}
\newcommand*{\n}{\Notesp} \renewcommand*{\en}{\enotes} \renewcommand*{\b}{\barre}
%
% Hogy egyszerre be lehessen állítani a többrõl egysorosra váltást
\newcommand{\song}[3]{%
	\assignlyrics1{#1}%
	\stafftopmarg=#2%
	\setsongraise1{#3}%
}
%
%\newcommand{\Duma@}[3]{\setsongraise1{#1}\stafftopmarg={#2}\assignlyrics1{#3}}
%\newcommand{\Duma@}[3]{HELLO}%\mbox{=#1=#2=#3=}}%\setsongraise1{#1}\stafftopmarg={#2}\assignlyrics1{#3}}
%\newcommand{\Duma@d}[3][-18pt][33pt][a,b,c,d]{\Duma@[#1][#2][#3]}
%\newcommand{\Duma@c}[3][-12pt][29pt][a,b,c]{\Duma@[#1][#2][#3]}
%\newcommand{\Duma@b}[3][-6pt][22pt][a,b]{\Duma@[#1][#2][#3]}
%\newcommand{\Dumaa}[4][0]{=#1=#2=#3=#4=}
%\newcommand{\D@a}[1][0pt]{[=#1=]\setsongraise1{#1}\D@aa}
%\newcommand{\D@aa}[1][18pt]{(#1)\stafftopmarg=#1\D@aaa}
%\newcommand{\D@aaa}[1][a]{\assignlyrics1{#1}}
\newcommand{\Duma}[3]{\setsongraise1{#1}\stafftopmarg=#2\assignlyrics1{#3}}%
%\newcommand{\Duma}[1]{[=#1=]\ifcase#1\or\D@a\fi}
%\newcommand{\Duma}[1]{\ifcase#1\or\Duma@a\or\Duma@b\or\Duma@c\or\Duma@d\fi}
% \ifnum#1=1\Duma@a\fi
%
\def\K#1#2{\rlap{\tinynotesize\raise #1\Interligne\hbox{#2}}}
\newcommand{\BM}[1]{\mbox{\boldmath$#1$}}
\newcount\SZ
\newcommand*{\s}[1]{\SZ=#1\advance\SZ by-1\ifnum#1<1{}\else{\s{\SZ}{$\!$}}\fi}
%
\def\AkkordMagassag{o}  % az alapertelmezett akkordmagassag
\def\AkkordAttr{}
\def\GlobalAkkordAttr{\s1}
\newcommand*{\AkkordMol}[1]{\def\AkkordMolString{#1}}
\AkkordMol{}
%
%\newcommand*{\vhaku}[4]{\zcharnote{#1}{#2\s1\textsf{\AkkordAttr\GlobalAkkordAttr#3\textsuperscript{#4}}}}
\newcommand*{\vhaku}[4]{\ifcatcodesmusic%
	\zcharnote{#1}{#2\s1\textsf{\AkkordAttr\GlobalAkkordAttr#3\textsuperscript{#4}}}%
	\else%
		\def\AkkordMagassag{2.2ex}%
		\def\AkkordAttr{\footnotesize}%
		\def\GlobalAkkordAttr{}%
		\rlap{\raisebox{\AkkordMagassag}{#2\textsf{\AkkordAttr\GlobalAkkordAttr#3\textsuperscript{#4}}}}%
	\fi}
\newcommand*{\vhak}[3]{\vhaku{#1}{#2}{#3}{}}
\newcommand*{\vhakm}[3]{\vhaku{#1}{#2}{#3\AkkordMolString}{}}
\newcommand*{\vhaks}[3]{\vhaku{#1}{#2}{#3}{7}}
\newcommand*{\vhako}[3]{\vhaku{#1}{#2}{#3}{\BM\circ}}
%
\newcommand*{\vaku}[3]{\vhaku{#1}{}{#2}{#3}}
\newcommand*{\vak}[2]{\vhak{#1}{}{#2}}
\newcommand*{\vakm}[2]{\vhakm{#1}{}{#2}}
\newcommand*{\vaks}[2]{\vhaks{#1}{}{#2}}
\newcommand*{\vako}[2]{\vhako{#1}{}{#2}}
%
\newcommand*{\haku}[3]{\vhaku{\AkkordMagassag}{#1}{#2}{#3}}
\newcommand*{\hak}[2]{\vhak{\AkkordMagassag}{#1}{#2}}
\newcommand*{\hakm}[2]{\vhakm{\AkkordMagassag}{#1}{#2}}
\newcommand*{\haks}[2]{\vhaks{\AkkordMagassag}{#1}{#2}}
\newcommand*{\hako}[2]{\vhako{\AkkordMagassag}{#1}{#2}}
%
\newcommand*{\aku}[2]{\vhaku{\AkkordMagassag}{}{#1}{#2}}
\newcommand*{\ak}[1]{\vhak{\AkkordMagassag}{}{#1}}
\newcommand*{\akm}[1]{\vhakm{\AkkordMagassag}{}{#1}}
\newcommand*{\aks}[1]{\vhaks{\AkkordMagassag}{}{#1}}
\newcommand*{\ako}[1]{\vhako{\AkkordMagassag}{}{#1}}
%
\newcommand*{\du}[2]{\zq{#1}\qu{#2}}
\newcommand*{\dl}[2]{\zq{#2}\ql{#1}}
\newcommand*{\duc}[2]{\zq{#1}\cu{#2}}
\newcommand*{\dlc}[2]{\zq{#2}\cl{#1}}
\newcommand*{\ddu}[5]{\zq #1\ibu 0{#2}{#5}\qb0 {#2}\zq {#3}\tbu0\qb0 {#4}}
\newcommand*{\ddl}[5]{\zq #2\ibl 0{#1}{#5}\qb0 {#1}\zq {#4}\tbl0\qb0 {#3}}
\newcommand*{\vDqbu}[4]{\ibu0{#3}{#4}\qb0{#1}\tbu0\qb0{#2}}
\newcommand*{\vDqbl}[4]{\ibl0{#3}{#4}\qb0{#1}\tbl0\qb0{#2}}
\newcommand*{\sDqbu}[3]{\slur{#1}{#2}d1\ibu0{#1}{#3}\mel{\qb0{#1}}\tbu0\qb0{#2}}
\newcommand*{\sDqbl}[3]{\slur{#1}{#2}u1\ibl0{#1}{#3}\mel{\qb0{#1}}\tbl0\qb0{#2}}
\newcommand*{\svDqbu}[4]{\slur{#1}{#2}d1\ibu0{#3}{#4}\mel{\qb0{#1}}\tbu0\qb0{#2}}
\newcommand*{\svDqbl}[4]{\slur{#1}{#2}u1\ibl0{#3}{#4}\mel{\qb0{#1}}\tbl0\qb0{#2}}
\newcommand*{\Aiu}[1]{\ibu0{#1}0\qb0{.#1}\tbbu0\tbu0\qb0{#1}}
\newcommand*{\Ail}[1]{\ibl0{#1}0\qb0{.#1}\tbbl0\tbl0\qb0{#1}}
\newcommand*{\aiu}[3]{\ibu0{#1}{#3}\qb0{.#1}\tbbu0\tbu0\qb0{#2}}
\newcommand*{\ail}[3]{\ibl0{#1}{#3}\qb0{.#1}\tbbl0\tbl0\qb0{#2}}
\newcommand*{\Iau}[1]{\BBU{#1}0\roff{\tbbu0}\qb0{#1}\tbu0\qb0{.#1}}
\newcommand*{\Ial}[1]{\BBL{#1}0\roff{\tbbl0}\qb0{#1}\tbl0\qb0{.#1}}
\newcommand*{\iau}[3]{\BBU{#1}{#3}\roff{\tbbu0}\qb0{#1}\tbu0\qb0{.#2}}
\newcommand*{\ial}[3]{\BBL{#1}{#3}\roff{\tbbl0}\qb0{#1}\tbl0\qb0{.#2}}
%
% Ha dupla gerendával kezd, akkor csúnyán hosszú szárat rak, ezért van eggyel
% növelve (ill. csökkentve) az eredeti magasság. A parancs a musixtex.tex-bõl
% lett kivéve, és kibõvítve: '\advance\n@i by 1' (\n@i a kezdõmagasság).
%
\newcommand*{\BBU}[2]{%
  \s@l@ctbeam0\relax \s@l@ctc\ifnum\b@n=\z@%
  \ifnum\b@n=\z@ \else \C@tb\t@bbu\qn@width \fi \global\b@n\m@ne%
  \inhgetn@i#1\relax \advance\n@i by -1\n@v#2 \C@ib+\global\advance\b@x\qd@skip%
  \C@ba\b@z\@ne \fi\n@bbu}%
\newcommand*{\BBL}[2]{%
  \s@l@ctbeam0\relax \s@l@ctc\ifnum\b@n=\z@%
  \ifnum\b@n=\z@ \else \C@tb\t@bbl\lthick \fi \global\b@n\@ne%
  \inh@alt\@ne \xgetn@i#1\relax \advance\n@i by 1\n@v#2 \C@ib-%
  \C@ba\b@z\m@ne \fi\n@bbl}%
%
\def\voltadot{} \def\raisevolta{2.5\internote}
\newcommand*{\Volta}[1]{\setvolta{\footnotesize{\s1#1}}}
\renewcommand*{\hp}{\hpause}
%\renewcommand*{\wp}{\liftpause{-1}}
\renewcommand*{\wp}{\pause}
\newcommand*{\frombar}[2]{\rlap{\kern-\afterruleskip\zcharnote{#1}{#2}}}
\newcommand*{\Frombar}[1]{\frombar{o}{#1}}
\newcommand*{\onbar}[2]{\rlap{\elemskip\beforeruleskip\ccharnote{#1}{#2}}}
\newcommand*{\Onbar}[1]{\onbar{o}{#1}}
\newcommand*{\tobar}[2]{\rlap{\elemskip\beforeruleskip\lcharnote{#1}{#2}}}
\newcommand*{\Tobar}[1]{\tobar{o}{#1}}
\newcommand*{\ferm}{\smallnotesize\fermataup l\normalnotesize}
\newcommand*{\segn}[1][n]{\rlap{\elemskip\beforeruleskip\tinynotesize\segno #1}}
\newcommand*{\trio}[1]{\rlap{\sk\zcharnote{#1}{\footnotesize\it 3}}}
\newcommand*{\acc}{\cchar{8}{\bsk\hsk\bigtype ,}}
\newcommand*{\kk}[1]{\frombar{n}{\vbox{\hrule\hbox{\vrule\vbox{\kern 1pt\hbox{\kern 1pt\rm #1\kern 1pt}\kern 1pt}\vrule}\hrule}}}
\newcommand*{\fade}[1][\footnotesize\phantom{A}]{\vbox{\hrule\hbox{\vbox{\kern 2pt\hbox{#1\kern 1pt}}\vrule}}}
%\newcommand*{\Tempo}[1]{\vspace{-6pt}{\bf#1}\par\vspace{-4pt}}
\newcommand*{\Tempo}[1]{\vspace{-.5\baselineskip}{\sffamily#1}\par\vspace{-.5\baselineskip}}
%\newcommand*{\Metron}[2]{\vspace{-.5\baselineskip}{\small\makebox[5.5pt]{\musiceleven\char"7}\rule{.4pt}{2ex}\,=\,#2}\par\vspace{-.5\baselineskip}}
\newcommand*{\Metron}[2]{\vspace{-.5\baselineskip}{\small\makebox[5.5pt]%
  {\musiceleven\char"7}\rlap{\rule{.4pt}{2ex}}%
  \ifx#1\cu{\musiceleven\char"28\,\,}\fi%
  \,=\,#2}\par\vspace{-.5\baselineskip}}
\newlength{\Ahossz}\newlength{\Bhossz}\newlength{\Chossz}
%\def\szamlalo#1pt{#1}
\newcounter{B}\newcounter{Dm}\newcounter{Dh}\newcounter{Dt}
%
\newlength{\Dm}\newlength{\Dh}\newlength{\Dt}\newlength{\Dd}
\setlength{\Dm}{5pt}% a jel magassaga
\setlength{\Dh}{10pt}% az alapvonalhoz kepest ebben a magassagban kezdodik
%\setlength{\Dt}{\Dh+\Dm-1pt}%
\setlength{\Dd}{3pt}% a zaszlo szelessege
\newcommand*{\Ta}[1]{%
  \settowidth{\Ahossz}{#1}\rlap{\parbox[t]{.5\Ahossz}{~}%
  \setlength{\Ahossz}{\Dm+3pt}\rule[\Dh]{0pt}{9pt}\rule[\Dh]{.4pt}{\Dm}}#1}
\newcommand*{\Ti}[4][0]{%
	\settowidth{\Ahossz}{#2}\settowidth{\Bhossz}{#3}\settowidth{\Chossz}{#4}%
	\addtolength{\Bhossz}{.5\Ahossz}\addtolength{\Bhossz}{.5\Chossz}%
	\rlap{\parbox[t]{.5\Ahossz}{~}\parbox[t]{\Bhossz}{\addtolength{\Bhossz}{-.8pt}%  2 x vonal
	\setlength{\Ahossz}{\Dm+3pt}\rule[\Dh]{0pt}{\Ahossz}% font kell ures hely!
	\rule[\Dh]{.4pt}{\Dm}%
	\setlength{\Chossz}{\Bhossz-\Dd}% a zaszlo 3 pt-os
	\setlength{\Ahossz}{\Dt-2pt}% 2pt-tal lejjebb rakjuk
	\rlap{\makebox[\Bhossz][t]{%
		\ifnum#1=1{\rule[\Ahossz]{\Dd}{1pt}\hfill\raisebox{\Dh}{.}}\fi% ti_tai
		\ifnum#1=2{\raisebox{\Dh}{.}\hfill\rule[\Ahossz]{\Dd}{1pt}}\fi% tai_ti
		\ifnum#1=3{\hfill\rule[\Ahossz]{\Dd}{1pt}}\fi% ta_ti
		\ifnum#1=4{\rule[\Ahossz]{\Dd}{1pt}}\fi% ti_ta
		\ifnum#1=5{\rule[\Ahossz]{\Dd}{1pt}\hfill\rule[\Ahossz]{\Dd}{1pt}}\fi% ti_ti
		\ifnum#1=9{\rule[\Ahossz]{\Bhossz}{1pt}}\fi% titi
	}}%
	\rule[\Dt]{\Bhossz}{1pt}%
	\rule[\Dh]{.4pt}{\Dm}}}#2#3#4}
\newlength{\Dhossz}\newlength{\Ehossz}%
\newcommand*{\Tii}[6][0]{%
	\settowidth{\Ahossz}{#2}\settowidth{\Bhossz}{#3}\settowidth{\Chossz}{#4}\settowidth{\Dhossz}{#5}\settowidth{\Ehossz}{#6}%
	\rlap{\rule[\Dh]{0pt}{\Dm+3pt}\makebox[.5\Ahossz-.2pt][t]{~}%
		\rule[\Dh]{.4pt}{\Dm}%
		\ifnum#1=1{\rlap{\rule[\Dh+\Dm-3pt]{.5\Ahossz+\Bhossz+.5\Chossz-.4pt}{1pt}}}\fi%
		\rule[\Dh+\Dm-1pt]{.5\Ahossz+\Bhossz+.5\Chossz-.4pt}{1pt}%
		\rule[\Dh]{.4pt}{\Dm}%
		\ifnum#1=2{\rlap{\rule[\Dh+\Dm-3pt]{.5\Chossz+\Dhossz+.5\Ehossz-.4pt}{1pt}}}\fi%
		\rule[\Dh+\Dm-1pt]{.5\Chossz+\Dhossz+.5\Ehossz-.4pt}{1pt}%
		\rule[\Dh]{.4pt}{\Dm}%
	}{#2#3#4#5#6}%
}
%
\newlength{\Elo} \setlength{\Elo}{20pt plus100pt minus20pt}
\newlength{\Koz} \setlength{\Koz}{5pt  plus20pt  minus0pt}
%
\long\def\Vx#1\par{\ifx#1\end\let\next\relax
  \else\hbox{\SzovegAttr#1}\let\next\Vx\fi\next}
\long\def\V#1{\Vx#1\par\end\par\sskip[8pt]}
\long\def\Va#1{\SzovegAttr\vbox\bgroup\hbox to\hsize\bgroup\hspace{\Elo}\vtop\bgroup\V{#1}}
\long\def\Vb#1{\egroup\hspace{\Koz}\vtop\bgroup\V{#1}}
\long\def\Vc#1{\egroup\hspace{\Elo}\egroup\egroup\par\hbox to\hsize{\hfil\vtop{\V{#1}}\hfil}\sskip[8pt]}
%
\newlength{\VersH}
\newcommand{\Versn}[3][20pt]{% 1:sorszam 2:tavolsag 3:duma
  \setlength{\VersH}{\textwidth-#1-15pt}
  \mbox{\parbox[t]{#1}{~}\parbox[t]{15pt}{\bf#2~}\parbox[t]{\VersH}{#3~}}\par
  \sskip[\parskip]%  1em volt
}
\newcommand{\Vers}[2][20pt]{%
  \setlength{\VersH}{\textwidth}%
  \addtolength{\VersH}{-#1}%
  \mbox{\parbox[t]{#1}{~}\parbox[t]{\VersH}{#2~}}\par%
  \sskip[1em]}
\newcommand*{\mel}[1]{\beginmel#1\endmel}
\def\dup#1#2{\du{.#1}{.#2}}
\def\dlp#1#2{\dl{.#1}{.#2}}
%
\newcommand{\kedvenc}[4]{\vbox{#1\sffamily\bfseries
  \begin{center}
  \hrulefill\\
  \kern#2\baselineskip
  \hrulefill\phantom{ KEDVENC NÓTÁIM #3. }\hrulefill\\
  \kern#2\baselineskip\par
  \hrulefill\hbox{ KEDVENC NÓTÁIM #3. }\hrulefill\\
  \kern#2\baselineskip\par
  \hrulefill\phantom{ #4 }\hrulefill\\
  \kern#2\baselineskip\par
  \hrulefill\hbox{ #4 }\hrulefill\\
  \kern#2\baselineskip\par
  \end{center}
  }}
%
\newcommand{\Footnote}[2][*]{\textsuperscript{#1}\footnote[0]{\llap{\textsuperscript{#1}~}#2}}
%
\def\today{\number\year.\space\ifcase\month\or Január\or Február\or Március\or
  Április\or Május\or Június\or Július\or Augusztus\or Szeptember\or
  Október\or November\or December\fi\space\number\day.}
%
\newcounter{TrioA}\newcounter{Trioa}
\newcounter{TrioH}\newcounter{Trioh}
\newcounter{TrioL}\newcounter{Triol}
\newcounter{TrioW}\newcounter{Triow}
\newcounter{TrioX}
\def\Trio#1#2#3#4#5{\rlap{% szam, kezdo-, vegmagassag, [ud], hossz
	\inhgetn@i#2\relax\setcounter{Trioa}{\n@i}% kezdopont
%\theTrioa
	\inhgetn@i#3\relax\setcounter{Trioh}{\n@i-\theTrioa}% magassag
	\setcounter{TrioA}{5*\ratio{\Interligne*\theTrioa}{1pt}}%
	\setcounter{TrioH}{5*\ratio{\Interligne*\theTrioh}{1pt}}%
	\setcounter{TrioL}{10*\ratio{\noteskip*\real{#5}+\wn@width}{1pt}}%
	\setcounter{TrioW}{5*\ratio{\wn@width}{1pt}}%
	\setcounter{Triol}{\theTrioL*\real{.5}-40}%
% megnezzuk, hogy folfele vagy lefele kell rajzolni a kapcsot
	\if u#4\setcounter{TrioW}{0}\setcounter{TrioX}{-1}\else\setcounter{TrioX}{20}\fi%
	\setcounter{Triow}{\theTrioW/10}% itt csak a tizede kell! (miert?)
	\setcounter{Trioa}{\theTrioA/10}% itt csak a tizede kell! (miert?)
	\begin{picture}(0,0)(\theTriow,-\theTrioa)%
		\unitlength .1pt%
		\put(0,0){\line(\theTrioL,\theTrioH){\theTriol}}%
		\put(0,0){\line(0,\theTrioX){20}}%
		\put(\theTrioL,\theTrioH){\line(-\theTrioL,-\theTrioH){\theTriol}}%
		\put(\theTrioL,\theTrioH){\line(0,\theTrioX){20}}%
% a beirt szoveg kozepenek kiszamolasa
		\setcounter{TrioW}{\theTrioH*\real{.5}-20}%
		\put(\theTriol,\theTrioW){\makebox[8pt][c]{\it\footnotesize #1}}%
	\end{picture}%
}}
\makeatother%
%
% ELÕKE
% G: az aktuális hely elé,
% g: az aktuális hely mögé.
%
% gr[ul] elsõ paraméter: slur kezdõmagasság
%   második: gr helye (= slur befejezõ magasság)
\newcommand{\Gru}[2]{\Gr u{#1}{#2}{\grcu{#1}}}
\newcommand{\Grl}[2]{\Gr l{#1}{#2}{\grcl{#1}}}
\newcommand{\gru}[2]{\gr u{#1}{#2}{\grcu{#2}}}
\newcommand{\grl}[2]{\gr l{#1}{#2}{\grcl{#2}}}
%
% gr [ul]xy{\command}
%   1) [ud]
%   2) slur kezdõmagasság
%   3) slur befejezõ magasság
%   4) a kiírandó parancs
\newcommand{\gr}[4]{\rlap{\lyricsoff\bsk%
	\ifx u#1\islurd3{#2}\else\isluru3{#2}\fi%
	\off{3pt}\noteskip=.25\noteskip\sk\tinynotesize#4\bsk\tslur3{#3}\lyricson}%
}
\newcommand{\Gr}[4]{\llap{\lyricsoff\noteskip=.25\noteskip\tinynotesize%
	\ifx u#1\islurd3{#2}\else\isluru3{#2}\fi%
	#4\off{3pt}\tslur3{#3}\lyricson}%
}
