Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions gchords.sty
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
\newcommand\fatsiz{1.6} % size of a fat note
% Changed by Margarita
%\newcommand\lenbar{2.0} % lenght of sixth part of barré
\newcommand\barrecirclesiz{0.9} % size of barre's rounded extreme
\newcommand\normalsiz{1.2} % size of a normal note
\newcommand\fingsiz{1.4} % size of the circle around a numbered finger
\newcommand\fatfingsiz{1.8} % size of the circle around a numbered finger
Expand Down Expand Up @@ -107,6 +108,53 @@
\newdimen\needsize
\newdimen\ascale

\newcount\barrefret
\newcount\barrefrom
\newcount\barreto
\newif\ifbarre
\barrefalse

\newcount\@barreX
\newcount\@barreY
\newcount\@barreW

\newcommand{\setbarre}[3]{%
\global\barrefret=#1\relax
\global\barrefrom=#2\relax
\global\barreto=#3\relax
\global\barretrue
}

\newcommand{\@drawbarre}{%
% Switch to half-units, same as putdots does for dots
\needsize=\ascale\divide\needsize by 2
\unitlength\needsize
% y: center of the barré-fret-slot
\@barreY=\numfrets
\advance\@barreY by \yoff
\advance\@barreY by -\barrefret
\multiply\@barreY by 2
\advance\@barreY by 1
% x: position of the first string
\@barreX=\barrefrom
\advance\@barreX by \xoff
\advance\@barreX by -1
\multiply\@barreX by 2
% width: number of strings
\@barreW=\barreto
\advance\@barreW by -\barrefrom
\multiply\@barreW by 2
% Line with filled circles at the extremes for rounded edges
\linethickness{3.5pt}
\put(\@barreX,\@barreY){\line(1,0){\@barreW}}
\thinlines
\put(\@barreX,\@barreY){\circle*{\barrecirclesiz}}
\advance\@barreX by \@barreW
\put(\@barreX,\@barreY){\circle*{\barrecirclesiz}}
% Restore unitlength
\unitlength\ascale
}

\newcommand\chord[3]{\vbox{\hbox{\ascale=\chordsize
\truewidth=\strings\advance\truewidth by -1
\advance\truewidth by \xoff
Expand Down Expand Up @@ -156,6 +204,7 @@
\edef\notelabel{}

\putdots{#2}{\chordsize}
\ifbarre\@drawbarre\global\barrefalse\fi
\put(\xoff,0){\hbox to \truewidth\ascale{\hss\namefont #3\hss}}
\end{picture}
}}}
Expand Down
Binary file modified gchords_doc.pdf
Binary file not shown.
15 changes: 15 additions & 0 deletions gchords_doc.tex
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,21 @@ \section{Quick guide}
\chords{\chord{}{p1p4,p1p3,p1p3,p1p3,p1p4,p1p4}{} \def\numfrets{20}
\chord{}{p{10}p{13},p{10}p{12},p{10}p{12},p{10}p{12},p{10}p{13},p{10}p{13}}{}}


%-------------------------------------------------------------------------
\section{Barre}

You can add a barre by prefixing it to the {\tt $\backslash$chord} command. \\
Example:
\begin{verbatim}
\setbarre{2}{1}{6}\chord{t}{n,p4,p4,p3,n,n}{FIS}
\end{verbatim}
Which produces \\ \setbarre{2}{1}{6}\chord{t}{n,p4,p4,p3,n,n}{FIS} \\
The first argument to {\tt $\backslash$setbarre} denotes the bar where the barre
must be located; the second denotes the string from which to start the barre;
the third denotes the string at which to end the barre.


%-------------------------------------------------------------------------
\section{Gchords and lyrics}

Expand Down