From 376431f02a089c3a804247430b2533f042f6e098 Mon Sep 17 00:00:00 2001 From: Romain Goffe Date: Tue, 12 Jun 2012 23:03:59 +0200 Subject: [PATCH] Add new macro: transposition This macro depends on the repeatedchord environment: - if chords are repeated, acts like the \transpose macro from LaTeX package - if not, a muscinote information box is displayed with the number of half-steps for transposition This macro can prove usefull to hide the complexity of songs that transpose their verses (e.g: Barbara - L'aigle noir): in repeatedchords mode, the chords are explicitly displayed (in their transposed form), in norepeatedchords mode, it only provides the information that the verses should be transposed. --- tex/crepbook.cls | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tex/crepbook.cls b/tex/crepbook.cls index be5fc699..df525220 100644 --- a/tex/crepbook.cls +++ b/tex/crepbook.cls @@ -70,6 +70,7 @@ \RequirePackage{tikz} \RequirePackage{licence} \RequirePackage{xstring} +\RequirePackage{ifthen} \iflyric% \tabsfalse% @@ -522,4 +523,18 @@ \fi% } \fi + +\def\removefirstch@r#1{} +\newcommand{\transposition}[1]{% + \ifnorepeatchords% + \musicnote{% + \IfStrEq{\@lang}{english}{transposition:~}{}% + \IfStrEq{\@lang}{french}{transposition~:~}{}% + \ifthenelse{#1>0}{#1$\Uparrow$}{\removefirstch@r#1$\Downarrow$}% + }% + \else% + \transpose{#1} + \fi% +}% + \makeatother