From ff5db7582044f83493e79b3ec406bb8a64db0bac Mon Sep 17 00:00:00 2001 From: Steve Krulewitz Date: Thu, 5 Nov 2020 08:51:09 -0800 Subject: [PATCH] wip --- tex/skrul-leadsheet.cls | 48 ++++++++++++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/tex/skrul-leadsheet.cls b/tex/skrul-leadsheet.cls index 5dc5a97..ab31ed1 100644 --- a/tex/skrul-leadsheet.cls +++ b/tex/skrul-leadsheet.cls @@ -5,6 +5,7 @@ \RequirePackage{etoolbox} \RequirePackage{translations} +\RequirePackage{xstring} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} @@ -40,20 +41,41 @@ \char_set_catcode_other:N \# \char_set_catcode_parameter:N \! -\NewDocumentCommand \xchordname {m} {% - \str_case:nnTF {!1} - { - {B#} {\chordname{C}} - {F##} {\chordname{G}} - {F##/B} {\chordname{G/B}} - {Am/F##} {\chordname{Am/G}} - } - {} - {\chordname{!1}} -} -\char_set_catcode_parameter:N \# -\char_set_catcode_other:N \! +\bool_new:N \l__skrul_underline_boo +\tl_new:N \l__skrul_stripped_tl +\str_new:N \l__skrul_stripped_str + +\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 }} +} \ExplSyntaxOff \setleadsheets{