summaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-03-05 03:02:44 +0000
committerNorbert Preining <norbert@preining.info>2024-03-05 03:02:44 +0000
commit262a8b0c9d7aa383a7d1ec3a2efa25817abfc2d6 (patch)
treeaec7f5d2ebb9b9bc2939469f0deec23ce81b9d51 /graphics
parent2af51a2a2d7a231effe8ef99a49b76d8c65e80be (diff)
CTAN sync 202403050302
Diffstat (limited to 'graphics')
-rw-r--r--graphics/pgf/contrib/chordbars/README.md9
-rw-r--r--graphics/pgf/contrib/chordbars/chordbars.sty201
-rw-r--r--graphics/pgf/contrib/chordbars/chordbars_manual.pdfbin191771 -> 241969 bytes
-rw-r--r--graphics/pgf/contrib/chordbars/chordbars_manual.tex198
-rw-r--r--graphics/pgf/contrib/chordbars/listing_HOTRS.lst6
-rw-r--r--graphics/pgf/contrib/chordbars/listing_RBP.lst5
-rw-r--r--graphics/pgf/contrib/chordbars/listing_blues.lst8
-rw-r--r--graphics/pgf/contrib/chordbars/listing_halfbar.lst10
-rw-r--r--graphics/pgf/contrib/chordbars/listing_sharp_flat.lst6
-rw-r--r--graphics/pgf/contrib/chordbars/size_demo.pdfbin0 -> 106212 bytes
-rw-r--r--graphics/pgf/contrib/chordbars/size_demo.tex152
11 files changed, 456 insertions, 139 deletions
diff --git a/graphics/pgf/contrib/chordbars/README.md b/graphics/pgf/contrib/chordbars/README.md
index 1524cfd72f..345139cc25 100644
--- a/graphics/pgf/contrib/chordbars/README.md
+++ b/graphics/pgf/contrib/chordbars/README.md
@@ -4,9 +4,14 @@ A music-related LaTeX package useful to write chord grids.
From a given chord progression (a harmonic pattern), it draws nice rectangles (one square per bar) with the chord name inside, and shows the number of repetitions and the bar count.
For details, see included manual.
-Author: S. Kramm - 2018
+![One More Time](manual_lst/OneMoreTime.png)
-Licence: The LaTeX project public license (LPPL), version 1.3c
+* Author: S. Kramm - 2018-2024
+* Home page: https://github.com/skramm/chordbars
+* Manual: [chordbars_manual.pdf](chordbars_manual.pdf)
+* Licence: The LaTeX project public license (LPPL), version 1.3c
+
+latest release: v1.3.2, 02/03/2024
Available via CTAN: https://ctan.org/pkg/chordbars
diff --git a/graphics/pgf/contrib/chordbars/chordbars.sty b/graphics/pgf/contrib/chordbars/chordbars.sty
index 4064cf14c8..1945d9959f 100644
--- a/graphics/pgf/contrib/chordbars/chordbars.sty
+++ b/graphics/pgf/contrib/chordbars/chordbars.sty
@@ -1,5 +1,5 @@
%% file: chordbars.sty
-%% Copyright 2018 M. Sebastien Kramm
+%% Copyright 2018-2024 M. Sebastien Kramm
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3c
@@ -18,11 +18,17 @@
% Home page: https://github.com/skramm/chordbars
-% TODO define command to have 1 chord per beat
+% LOG:
+% - 20240302: bugfixes with ycoef (version 1.3.2)
+% - 20230331: added "ycoeff" parameter (version 1.3.1)
+% - 2020525
+% - added \addMeasures command
+% - added starred version of chordbar environment
+% TODO define command to have 1 chord per beat
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{chordbars}[2017-12-29 version 1.1]
+\ProvidesPackage{chordbars}[2024-03-02 version 1.3.2]
\RequirePackage{tikz}
\RequirePackage{pgfmath}
@@ -32,16 +38,29 @@
\RequirePackage{calc}
\RequirePackage{ifthen}
-%\RequirePackage{fixltx2e}
+\RequirePackage{wasysym} % for \fullmoon
+
+\RequirePackage{relsize} % added on 2020-01-18
\def\vspacebefore{1ex}
\def\vspaceafter{1ex}
+% This \dim command is used for diminished chords (until we find a nicer alternative)
+\def\dim{\fullmoon}
+
+\def\MajS{$\Delta$}
+\def\addN{\relscale{0.8}\mdseries add9}
+\def\susF{\relscale{0.8}\mdseries sus4}
+%\def\add4{\relscale{0.8}\mdseries add4}
+
\newcommand{\songtitle}
{
+%\tikzstyle{block} = [draw, rectangle, fill=blue!50,, text centered, minimum height=8mm,node distance=10em]
\begin{center}%
- \begin{tikzpicture}[line width=1.5pt]
- \tikzstyle{block} = [rectangle, draw, text width=20em, text centered, minimum height=4em]
+ \begin{tikzpicture}[line width=1.5pt]
+ \tikzstyle{block} = [rectangle, draw, text width=30em, text centered, minimum height=4em]
+% \tikzstyle{block} = [rectangle, draw, text centered, minimum height=4em]
+% \tikzstyle{block} = [rectangle, draw, minimum height=4em]
\node [block,font=\fontsize{20}{28}\selectfont\bfseries] (init) { \@title\\ \@author };
\end{tikzpicture}
\end{center}%
@@ -55,6 +74,8 @@
\newcounter{CurrentBar}
\newcounter{CurrentLine}
+\xdef\tempoBPM{100}
+
\newcommand{\bpm}[1]
{
\xdef\tempoBPM{#1}
@@ -81,6 +102,13 @@
\setcounter{CurrentBarInLine}{0}
}
+\newcommand{\addMeasures}[1]
+{
+ \addtocounter{NumMesure}{#1}
+ \setcounter{NumPart}{0}
+ \setcounter{CurrentBarInLine}{0}
+}
+
\newcommand{\printNbBars}
{
\ifthenelse{\boolean{printBarNumber}}
@@ -89,19 +117,25 @@
}{}
}
+% This boolean will be used to adjust horizontal position of the
+% number of repetitions when a half bar is added (see \addHalfBar)
+\newboolean{hasHalfBar}
+%\setboolean{hasHalfBar}{false}
+
\newboolean{printBarNumber}
\newcommand{\countbarsYes}
{
- \setboolean{printBarNumber}{true}
+ \setboolean{printBarNumber}{true}
}
\newcommand{\countbarsNo}
{
- \setboolean{printBarNumber}{false}
+ \setboolean{printBarNumber}{false}
}
\def\barsize{1.6}%
+\def\ycoeff{0.8}%
\def\delta{0.36}
\def\chordFontSize{\normalsize \bfseries}
@@ -125,28 +159,30 @@
\ifthenelse
{\boolean{printBarNumber}}
{
- \draw (0,-\barsize*.2) node [anchor=west, align=left,font=\titleFontSize] {Part \theNumPart: #3};
- \draw (-.3,.5*\barsize) node{\bf \theNumMesure};
+ \draw (0,-\barsize*.2) node [anchor=west, align=left,font=\titleFontSize]
+ {- Part \theNumPart: #3};
+ \draw (-.3,.5*\barsize) node
+ {\bf \theNumMesure};
}
{
\draw (0,-\barsize*.2) node [anchor=west, align=left,font=\titleFontSize] {#3};
}
\draw (0,0) -- (#2*\barsize,0); % horizontal lines
- \draw (0,\barsize) -- (#2*\barsize,\barsize);
+ \draw (0,\barsize*\ycoeff) -- (#2*\barsize,\barsize*\ycoeff);
- \draw (0,0) -- (0,\barsize); % first vertical line
- \draw (\barsize,0) -- (\barsize,\barsize); % second vertical line
- \draw (\barsize/2,\barsize/2) node [font=\chordFontSize]{#1}; % chord name
+ \draw (0,0) -- (0,\barsize*\ycoeff); % first vertical line
+ \draw (\barsize,0) -- (\barsize,\barsize*\ycoeff); % second vertical line
+ \draw (\barsize/2,\ycoeff*\barsize/2) node [font=\chordFontSize]{#1}; % chord name
\foreach \k in {2,...,{#2}}
{
- \draw (\k*\barsize,0) -- (\k*\barsize,\barsize);
+ \draw (\k*\barsize,0) -- (\k*\barsize,\barsize*\ycoeff);
\pgfmathsetmacro{\Axa}{(\k-1)*\barsize+\delta*\barsize}
\pgfmathsetmacro{\Axb}{\k*\barsize-\delta*\barsize}
- \pgfmathsetmacro{\Aya}{(1-\delta)*\barsize}
- \pgfmathsetmacro{\Ayb}{\delta*\barsize}
+ \pgfmathsetmacro{\Aya}{(1-\delta)*\barsize*\ycoeff}
+ \pgfmathsetmacro{\Ayb}{\delta*\barsize*\ycoeff}
\coordinate (A) at (\Axa,\Ayb);
\coordinate (B) at (\Axb,\Aya);
@@ -159,6 +195,7 @@
\end{tikzpicture}
}
\addtocounter{NumMesure}{#2}
+ \addtocounter{NumMesure}{-1}
}
%==========================================================================
@@ -167,8 +204,48 @@
% arg 2 {#3 inside}: part name (can be empty)
% optional arg: nb of repetitions (default is 1)
+% starred version: does not print the grid ! Only does the counters update, and prints these
+\newenvironment{chordbar*}[3][1]
+{
+ \refstepcounter{NumPart}
+ \refstepcounter{NumMesure}
+
+ \@ifundefined{c@TmpA}{\newcounter{TmpA}}{}
+ \setcounter{TmpA}{#1*#2+\value{NumMesure}-1}
+
+ \@ifundefined{c@TmpB}{\newcounter{TmpB}}{}
+ \setcounter{TmpB}{#1*#2}
+
+ \fontfamily{phv}\selectfont
+ \noindent\ignorespaces %
+% \vspace{\vspacebefore}
+
+ \begin{tikzpicture}
+ \ifthenelse
+ {\boolean{printBarNumber}}
+ {\pgfmathsetmacro{\xpos}{0.6}}
+ {\pgfmathsetmacro{\xpos}{0}}
+
+ \draw (0,0) node {}; % to align with other environments of the page
+
+ % if we have repetitions, we print it and also the total number of bars
+ \ifnum#1=1
+ {\draw (\xpos,-\barsize*.2) node [anchor=west, align=left,font=\titleFontSize]
+ {- Part \theNumPart: #3, #2 bars, [ \theNumMesure {} $\rightarrow$ \theTmpA {} ] }; }
+ \else
+ {\draw (\xpos,-\barsize*.2) node [anchor=west, align=left,font=\titleFontSize]
+ {- Part \theNumPart: #3, #2 bars $\times$ #1 (\theTmpB), [ \theNumMesure {} $\rightarrow$ \theTmpA {} ] }; }
+ \fi
+
+ \end{tikzpicture}
+
+ \setcounter{NumMesure}{\value{TmpA}}
+}
+
+
\newenvironment{chordbar}[3][1]
{
+ % "newline" command: just switches to next line
\newcommand{\newchordline}
{
\setcounter{CurrentBarInLine}{0}
@@ -186,7 +263,7 @@
{}
\refstepcounter{CurrentBarInLine}%
\pgfmathsetmacro{\x}{-\barsize/2+\theCurrentBarInLine*\barsize}
- \pgfmathsetmacro{\y}{\value{CurrentLine})*\barsize+\barsize/2}
+ \pgfmathsetmacro{\y}{\value{CurrentLine})*\barsize*\ycoeff+\barsize*\ycoeff/2}
\draw (\x,\y) node [font=\chordFontSize]{##1};%
}%
@@ -200,25 +277,24 @@
}
{}
\refstepcounter{CurrentBarInLine}%
- \typeout{CurrentBarInLine=\theCurrentBarInLine}
+% \typeout{CurrentBarInLine=\theCurrentBarInLine}
\draw ( %
{\barsize*(\theCurrentBarInLine-1)}, %
- {(\theCurrentLine+1)*\barsize} %
+ {(\theCurrentLine+1)*\barsize*\ycoeff} %
) %
-- %
( %
{\theCurrentBarInLine*\barsize}, %
- {\theCurrentLine*\barsize} %
+ {\theCurrentLine*\barsize*\ycoeff} %
);
- \draw (
+ \draw ( % print first chord
{-3*\barsize/4+\theCurrentBarInLine*\barsize},
- {\theCurrentLine*\barsize+1*\barsize/4}
+ {\theCurrentLine*\barsize*\ycoeff+1*\barsize/4*\ycoeff}
) node [font=\chordFontSize]{##1};
- \draw (
+ \draw ( % print second chord
{-\barsize/4+\theCurrentBarInLine*\barsize},
- {\theCurrentLine*\barsize+3*\barsize/4}
+ {\theCurrentLine*\barsize*\ycoeff+3*\barsize/4*\ycoeff}
) node [font=\chordFontSize]{##2};%
-
}
\newcommand{\repeatBar}%
@@ -234,8 +310,8 @@
\pgfmathsetmacro{\Axa}{(\theCurrentBarInLine-1)*\barsize+\delta*\barsize}
\pgfmathsetmacro{\Axb}{\theCurrentBarInLine*\barsize-\delta*\barsize}
- \pgfmathsetmacro{\Aya}{(1-\delta)*\barsize+\theCurrentLine*\barsize}
- \pgfmathsetmacro{\Ayb}{\delta*\barsize+\theCurrentLine*\barsize}
+ \pgfmathsetmacro{\Aya}{(1-\delta)*\barsize*\ycoeff+\theCurrentLine*\barsize*\ycoeff}
+ \pgfmathsetmacro{\Ayb}{\delta*\barsize*\ycoeff+\theCurrentLine*\barsize*\ycoeff}
\coordinate (A) at (\Axa,\Ayb);
\coordinate (B) at (\Axb,\Aya);
@@ -249,8 +325,8 @@
{ %
\pgfmathsetmacro{\Axa}{\theCurrentBarInLine*\barsize+\delta*\barsize}
\pgfmathsetmacro{\Axb}{(\theCurrentBarInLine+2)*\barsize-\delta*\barsize}
- \pgfmathsetmacro{\Aya}{(1-\delta)*\barsize+\theCurrentLine*\barsize}
- \pgfmathsetmacro{\Ayb}{\delta*\barsize+\theCurrentLine*\barsize}
+ \pgfmathsetmacro{\Aya}{(1-\delta)*\barsize*\ycoeff+\theCurrentLine*\barsize*\ycoeff}
+ \pgfmathsetmacro{\Ayb}{\delta*\barsize*\ycoeff+\theCurrentLine*\barsize*\ycoeff}
\coordinate (A) at (\Axa,\Ayb);
\coordinate (B) at (\Axb,\Aya);
@@ -271,41 +347,42 @@
\newcommand{\addHalfBar}[1]%
{
- \refstepcounter{NumMesure}%
- \refstepcounter{CurrentBarInLine}%
-
-% \pgfmathsetmacro{\xa}{(\theCurrentBarInLine-1)*\barsize}
-% \pgfmathsetmacro{\xb}{\theCurrentBarInLine*\barsize}
+ \setboolean{hasHalfBar}{true}
%
-% \pgfmathsetmacro{\ya}{\theCurrentLine*\barsize}
-% \pgfmathsetmacro{\ya}{(\theCurrentLine+1)*\barsize}
+% The part might have some repetitions (arg 1), so we need to increment
+% NumMesure by the number of repetions
+ \addtocounter{NumMesure}{#1}
+%
+ \refstepcounter{CurrentBarInLine}%
% diagonal line
% \draw (\xa,\ya) -- (\xb,\yb); A BUG HERE: investigate
\draw
- (\theCurrentBarInLine*\barsize,{\theCurrentLine*\barsize})
+ (\theCurrentBarInLine*\barsize,{\theCurrentLine*\barsize*\ycoeff})
--
- ({(\theCurrentBarInLine-1)*\barsize},{(\theCurrentLine+1)*\barsize});
+ ({(\theCurrentBarInLine-1)*\barsize},{(\theCurrentLine+1)*\barsize*\ycoeff});
% horizontal line
\draw
- (\theCurrentBarInLine*\barsize,{\theCurrentLine*\barsize})
+ (\theCurrentBarInLine*\barsize,{\theCurrentLine*\barsize*\ycoeff})
--
- ({(\theCurrentBarInLine-1)*\barsize},{(\theCurrentLine)*\barsize});
-
+ ({(\theCurrentBarInLine-1)*\barsize},{(\theCurrentLine)*\barsize*\ycoeff});
\pgfmathsetmacro{\x}{-3*\barsize/4+\theCurrentBarInLine*\barsize}
- \pgfmathsetmacro{\y}{\value{CurrentLine})*\barsize+\barsize/4}
+ \pgfmathsetmacro{\y}{\value{CurrentLine})*\barsize*\ycoeff+\barsize/4}
\draw (\x,\y) node [font=\chordFontSize]{##1};%
}
-
- \typeout{chordbar: START #3}
+
+% HERE beginning of environment code
+% \typeout{chordbar: START #3}
\fontfamily{phv}\selectfont
\setcounter{CurrentLine}{0}
\setcounter{CurrentBarInLine}{0}
\setcounter{CurrentBar}{0}
+% \setboolean{hasHalfBar}{true}
+ \setboolean{hasHalfBar}{false}
\refstepcounter{NumPart}%
\refstepcounter{NumMesure}%
@@ -333,15 +410,17 @@
% draw part title
\ifthenelse
{\boolean{printBarNumber}}
- {\draw (0,-\barsize*.2) node [anchor=west, align=left,font=\titleFontSize] {Part \theNumPart: #3};}
- {\draw (0,-\barsize*.2) node [anchor=west, align=left,font=\titleFontSize] {#3};}
+ {\draw (0,-\barsize*.2) node [anchor=west, align=left,font=\titleFontSize]
+ {- Part \theNumPart: #3};}
+ {\draw (0,-\barsize*.2) node [anchor=west, align=left,font=\titleFontSize]
+ {- #3};}
\pgfmathtruncatemacro{\nblines}{(#2-1)/\NumberOfBarsPerLine+1}
- \typeout{chordbarl: nblines=\nblines}
+% \typeout{chordbarl: nblines=\nblines}
\foreach \line in {1,...,\nblines}
{
- \draw (0,{\barsize*(\line-1)}) -- (0,\line*\barsize); % first vertical line
+ \draw (0,{\barsize*\ycoeff*(\line-1)}) -- (0,\line*\barsize*\ycoeff); % first vertical line
\xdef\nbbars{\NumberOfBarsPerLine}
\ifnum\line=\nblines
{
@@ -349,11 +428,11 @@
\xdef\nbbars{\nbbars}
}
\fi
- \typeout{chordbarl: nbbars=\nbbars}
+% \typeout{chordbarl: nbbars=\nbbars}
\foreach \k in {1,...,{\nbbars}}
{
- \draw (\k*\barsize,{(\line-1)*\barsize}) -- (\k*\barsize,{\line*\barsize});
- \draw (0,{\line*\barsize}) -- (\k*\barsize,{\line*\barsize});
+ \draw (\k*\barsize,{(\line-1)*\barsize*\ycoeff}) -- (\k*\barsize,{\line*\barsize*\ycoeff});
+ \draw (0,{\line*\barsize*\ycoeff}) -- (\k*\barsize,{\line*\barsize*\ycoeff});
\refstepcounter{CurrentBar}%
}
@@ -361,16 +440,23 @@
\setcounter{NumMesure}{#1*#2+\value{NumMesure}-1}
% print the number of repetitions
- \ifnum#1=1 {}
+ \ifnum#1=1 {} % do nothing
\else
- \ifthenelse
+%--------------------
+% THIS HERE IS WIP !
+ \ifthenelse
+ {\boolean{hasHalfBar}}
+ {\def\xoffset{2.0}}
+ {\def\xoffset{1.5}}
+%--------------------
+ \ifthenelse
{\boolean{printBarNumber}}
- {\draw (\NbBarsInitialLine*\barsize+1,0.5*\barsize) node {\Large \bf x~#1};}
+ {\draw (\NbBarsInitialLine*\barsize+\xoffset,0.5*\barsize) node {\Large \bf $\times$~#1};}
{}
\fi
}%
{
-\typeout{chordbar: END}
+%\typeout{chordbar: END}
\end{tikzpicture}
% } %
% \par\noindent%
@@ -378,6 +464,9 @@
\vspace{\vspaceafter}
}
+% REMOVE INDENTATION
+\setlength\parindent{0pt}
+
% so the user can use # without escaping
% see https://tex.stackexchange.com/questions/467562
\AtBeginDocument{\catcode`#=12 }
diff --git a/graphics/pgf/contrib/chordbars/chordbars_manual.pdf b/graphics/pgf/contrib/chordbars/chordbars_manual.pdf
index 088f4c9212..329f4b9320 100644
--- a/graphics/pgf/contrib/chordbars/chordbars_manual.pdf
+++ b/graphics/pgf/contrib/chordbars/chordbars_manual.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/chordbars/chordbars_manual.tex b/graphics/pgf/contrib/chordbars/chordbars_manual.tex
index ec162beeb3..f4f85b04ec 100644
--- a/graphics/pgf/contrib/chordbars/chordbars_manual.tex
+++ b/graphics/pgf/contrib/chordbars/chordbars_manual.tex
@@ -1,5 +1,5 @@
%% file: chordbars_manual.tex
-%% Copyright 2018 M. Sebastien Kramm
+%% Copyright 2018-2024 M. Sebastien Kramm
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3c
@@ -23,12 +23,16 @@
\usepackage[left=2.00cm,vmargin=1cm]{geometry}
\usepackage{mathcomp} % for \textdiscount
\usepackage{listings}
+\usepackage{mdframed}
+
+\usepackage{enumitem}
+\setlist{nosep}
\lstset{
frame=single
,language=TeX
,basicstyle=\ttfamily
- ,escapechar=\*
+% ,escapechar=\*
}
\usepackage{chordbars}
@@ -46,9 +50,9 @@
%\usepackage{parskip}
-\title{The chordbars Package}
+\title{The chordbars package}
\author{S. Kramm}
-\date{\today {} - release 1.1}
+\date{\today {} - release 1.3.2}
\begin{document}
\maketitle
@@ -63,11 +67,11 @@ Package home page: \url{https://github.com/skramm/chordbars}
\section{Motivation}
-This type of acompaniment notation is used when you don't need the melody, but you do need the exact chord and bar count.
+This type of accompaniment notation is used when you don't need the melody, but you do need the exact chord and bar count.
In that case, the full musical sheet is useless, although it can be used to print the chords.
So some people like to write down the requested song/chord structure in a graphical view (see below).
To produce these, some people use GUI software such as word processors, but this has a lot of drawbacks.
-The aim of this package is to have a \LaTeX way of producing these, with minimal effort.
+The aim of this package is to have a \LaTeX{} way of producing these, with minimal effort.
\section{Usage}
@@ -81,20 +85,22 @@ This argument will just be printed out "as is", usually something like Cm7, Db9,
For example, the classical 12-bar blues progression will be written as:
-\lstinputlisting{listing_blues.lst}
+\def\chordFontSize{\huge\bfseries}
+\lstinputlisting{manual_lst/listing_blues.lst}
This will be rendered as:
-\input{listing_blues.lst}
+\input{manual_lst/listing_blues.lst}
Each square stands for a 4-beat bar, and this is read left to right.
-The special symbol you can see in bars 4, 6 and 8 means "play the same content on this bar as the previous bar".
+The special symbol you can see in bars 4, 6 and 8 means "play the same (harmonic) content on this bar as the previous bar".
As usual with \LaTeX{} source files, spaces and line-feeds are ignored.
The default behavior is to have 4-bars long lines, but you can change this anytime by giving a different value to {\btt \tbs NumberOfBarsPerLine}. For example, issuing the command
+
\begin{lstlisting}
\def\NumberOfBarsPerLine{3}
\end{lstlisting}
@@ -102,7 +108,7 @@ The default behavior is to have 4-bars long lines, but you can change this anyti
just before the above source code will print out the same 12-bars blues as above, but in a rather awkward view with 6 bars per line\footnote{Don't do this, of course!}.
\def\NumberOfBarsPerLine{6}
-\input{listing_blues.lst}
+\input{manual_lst/listing_blues.lst}
\subsection{Handling song structure and bar count}
@@ -115,7 +121,7 @@ To enable this, you need to activate this option, with this inserted after the \
\end{lstlisting}
Then, this:
-\lstinputlisting{listingA.lst}
+\lstinputlisting{manual_lst/listingA.lst}
will give the following output, correctly printing out '13' as the initial bar number of the second part (part 1 is 4 bars long and is repeated 3 times).
@@ -123,22 +129,55 @@ will give the following output, correctly printing out '13' as the initial bar n
\resetchordbars
\countbarsYes
%\mbox{
-\input{listingA.lst}
+\input{manual_lst/listingA.lst}
%}
-\subsection{Two chords per bar.}
-The command \verb|\chordh| enables printing two chords per bar, as this happens quite often.
+\subsection{Two chords per bar}
+The command \verb|\chordh| ("h" for "{\em half-chord}") enables printing two chords per bar, as this happens quite often.
Its two arguments are the two chords of the bar.
For example, the well-know tune "House of the Rising Sun"\footnote{The Animals} chord structure can be printed as this:
-\lstinputlisting{listing_HOTRS.lst}
+\lstinputlisting{manual_lst/listing_HOTRS.lst}
This will be rendered as:
+\def\chordFontSize{\Large\bfseries}
\resetchordbars
\countbarsNo
-\input{listing_HOTRS.lst}
+\input{manual_lst/listing_HOTRS.lst}
+
+
+\subsection{Starred environment version}
+
+In some situations, the song structure will hold some repetitions of some parts, say first verse, second verse, chorus, third verse, chorus, ..., with every verse and every chorus having the same harmonic structure.
+This can of course be represented by a new "chordbar" environment for every part, in which you just copy/paste the chords from previous section.
+But this will quicky generate a sheet having more than one page, which can make it difficult to use live.
+Personally, it if can fit on a single page, it's the best.
+
+Thus, this package provides a "starred" environment version.
+It is there just as a reminder that at this step, you just play "part xx", and the reader must check out above on the sheet the "part xx".
+Its usage is similar to the regular version, unless you just keep it empty.
+It will keep track of the measure count, and generates a unified view.
+
+\lstinputlisting[float=*,caption=A demo of the starred environment version,label=lst:starred]{manual_lst/listing_starred.lst}
+
+For example, the above song structure could be written as Listing \ref{lst:starred}, and it will be rendered as seen on Fig.~\ref{fig:starred}.
+%This will be rendered as:
+\def\chordFontSize{\Large\bfseries}
+\resetchordbars
+\countbarsYes
+\begin{figure}
+\begin{mdframed}
+\input{manual_lst/listing_starred.lst}
+\end{mdframed}
+\caption{Rendering of Listing \ref{lst:starred}}
+\label{fig:starred}
+\end{figure}
+
+\subsection{Chord notation}
-\subsection{Sharps and flats.} If you know \LaTeX, you may know that the {\btt \#} character is a "reserved character" and as such you should'nt be able to use it inside your source file.
+\paragraph{Sharps and flats}
+
+If you know \LaTeX, you may know that the {\btt \#} character is a "reserved character" and as such you should'nt be able to use it inside your source file.
However a special trick has been used here so you can directly type {\btt \tbs chordf\{C\#\}}.
Warning: this {\bf may} lead to some problems in "some" situations, that are not yet clearly identified\footnote{See \url{https://tex.stackexchange.com/a/467566/11083} for details.}.
@@ -146,19 +185,61 @@ If you encounter an issue, please report it on the home page of this package and
The alternate solution is either to escape the \# or to use the {\btt \tbs sharp} and {\btt \tbs flat} symbols, that have been "textified" so you don't need to enter math mode.
This has the advantage of being also a bit "prettier", although maybe less readable (?).
-You can see below the compared renderings of the two alternatives:
+You can see below the compared renderings of the two alternatives.
+Keep in mind that the goal is not to be "pretty" but rather to be able to read it while performing on stage, in a potential difficult lighting situation.
+%in a dark environment such a gig stage.
\vspace{1em}
\noindent
-\begin{minipage}{0.54\textwidth}
-\lstinputlisting{listing_sharp_flat.lst}
+\begin{minipage}{0.6\textwidth}
+\lstinputlisting{manual_lst/listing_sharp_flat.lst}
+\end{minipage}
+%
+\begin{minipage}{0.3\textwidth}
+\def\chordFontSize{\Huge\bfseries}
+\resetchordbars
+\countbarsNo
+\input{manual_lst/listing_sharp_flat.lst}
+\end{minipage}
+
+\paragraph{Other chords}
+This isn't directly related with the package but it provides some shorthands to write chord names.
+
+%For example in Europe the "m7b5" (VIIth degree of minor scale) is frequently noted \O{} and called "half-diminished" chord.
+%This is rendered with the \LaTeX{} native symbol {\tt \textbackslash O}.
+%The diminished chord, sometimes named "dim" (minor third, diminished fifth and minor seventh) is noted \dim.
+%This is rendered with the command {\tt \textbackslash dim}
+%(defined as an alias on symbol {\tt \textbackslash fullmoon} from package {\tt wasysym}.
+\begin{itemize}
+\item The "m7b5" (VIIth degree of minor scale) is frequently noted \O{} and called "half-diminished" chord.
+This is rendered with the \LaTeX{} native symbol {\tt \textbackslash O}.
+\item The diminished chord, sometimes named "dim" (minor third, diminished fifth and minor seventh) is noted \dim.
+This is rendered with the command {\tt \textbackslash dim}
+(defined as an alias on symbol {\tt \textbackslash fullmoon} from package {\tt wasysym}.
+\item The Maj7 chord is sometimes noted $\Delta$
+(\LaTeX{} math symbol {\tt \$\textbackslash Delta\$}).
+A shorthand is provided with the symbol {\tt \textbackslash MajS}.
+
+\item the "sus4" (chord without a third and with an added 4th) and the "add9" (chord without a 7th and with an added 9th) can be noted with
+{\tt \textbackslash susF} and {\tt \textbackslash addN}.
+\end{itemize}
+
+See below a comparison of these notations:
+
+\def\chordFontSize{\normalsize\bfseries}
+\noindent
+\begin{minipage}{0.40\textwidth}
+\lstinputlisting{manual_lst/listing_notation.lst}
\end{minipage}
%
-\begin{minipage}{0.42\textwidth}
-\input{listing_sharp_flat.lst}
+\begin{minipage}{0.60\textwidth}
+\def\NumberOfBarsPerLine{5}
+\def\barsize{2.3}
+\input{manual_lst/listing_notation.lst}
\end{minipage}
+
\subsection{Long parts on same chord}
In some songs, you often have several bars on the same chord, say as an introduction or a bridge between two parts.
Instead of filling a whole chordbars environment, a command is provided that will simply render the desired number of bars with the initial chord noted in first bar.
@@ -177,19 +258,18 @@ Please note that this will always be a single line, so it is limited to standard
\subsection{Half bars}
-In some tunes, there can be a "special" bar inserted at one point that only has 2 beats instead of the regular 4-beat bars .
+In some tunes, there can be a "special" bar inserted at one point that only has 2 beats instead of the regular 4-beat bars.
This is handled with the special command {\btt \tbs addHalfBar} thats needs to be inserted in last position in a {\btt chordbar} environment.
See for example this chord progression and its rendering:
-\lstinputlisting{listing_halfbar.lst}
+\lstinputlisting{manual_lst/listing_halfbar.lst}
\resetchordbars
\countbarsYes
-\input{listing_halfbar.lst}
+\input{manual_lst/listing_halfbar.lst}
-"Part 1" has an extra 2-beats bar added at the end, and the bar count is adjusted to take this into account.
-So "Part 2" starts at bar 6.
+Parts 2 and 3 have an extra 2-beats bar added at the end, and the bar count is adjusted to take this into account, even in the case of part repetitions.
\subsection{Song title}
@@ -202,21 +282,31 @@ The package provides a {\btt \tbs songtitle} command that will format nicely the
Several commands allow to customize the way the grids are printed out.
-\begin{itemize}
+\subsection{Grid size}
-\item The size of the grids can be adjusted with the internal variable
+The size of the grids can be adjusted with the internal variable
{\btt \tbs barsize}.
-The default value is 1.6, but you can adjust it anytime inside your document, for example with:\\
+The default value is 1.6cm, but you can adjust it anytime inside your document, for example with:\\
{\btt \tbs def\tbs barsize\{1.8\}}
+The default behavior is to have a ratio of 0.8 between the vertical size and the horizontal size of the grid.
+This can be adjusted any time in the document with, say: \\
+{\btt \tbs def\tbs ycoeff\{0.6\}} \\
+(A value of 1 will produce squares).
+
+\subsection{Font}
+
The font used for the chords can be adjusted by redefining the variable {\btt \tbs chordFontSize} with classical \LaTeX{} font specifications.
The default value is {\btt \tbs normalsize \tbs bfseries}.
-If you need better readability when extending grid size, you can add for example this, in the preamble of the document:
+If you need better readability when extending grid size, you can add for example this anywhere in your document:
+
+{\btt \tbs def\tbs chordFontSize\{\tbs huge\tbs bfseries\}}
-{\btt \tbs def\tbs chordFontSize\{\tbs large\tbs bfserie\}}
+To see an example of relative sizes, check the provided file \href{https://github.com/skramm/chordbars/raw/master/size_demo.pdf}{size\_demo.pdf}.
+\subsection{Bar count}
-\item The command {\btt \tbs countbarsYes} enables counting the bars of the song:
+The command {\btt \tbs countbarsYes} enables counting the bars of the song:
each grid will have printed on the left side the number of the first bar of the grid.
It also enables printing the number of repetitions of this part on the right side of the grid.
@@ -225,11 +315,11 @@ it can provide the whole structure of a song.
In that case, it is useful to have for each part the number of repetitions and the bar count, so that when the band leader says "lets start again at bar 75", everybody can find it easily.
On the other side, this package can be used also to provide a quick way to show the harmony of the different parts, without any structure or bar count.
-This, printing the bar number becomes useless.
+In this situation, printing the bar number is useless.
To stop this behaviour (anytime), the command is {\btt \tbs countbarsNo}.
-\item Additionaly, if the bar counting is enabled, then the package can compute the total number of bars and the duration of the song.
+Additionaly, if the bar counting is enabled, then the package can compute the total number of bars and the duration of the song.
This is done by issuing the command {\btt \tbs printNbBars} at the end of the file.
The duration of the song depends on both the {\em tempo} of the song, expressed in BPM, and the number of beats per bar.
The latter can be given with the command {\btt \tbs bpm}, for example:
@@ -239,25 +329,29 @@ The number of beats per bar is limited at present at two values, 3 or 4, with th
{\btt \tbs bpbfour} or {\btt \tbs bpbthree}.
The default value is 4 beats per bar.
-\item As you have seen above, the command {\btt \tbs repeatBar} will be rendered as "./."
+The command {\ttfamily \textbackslash resetchordbars} will reset the bar and part counters, useful if you want to print two songs in the same document.
+
+\subsection{Repeating bars}
+
+As you have seen above, the command {\btt \tbs repeatBar} will be rendered as "./."
%$\textdiscount${}
and means "repeat last bar".
In some situations, it can be useful to show a repetition spanning two bars.
For this you can use {\btt \tbs repeatBarPair}.
-For example, see the source below showing a classical II-V-I pattern played twice and its rendering:
+For example, see the source below showing a classical II-V-I pattern played 4 times and its rendering:
+
+\def\NumberOfBarsPerLine{8}
+\vspace{1em}
\noindent
-\begin{minipage}{0.45\textwidth}
-\lstinputlisting{listing_RBP.lst}
-\end{minipage}
+%\begin{minipage}{0.45\textwidth}
+\lstinputlisting{manual_lst/listing_RBP.lst}
+%\end{minipage}
%
-\begin{minipage}{0.42\textwidth}
+%\begin{minipage}{0.42\textwidth}
\countbarsNo
-\input{listing_RBP.lst}
-\end{minipage}
-
-\item {\ttfamily \textbackslash resetchordbars}: this will reset the bar and part counters, useful if you want to print two songs in the same document.
-\end{itemize}
+\input{manual_lst/listing_RBP.lst}
+%\end{minipage}
\section{Reference}
@@ -286,6 +380,18 @@ In that case, you just need to enlarge the grid size and/or adjust the font size
\item 2018-12-28: First release (v1.0) and upload to CTAN
\item 2018-12-29: Release 1.1, added commands {\btt \tbs chordline} and {\btt \tbs addHalfBar}, added font commands, fixed manual, bugfixes
+
+\item 2020-05-29: release 1.2.2
+\begin{itemize}
+\item fixed symbol ("times") for nb of repetitions
+\item added some chords shorthands (dim, MajS, sus4, add9)
+\item fixed horizontal position of number of repetitions (WIP !!!)
+\item added starred version of environment chordbar
+\item bugfixes
+\end{itemize}
+
+\item 2024-03-02: release 1.3.2 (bugfix, added Makefile)
+
\end{itemize}
diff --git a/graphics/pgf/contrib/chordbars/listing_HOTRS.lst b/graphics/pgf/contrib/chordbars/listing_HOTRS.lst
deleted file mode 100644
index d16edc4c19..0000000000
--- a/graphics/pgf/contrib/chordbars/listing_HOTRS.lst
+++ /dev/null
@@ -1,6 +0,0 @@
-\begin{chordbar}{4}{House of the Rising sun}
-\chordh{Am}{C}
-\chordh{D}{F}
-\chordh{Am}{E}
-\repeatBar
-\end{chordbar}
diff --git a/graphics/pgf/contrib/chordbars/listing_RBP.lst b/graphics/pgf/contrib/chordbars/listing_RBP.lst
deleted file mode 100644
index 8db632b046..0000000000
--- a/graphics/pgf/contrib/chordbars/listing_RBP.lst
+++ /dev/null
@@ -1,5 +0,0 @@
-\begin{chordbar}{4}{}
-\chordh{G}{C7}
-\chordf{FMaj7}
-\repeatBarPair
-\end{chordbar}
diff --git a/graphics/pgf/contrib/chordbars/listing_blues.lst b/graphics/pgf/contrib/chordbars/listing_blues.lst
deleted file mode 100644
index bfb1ba80c5..0000000000
--- a/graphics/pgf/contrib/chordbars/listing_blues.lst
+++ /dev/null
@@ -1,8 +0,0 @@
-\begin{chordbar}{12}{Classical 12 bar E blues}
-\chordf{E} \chordf{A}
-\chordf{E} \repeatBar
-\chordf{A} \repeatBar
-\chordf{E} \repeatBar
-\chordf{B} \chordf{A}
-\chordf{E} \chordf{B}
-\end{chordbar}
diff --git a/graphics/pgf/contrib/chordbars/listing_halfbar.lst b/graphics/pgf/contrib/chordbars/listing_halfbar.lst
deleted file mode 100644
index a84ef26680..0000000000
--- a/graphics/pgf/contrib/chordbars/listing_halfbar.lst
+++ /dev/null
@@ -1,10 +0,0 @@
-\begin{chordbar}{4}{}
-\chordh{G}{C7} \chordf{FMaj7}
-\chordf{C} \chordf{D}
-\addHalfBar{Dm}
-\end{chordbar}
-
-\begin{chordbar}{4}{}
-\chordh{G}{C7} \chordf{FMaj7}
-\chordf{C} \chordf{D}
-\end{chordbar}
diff --git a/graphics/pgf/contrib/chordbars/listing_sharp_flat.lst b/graphics/pgf/contrib/chordbars/listing_sharp_flat.lst
deleted file mode 100644
index c8777e3a29..0000000000
--- a/graphics/pgf/contrib/chordbars/listing_sharp_flat.lst
+++ /dev/null
@@ -1,6 +0,0 @@
-\begin{chordbar}{4}{Sharps and flats}
-\chordf{E#}
-\chordf{E\sharp}
-\chordf{Eb}
-\chordf{E\flat}
-\end{chordbar}
diff --git a/graphics/pgf/contrib/chordbars/size_demo.pdf b/graphics/pgf/contrib/chordbars/size_demo.pdf
new file mode 100644
index 0000000000..a670e65f49
--- /dev/null
+++ b/graphics/pgf/contrib/chordbars/size_demo.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/chordbars/size_demo.tex b/graphics/pgf/contrib/chordbars/size_demo.tex
new file mode 100644
index 0000000000..2401364945
--- /dev/null
+++ b/graphics/pgf/contrib/chordbars/size_demo.tex
@@ -0,0 +1,152 @@
+\documentclass[12pt]{article}
+\usepackage[utf8]{inputenc}
+\usepackage[left=2.00cm,vmargin=1cm]{geometry}
+\usepackage[12pt]{moresize}
+\usepackage{hyperref}
+\usepackage{chordbars}
+
+\title{Size demo of the chordbars package}
+\author{S. Kramm}
+
+\begin{document}
+
+
+\countbarsNo
+
+\songtitle
+
+Package home page: https://github.com/skramm/chordbars
+
+This is an size demo for the \LaTeX chordbars package, provided to be able to have a quick glance at what size choices can be done.
+It is build with the "article" class,
+using a default "12pt" font size and the "moresize" package
+\footnote{Without this additional package, and according to \url{https://www.sascha-frank.com/latex-font-size.html},
+the \textbackslash huge and \textbackslash Huge sizes are both 25pt (the same!) when using the "12pt" article option.
+This is not the case when using "11pt" font size.}.
+See chordbars manual or source file for details.
+
+Build on \today.
+
+\section{- barsize=1.5}
+\def\barsize{1.5}%
+
+\def\chordFontSize{\large\bfseries}
+\begin{chordbar}{4}{Font=large}
+\chordf{C}
+\chordf{Dm7}
+\chordf{Em7}
+\chordf{F\MajS}
+\end{chordbar}
+
+
+\def\chordFontSize{\Large\bfseries}
+\begin{chordbar}{4}{Font=Large}
+\chordf{C}
+\chordf{Dm7}
+\chordf{Em7}
+\chordf{F\MajS}
+\end{chordbar}
+
+\def\chordFontSize{\LARGE\bfseries}
+\begin{chordbar}{4}{Font=LARGE}
+\chordf{C}
+\chordf{Dm7}
+\chordf{Em7}
+\chordf{F\MajS}
+\end{chordbar}
+
+\section{- barsize=2}
+\def\barsize{2}%
+
+\def\chordFontSize{\LARGE\bfseries}
+\begin{chordbar}{4}{Font=LARGE}
+\chordf{C}
+\chordf{Dm7}
+\chordf{Em7}
+\chordf{F\MajS}
+\end{chordbar}
+
+\def\chordFontSize{\huge\bfseries}
+\begin{chordbar}{4}{Font=huge}
+\chordf{C}
+\chordf{Dm7}
+\chordf{Em7}
+\chordf{F\MajS}
+\end{chordbar}
+
+
+\def\chordFontSize{\Huge\bfseries}
+\begin{chordbar}{4}{Font=Huge}
+\chordf{C}
+\chordf{Dm7}
+\chordf{Em7}
+\chordf{F\MajS}
+\end{chordbar}
+
+
+\section{- barsize=2.5}
+\def\barsize{2.5}%
+
+\def\chordFontSize{\LARGE\bfseries}
+\begin{chordbar}{4}{Font=LARGE}
+\chordf{C}
+\chordf{Dm7}
+\chordf{Em7}
+\chordf{F\MajS}
+\end{chordbar}
+
+\def\chordFontSize{\huge\bfseries}
+\begin{chordbar}{4}{Font=huge}
+\chordf{C}
+\chordf{Dm7}
+\chordf{Em7}
+\chordf{F\MajS}
+\end{chordbar}
+
+
+\def\chordFontSize{\Huge\bfseries}
+\begin{chordbar}{4}{Font=Huge}
+\chordf{C}
+\chordf{Dm7}
+\chordf{Em7}
+\chordf{F\MajS}
+\end{chordbar}
+
+\section{- barsize=3}
+\def\barsize{3}%
+
+\def\chordFontSize{\LARGE\bfseries}
+\begin{chordbar}{4}{Font=LARGE}
+\chordf{C}
+\chordf{Dm7}
+\chordf{Em7}
+\chordf{F\MajS}
+\end{chordbar}
+
+\def\chordFontSize{\huge\bfseries}
+\begin{chordbar}{4}{Font=huge}
+\chordf{C}
+\chordf{Dm7}
+\chordf{Em7}
+\chordf{F\MajS}
+\end{chordbar}
+
+
+\def\chordFontSize{\Huge\bfseries}
+\begin{chordbar}{4}{Font=Huge}
+\chordf{C}
+\chordf{Dm7}
+\chordf{Em7}
+\chordf{F\MajS}
+\end{chordbar}
+
+\def\chordFontSize{\HUGE\bfseries}
+\begin{chordbar}{4}{Font=HUGE}
+\chordf{C}
+\chordf{Dm7}
+\chordf{Em7}
+\chordf{F\MajS}
+\end{chordbar}
+
+
+\end{document}