From c6885d0b88d37f01d8ef0fa8f783b9de4a216e37 Mon Sep 17 00:00:00 2001 From: Steve Krulewitz Date: Thu, 5 Nov 2020 22:16:53 -0800 Subject: [PATCH] add underlining --- songs/Scissor Sisters/Take Your Mama.tex | 10 ++-- tex/skrul-leadsheet.cls | 62 ++++++++++++------------ 2 files changed, 35 insertions(+), 37 deletions(-) diff --git a/songs/Scissor Sisters/Take Your Mama.tex b/songs/Scissor Sisters/Take Your Mama.tex index fe408d0..dd32263 100644 --- a/songs/Scissor Sisters/Take Your Mama.tex +++ b/songs/Scissor Sisters/Take Your Mama.tex @@ -4,7 +4,7 @@ \begin{intro} \begin{tabular}[t]{@{}lllll} -|_{.A#} & |_{G#} & |_{Cm} & |_{A#} & | 2x \\ +|_{A#} & |_{G#} & |_{Cm} & |_{A#} & | 2x \\ \end{tabular} \end{intro} @@ -46,12 +46,12 @@ When your ^{A#}mama heard the way that you'd been ^{G#}talking I tried to tell ^ \begin{prechorus} \instruction{Half time!} \\ -Now we ^{Cm}end up takin' the long ^{Cm/A#}way home -^{Cm/A}Lookin' overdressed wearin' ^{F}buckets of stale ^{A#}cologne \\ +Now we ^{Cm}end up takin' the ^{Cm/A#}long way home, +^{Cm/A}lookin' overdressed wearin' ^{F}buckets of stale ^{A#}cologne \\ It's so ^{Cm}hard to see streets on a ^{Cm/A#}country road when your ^{Cm/A}glasses in the garbage -and your ^{F}Continental's just got ^{A#}towed -\end{prechorus} +and your ^{F}Continental's just been ^{A#}towed +\end{prechorus} \begin{chorus1} \instruction{Repeat Chorus 1} diff --git a/tex/skrul-leadsheet.cls b/tex/skrul-leadsheet.cls index ab31ed1..26e2b44 100644 --- a/tex/skrul-leadsheet.cls +++ b/tex/skrul-leadsheet.cls @@ -5,7 +5,6 @@ \RequirePackage{etoolbox} \RequirePackage{translations} -\RequirePackage{xstring} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} @@ -42,40 +41,39 @@ \char_set_catcode_other:N \# \char_set_catcode_parameter:N \! -\bool_new:N \l__skrul_underline_boo -\tl_new:N \l__skrul_stripped_tl -\str_new:N \l__skrul_stripped_str +\prop_const_from_keyval:Nn \__skrul_enharmonic_map_prop + { + B#=C, + E#=F, + F##=G, + F##/B=G/B, + Am/F##=Am/G + } + +\cs_new:Npn \__skrul_get:V !1 + { + \prop_item:NV \__skrul_prop { !1 } + } + +\cs_generate_variant:Nn \str_set:Nn {Nx} \NewDocumentCommand \xchordname {m} {% - % \tl_if_head_eq_catcode:nNTF { !1 } . - % { \bool_set_true:N \l__skrul_underline_bool } - % { \bool_set_false:N \l__skrul_underline_bool } - - % \bool_if:NTF \l__skrul_underline_bool - % { \tl_set:Nn \l__skrul_stripped_tl { \tl_tail:n { !1 } } } - % { \tl_set:Nn \l__skrul_stripped_tl { !1 } } - - % \bool_if:NTF \l__skrul_underline_bool - % { \str_set:Nn \l__skrul_stripped_str { !1 } } - % { \str_set:Nn \l__skrul_stripped_str { !1 } } - - \tl_set:Nn \l__skrul_stripped_tl { !1 } - - \tl_set:Nf \l_mya_tl { \l__skrul_stripped_tl } - - \chordname \l_mya_tl - % \str_case:nnTF \l__skrul_stripped_tl - % { - % % Enharmonics - % {B#} {\chordname{C}} - % {E#} {\chordname{F}} - % {F##} {\chordname{G}} - % {F##/B} {\chordname{G/B}} - % {Am/F##} {\chordname{Am/G}} - % } - % {} - % {\chordname{ \l__skrul_stripped_tl }} + \tl_if_head_eq_catcode:nNTF { !1 } . + { + \str_set:Nx \l_tmpa_str { \str_tail:n !1 } + \prop_get:NVNTF \__skrul_enharmonic_map_prop \l_tmpa_str \__skrul_enharmonic_tl + { \underline{\chordname{\__skrul_enharmonic_tl}}} + { \underline{\chordname{\l_tmpa_str}}} + } + { + \prop_get:NnNTF \__skrul_enharmonic_map_prop { !1 } \__skrul_enharmonic_tl + { \chordname{\__skrul_enharmonic_tl}} + { \chordname{!1}} + } } +\char_set_catcode_parameter:N \# +\char_set_catcode_other:N \! + \ExplSyntaxOff \setleadsheets{