diff options
author | Karl Berry <karl@freefriends.org> | 2015-07-02 22:11:48 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-07-02 22:11:48 +0000 |
commit | fecdcd43eaa7f73e830159293fe22a202803086b (patch) | |
tree | 8236d44bc6ce2e5899af29d5fba8c5393801a989 /Master/texmf-dist/tex/latex/leadsheets/leadsheets.library.chordnames.code.tex | |
parent | 28c9b4ce4d428d1582c35205f79c62da999cf4d0 (diff) |
leadsheets (2jul15)
git-svn-id: svn://tug.org/texlive/trunk@37735 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/leadsheets/leadsheets.library.chordnames.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/leadsheets/leadsheets.library.chordnames.code.tex | 83 |
1 files changed, 32 insertions, 51 deletions
diff --git a/Master/texmf-dist/tex/latex/leadsheets/leadsheets.library.chordnames.code.tex b/Master/texmf-dist/tex/latex/leadsheets/leadsheets.library.chordnames.code.tex index 0843dcddfa0..8c875b60906 100644 --- a/Master/texmf-dist/tex/latex/leadsheets/leadsheets.library.chordnames.code.tex +++ b/Master/texmf-dist/tex/latex/leadsheets/leadsheets.library.chordnames.code.tex @@ -1,12 +1,9 @@ -\LeadsheetsExplLibrary{chordnames} - {2014/08/10 typesetting chord names with easy syntax} +\LeadsheetsExplLibrary{chordnames}{2015/07/02 typesetting chord names with easy syntax} \leadsheets_load_library:n {musicsymbols} -\bool_new:N \l__leadsheets_output_notation_german_bool -\bool_new:N \l__leadsheets_input_notation_german_bool -\bool_new:N \l__leadsheets_notation_literal_bool -\bool_set_true:N \l__leadsheets_notation_literal_bool +% \bool_new:N \l__leadsheets_output_notation_german_bool +% \bool_new:N \l__leadsheets_input_notation_german_bool \tl_new:N \l__leadsheets_chord_tl \tl_new:N \l__leadsheets_tension_tl @@ -17,6 +14,7 @@ \cs_new_protected:Npn \leadsheets_chord_sym:Nnn #1#2#3 { \tl_replace_all:Nnn #1 {#2} {#3} } +\cs_generate_variant:Nn \leadsheets_chord_sym:Nnn {NnV} \tl_new:N \l__leadsheets_sharp_tl \tl_new:N \l__leadsheets_flat_tl @@ -31,6 +29,8 @@ \tl_new:N \l__leadsheets_dim_tl \tl_new:N \l__leadsheets_add_tl \tl_new:N \l__leadsheets_major_seven_tl +\tl_new:N \l__leadsheets_german_B_tl +\tl_new:N \l__leadsheets_german_H_tl \tl_set:Nn \l__leadsheets_sharp_tl {\sharp} \tl_set:Nn \l__leadsheets_flat_tl {\flat} @@ -46,6 +46,8 @@ \tl_set:Nn \l__leadsheets_add_tl {\textsuperscript{add}} \tl_set:Nn \l__leadsheets_major_seven_tl {\textsuperscript{maj7}} \tl_set:Nn \l__leadsheets_major_nine_tl {\textsuperscript{maj9}} +\tl_set:Nn \l__leadsheets_german_B_tl {B} +\tl_set:Nn \l__leadsheets_german_H_tl {H} \group_begin: % for convenient input of sharps: @@ -74,23 +76,10 @@ \leadsheets_chord_sym:Nnn \l__leadsheets_chord_tl {sus} {\l__leadsheets_sus_tl} \leadsheets_chord_sym:Nnn \l__leadsheets_chord_tl {^} {\textsuperscript} - \bool_if:NF \l__leadsheets_notation_literal_bool + \bool_if:NT \l__leadsheets_output_notation_german_bool { - % convert to English to German input: - \bool_if:NT \l__leadsheets_input_notation_german_bool - { - \leadsheets_chord_sym:Nnn \l__leadsheets_chord_tl {B} {@@@} - \leadsheets_chord_sym:Nnn \l__leadsheets_chord_tl {H} {B} - \leadsheets_chord_sym:Nnn \l__leadsheets_chord_tl {@@@} {Bb} - } - % convert to English to German output: - \bool_if:NT \l__leadsheets_output_notation_german_bool - { - \leadsheets_chord_sym:Nnn \l__leadsheets_chord_tl {Bb} {@@@} - \leadsheets_chord_sym:Nnn \l__leadsheets_chord_tl {B} {H} - \leadsheets_chord_sym:Nnn \l__leadsheets_chord_tl {@@@} {B} - \leadsheets_chord_sym:Nnn \l__leadsheets_chord_tl {B#} {H} - } + \leadsheets_chord_sym:NnV \l__leadsheets_chord_tl {B} \l__leadsheets_german_B_tl + \leadsheets_chord_sym:NnV \l__leadsheets_chord_tl {H} \l__leadsheets_german_H_tl } \leadsheets_chord_sym:Nnn \l__leadsheets_chord_tl {#b} {} \leadsheets_chord_sym:Nnn \l__leadsheets_chord_tl {b#} {} @@ -98,10 +87,10 @@ {\l__leadsheets_doublesharp_tl} \leadsheets_chord_sym:Nnn \l__leadsheets_chord_tl {bb} {\l__leadsheets_doubleflat_tl} - \leadsheets_chord_sym:Nnn \l__leadsheets_chord_tl {#} {\l__leadsheets_sharp_tl} - \leadsheets_chord_sym:Nnn \l__leadsheets_chord_tl {b} {\l__leadsheets_flat_tl} - \leadsheets_chord_sym:Nnn \l__leadsheets_chord_tl {dim} {\l__leadsheets_dim_tl} - \leadsheets_chord_sym:Nnn \l__leadsheets_chord_tl {add} {\l__leadsheets_add_tl} + \leadsheets_chord_sym:NnV \l__leadsheets_chord_tl {#} \l__leadsheets_sharp_tl + \leadsheets_chord_sym:NnV \l__leadsheets_chord_tl {b} \l__leadsheets_flat_tl + \leadsheets_chord_sym:NnV \l__leadsheets_chord_tl {dim} \l__leadsheets_dim_tl + \leadsheets_chord_sym:NnV \l__leadsheets_chord_tl {add} \l__leadsheets_add_tl \leadsheets_tension_sym:Nn \l__leadsheets_chord_tl {0} \leadsheets_tension_sym:Nn \l__leadsheets_chord_tl {1} \leadsheets_tension_sym:Nn \l__leadsheets_chord_tl {2} @@ -144,7 +133,7 @@ \group_end: } -\keys_define:nn {leadsheets/chordnames} +\keys_define:nn {leadsheets/chords} { format .tl_set:N = \l__leadsheets_format_tl , sharp .tl_set:N = \l__leadsheets_sharp_tl , @@ -161,33 +150,25 @@ dim .tl_set:N = \l__leadsheets_dim_tl , major-seven .tl_set:N = \l__leadsheets_major_seven_tl , major-nine .tl_set:N = \l__leadsheets_major_nine_tl , - output-notation .choice: , - output-notation/literal .code:n = - \bool_set_false:N \l__leadsheets_input_notation_german_bool - \bool_set_false:N \l__leadsheets_output_notation_german_bool - \bool_set_true:N \l__leadsheets_notation_literal_bool , - output-notation/german .code:n = - \bool_set_true:N \l__leadsheets_output_notation_german_bool - \bool_set_false:N \l__leadsheets_notation_literal_bool , - output-notation/english .code:n = - \bool_set_false:N \l__leadsheets_output_notation_german_bool - \bool_set_false:N \l__leadsheets_notation_literal_bool , - input-notation .choice: , - input-notation/literal .code:n = - \bool_set_false:N \l__leadsheets_input_notation_german_bool - \bool_set_false:N \l__leadsheets_output_notation_german_bool - \bool_set_true:N \l__leadsheets_notation_literal_bool , - input-notation/german .code:n = - \bool_set_true:N \l__leadsheets_input_notation_german_bool - \bool_set_false:N \l__leadsheets_notation_literal_bool , - input-notation/english .code:n = - \bool_set_false:N \l__leadsheets_input_notation_german_bool - \bool_set_false:N \l__leadsheets_notation_literal_bool + german-B .tl_set:N = \l__leadsheets_german_B_tl , + german-H .tl_set:N = \l__leadsheets_german_H_tl + % since version 0.2 those are defined in the `chords` library: + % output-notation .choice: , + % input-notation .choice: , } -\NewDocumentCommand \setchordnames {m} - { \keys_set:nn {leadsheets/chordnames} {#1} } +\NewDocumentCommand \setchords {m} + { \keys_set:nn {leadsheets/chords} {#1} } \NewDocumentCommand \chordname {} { \leadsheets_chord: } \endinput + +HISTORY: + +2014/08/10 - first version +2015/05/08 - drop `literal' option for input and output notation + - input/output notation is now handled by the `chords' library + - German output of B and H can be customized +2015/05/22 - improvements to the chord macros +2015/07/02 - this is not a use library any more |