songs/tex/skrul-leadsheet.cls

145 lines
3.2 KiB
OpenEdge ABL
Raw Normal View History

2019-09-06 04:35:14 +00:00
\ProvidesClass{skrul-leadsheet}
\LoadClassWithOptions{scrartcl}
2020-12-05 05:52:44 +00:00
\usepackage{savesym}
\usepackage{gchords}
\savesymbol{chord}
2019-09-06 04:35:14 +00:00
\RequirePackage{leadsheets}
\RequirePackage{etoolbox}
\RequirePackage{translations}
2019-09-09 02:43:57 +00:00
\usepackage[T1]{fontenc}
2019-09-06 04:35:14 +00:00
\usepackage[utf8]{inputenc}
2019-09-09 02:43:57 +00:00
\usepackage[sfdefault]{roboto}
2019-09-06 04:35:14 +00:00
\usepackage{geometry}
\geometry{
letterpaper,
2019-09-08 06:00:55 +00:00
margin=0.5in
2019-09-06 04:35:14 +00:00
}
\pagenumbering{gobble}
2019-10-09 04:03:58 +00:00
\usepackage[dvipsnames]{xcolor}
2019-09-06 04:35:14 +00:00
\definesongproperty{year}
2019-09-25 05:16:36 +00:00
\definesongproperty{meter}
2021-02-12 00:26:09 +00:00
\definesongproperty{note}
2019-09-06 04:35:14 +00:00
\definesongtitletemplate{leadsheet}{%
{\large \textbf{\songproperty{title}} - \songproperty{band}}
2019-09-25 05:16:36 +00:00
{\footnotesize
\space\space // \space\space \songproperty{year}
\space\space // \space\space key: \songproperty{key}
\ifsongproperty{capo}{// \space\space\capo}{}
\ifsongproperty{meter}{// \space\space\songproperty{meter} time}{}
2021-02-12 00:26:09 +00:00
\ifsongproperty{note}{// \space\space\songproperty{note}}{}
2019-09-25 05:16:36 +00:00
}
2019-09-09 04:35:54 +00:00
\vspace{-0.5\baselineskip}
\hrulefill
2019-09-06 04:35:14 +00:00
}
2019-10-14 04:49:33 +00:00
\ExplSyntaxOn
\char_set_catcode_other:N \#
\char_set_catcode_parameter:N \!
2020-11-05 16:51:09 +00:00
2020-11-06 06:16:53 +00:00
\prop_const_from_keyval:Nn \__skrul_enharmonic_map_prop
{
2021-02-11 05:18:53 +00:00
Am/F##=Am/G,
Ab#m=Am,
A##m7=Bm7,
2020-11-06 06:16:53 +00:00
B#=C,
2021-02-11 05:18:53 +00:00
B#m=Cm,
B#add9=Cadd9,
2021-02-12 00:26:09 +00:00
Bb#=B,
2021-02-11 05:18:53 +00:00
Bb#m7=Bm7,
2020-12-05 05:52:44 +00:00
B#maj7=Cmaj7,
B#m6=Cm6,
2021-02-11 05:18:53 +00:00
C##=D,
2021-02-12 00:26:09 +00:00
C##*=D*,
2021-02-11 05:18:53 +00:00
C##7=D7,
C##7*=D7*,
C##/F#=D/F#,
Db#=D,
D##m=Em,
D/Gb=D/F#,
2021-01-13 06:02:09 +00:00
Eb#m=Em,
2021-01-27 04:58:32 +00:00
Eb#m*=Em*,
2020-11-06 06:16:53 +00:00
E#=F,
F##=G,
2021-02-12 05:54:31 +00:00
F##*=G*,
2021-02-11 05:18:53 +00:00
F##7=G7,
F##/A##*=G/B*,
2020-11-06 06:16:53 +00:00
F##/B=G/B,
2020-11-23 05:43:33 +00:00
G#b*=G*,
G#b=G,
2021-02-11 05:18:53 +00:00
G##m7=Am7,
G##m7*=Am7*,
Gb#=G,
2020-11-23 05:43:33 +00:00
Eb#=E,
Db#7/F#=D7/F#,
2021-02-11 05:18:53 +00:00
A#=Bb,
(F##)=(G),
2021-03-10 05:23:20 +00:00
Cadd9=C\textsuperscript{add9},
A7=A\textsuperscript{7},
D7=D\textsuperscript{7},
F##sus2=G\textsuperscript{sus2},
B#maj7/F##=C\textsuperscript{maj7}/G,
Dm/E#=Dm/F
2020-11-06 06:16:53 +00:00
}
\cs_generate_variant:Nn \str_set:Nn {Nx}
2020-11-05 16:51:09 +00:00
2020-01-12 19:31:04 +00:00
\NewDocumentCommand \xchordname {m} {%
2020-11-23 05:43:33 +00:00
\tl_if_head_eq_charcode:nNTF { !1 } .
2020-11-06 06:16:53 +00:00
{
\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}}
}
2019-10-14 04:49:33 +00:00
}
2020-11-06 06:16:53 +00:00
\char_set_catcode_parameter:N \#
\char_set_catcode_other:N \!
2019-10-14 04:49:33 +00:00
\ExplSyntaxOff
2019-09-06 04:35:14 +00:00
\setleadsheets{
title-template = leadsheet,
align-chords=l,
2019-09-09 04:35:54 +00:00
verse/numbered,
2019-10-09 04:03:58 +00:00
chords/format = \color{black}\bfseries,
2019-10-14 04:49:33 +00:00
chord-cs = \xchordname,
2019-09-08 06:00:55 +00:00
verses-label-format = \itshape
2019-09-06 04:35:14 +00:00
}
\LeadsheetSurvive
\provideversetype{prechorus}[name=Prechorus]
\provideversetype*{prechorus*}[name=Prechorus]
2020-06-04 04:43:25 +00:00
\provideversetype{postchorus}[name=Postchorus]
\provideversetype*{postchorus*}[name=Postchorus]
2020-01-12 19:31:04 +00:00
\provideversetype{chorus1}[name=Chorus 1]
\provideversetype{chorus2}[name=Chorus 2]
2019-09-06 04:35:14 +00:00
\providerobustcmd*\lsenparen[1]{%
\expandcode{\noexpand\mklsenparen\mklsenparens{\unexpanded{#1}}}%
}
\providecommand*\mklsenparens{[]}
\providecommand*\mklsenparen[3]{\textup{#1}#3\textup{#2}}
\providerobustcmd*\instruction[1]{\lsenparen{\mkinstruction{#1}}}
\providecommand*\mkinstruction[1]{\emph{#1}}
\providerobustcmd*\choir[1]{\null\qquad\mkchoir{#1}}
\providecommand*\mkchoir[1]{\instruction{\leadsheetstranslate{choir}: #1}}
\LeadsheetEndSurvive