\input musixtex
\def\guitarclef{\settrebleclefsymbol{1}{\treblelowoct}}%
%
%% The following is Werner's hack of \Ioctfin to produce barre chord lines
\makeatletter
\def\C@TO{%
  \ifx\T@ii\n@ii \y@v\lin@pos \else \getcurpos \fi
  \advance\y@v-\o@x \kernm\y@v \raise\o@y\hbox{%
  \raise\h@lf\Interligne\hbox\@to\y@v{%
  \lower\Internote\hbox{\octnumber}\hrulefill}%
  \ifx\T@ii\n@ii
        \global\let\octnumb@rsav\octnumber\global\let\octnumber\empty
       \else
        \global\let\octnumber\octnumb@rsav\vrule height\h@lf\Interligne
       \fi}}%
\makeatother
\def\fr#1#2{\smalltype C\kern -4pt$\mid$\hskip1pt{#1}{$_#2$}}
\def\Ibarre#1#2#3#4{\gdef\octnumber{\fr{#3}{#4}}\Ioctfinup{#1}{#2}}
\def\Tbarre#1{\roffset{1.3}{\Toctfin{#1}}}
%
% An attempt to adapt the above to work with a string symbol instead of a fret number:
\def\String#1{\smalltype{\circleit#1}}%
\def\Istring#1#2#3{\gdef\octnumber{\String{#3}}\Ioctfinup{#1}{#2}}%
\def\Istringd#1#2#3{\gdef\octnumber{\String{#3}}\Ioctfindown{#1}{#2}}
% (using \Ioctfindown doesn't change the direction of the vertical terminator)
\def\Tstring#1{\roffset{1.3}{\Toctfin{#1}}}%
%
%Example bars:
\centerline{Barre chord notation: This is exactly right and should not be changed in any way!}\bigskip
\guitarclef
\startextract
\NOtes\Ibarre1{w}{V}{6}\cu k\Ibu0lo4\dotted\islurd0l\qb0l\tslur0m\qb0m%
\qb0n\tbu0\qb0o\en
\NOTes\hqsk\Tbarre1\qu{_p}\en\endextract
%
\centerline{String symbol above staff -- OK except for line overstriking circled number; 
vertical termination correct (but not strictly necessary)}\bigskip
\startextract
\NOtes\Istring1{w}{2}\cu k\Ibu0lo4\qb0l\qb0m%
\qb0n\tbu0\qb0o\en
\NOTes\hqsk\Tstring1\qu{_p}\en\endextract
%
\centerline{String symbol below staff -- overstrike problem as above; 
vertical termination of line, if retained, should point upwards}
\startextract
\NOtes\Istringd2{M}{4}\cu d\Ibu0dh4\qb0e\qb0f%
\qb0g\tbu0\qb0h\en
\NOTes\hqsk\Tstring2\qu i\en\endextract
\bye
