![]() | This template uses Lua: |
This template/module is under construction. It may be used for merging multiple parts of score-based music from Page namespace into a single music page in main namespace as well as for manual setting of staff width.
Usage
edit{{Tscore | start = | cont = | next = | score = | width = | debug = | layout = | lvarOne = | lvarTwo = | ... | svarOne = | svarTwo = | ... }}
Parameters
edit- start (optional): unique identifier for merging multiple pages with {{Tscore}} template, used on first page of music; if set, next also should be set.
- cont (optional): same identifier as for start, used on subsequent pages.
- next (optional): name of the next page in Page namespace that music from current page is continued on; the "Page:" prefix may be omitted. It is required if start is set.
- score (required): score code; note that vertical lines | shold be replaced by {{!}}. Extra variables containing music (s-variables) or lyrics (l-variables) can be used as
\sVariableName
and\lVariableName
; see below. - width {optional): staff line width (in milimeters); defaults to 180 as in standard <score>. Note, that for Page namespace width is now limited to 120.
- layout {optional): extra layout settings for <score>; you may need to set
indent = 0\cm
here to avoid first line indentation that is default in Lilypond. - debug {optional): set it to 1 to dump the code provided to lilypond; used only for debugging
- lvariable (where variable is an arbitrary sequence of letters) (optional): arbitrary variables used for merging multiple parts of lyrics across pages; values of the same lvariable are concatenated across subsequent pages, when generating music in main namespace. Number of variables is not limitted, The values must be set in all subsequent pages that are merged (even if empty on some of them)
- svariable (where variable is an arbitrary sequence of letters) (optional): arbitrary variables used for merging multiple parts of music (notes) across pages; values of the same svariable are concatenated across subsequent pages, when generating music in main namespace. Number of variables is not limitted, The values must be set in all subsequent pages that are merged (even if empty on some of them)
Remarks
edit- You may not use vertical lines
|
in music code when using this template; use {{!}} instead - You may not use other templates in music / lyrics code on all pages but first (wikicode of subsequent pages is parsed using LUA parser that may be mislead by such templates)
- You may not use pairs of unseparated brackets:
{{
,}}
in Lilypond code; separate them with a space:{ {
,} }
. - When displaying in main (or another except Page) namespace, the whole (merged) music is displayed as it is on first page (the one with start parameter). Templates from subsequent pages displays as empty (this is similar to {{hws}} / {{hwe}} behaviour).
- You should use the
\relative
Lilypond clause carefully; otherwise the results of merged music code may be shifted of one or move octaves. The safast is to set the base for\relative
on next page to the absolute value of last note at the previous page in each context (each svariable) or not use this clause at all. - The midi music generation and vorbis player are always set on
Examples
editSetting width
edit{{Tscore
|score = \new Staff { \time 4/4 \relative c { c4 d e f {{!}} g a b c {{!}} d e f g \bar "{{!}}." } }
|width = 60
}}
![\paper { #(set-paper-size "a4") }
\header { tagline = ##f }
\version "2.22.0"
\score {
\midi { }
\layout { line-width = #60
}
\new Staff { \time 4/4 \relative c { c'4 d e f | g a b c | d e f g \bar "|." } } }](http://upload.wikimedia.org/score/h/l/hl2w602yunthfyxpxx3xpvz327bhp90/hl2w602y.png)
No first line indentation
edit{{Tscore
|score = \new Staff { \time 4/4 \relative c { c4 d e f {{!}} g a b c {{!}} d e f g \bar "{{!}}." } }
|layout = indent = 0\cm
}}
![\paper { #(set-paper-size "a4") }
\header { tagline = ##f }
\version "2.22.0"
\score {
\midi { }
\layout { line-width = #180
indent = 0\cm}
\new Staff { \time 4/4 \relative c { c'4 d e f | g a b c | d e f g \bar "|." } } }](http://upload.wikimedia.org/score/s/7/s7qicklkzakr99uz57k4lawqdacifud/s7qicklk.png)
Using a variable
edit{{Tscore
|sThisIsMyVariable = c'4 d e f {{!}} g a b c {{!}} d e f g \bar "{{!}}."
|score = \new Staff { \time 4/4 \relative c \sThisIsMyVariable }
|layout = indent = 0\cm
}}
![sThisIsMyVariable = { c'4 d e f | g a b c | d e f g \bar "|." }
\paper { #(set-paper-size "a4") }
\header { tagline = ##f }
\version "2.22.0"
\score {
\midi { }
\layout { line-width = #180
indent = 0\cm}
\new Staff { \time 4/4 \relative c \sThisIsMyVariable } }](http://upload.wikimedia.org/score/3/a/3amtvn7mn5iwyar60506pk2ovtun8tq/3amtvn7m.png)
More variables
edit{{Tscore
|sBeginning = c'4 d e f {{!}} g a b c {{!}}
|sVolta = d e f g
|sAltOne = a2 b
|sAltTwo = a,2 r
|sEnd = b4 c d r \bar "{{!}}."
|score = \new Staff { \time 4/4 \relative c { \sBeginning \repeat volta 2 \sVolta \alternative { \sAltOne \sAltTwo } \sEnd } }
|layout = indent = 0\cm
}}
![sAltTwo = { a,2 r }
sBeginning = { c'4 d e f | g a b c | }
sEnd = { b4 c d r \bar "|." }
sVolta = { d e f g }
sAltOne = { a2 b }
\paper { #(set-paper-size "a4") }
\header { tagline = ##f }
\version "2.22.0"
\score {
\midi { }
\layout { line-width = #180
indent = 0\cm}
\new Staff { \time 4/4 \relative c { \sBeginning \repeat volta 2 \sVolta \alternative { \sAltOne \sAltTwo } \sEnd } } }](http://upload.wikimedia.org/score/r/3/r3a2267wutxlts3s6t34n4kpbtygynu/r3a2267w.png)
Merging
editThe following split code is equivalent to the above example:
- page #1
{{Tscore
|start=SomeMergedMusic
|next=page #2
|sBeginning = c'4 d e f {{!}} g a b c {{!}}
|sVolta =
|sAltOne =
|sAltTwo =
|sEnd =
|score = \new Staff { \time 4/4 \relative c { \sBeginning \repeat volta 2 \sVolta \alternative { \sAltOne \sAltTwo } \sEnd } }
|layout = indent = 0\cm
}}
- page #2
{{Tscore
|cont=SomeMergedMusic
|sBeginning =
|sVolta = d e f g
|sAltOne = a2 b
|sAltTwo = a,2 r
|sEnd = b4 c d r \bar "{{!}}."
|score = \new Staff { \time 4/4 \override Staff.TimeSignature #'transparent = ##t \relative c'' { \repeat volta 2 \sVolta \alternative { \sAltOne \sAltTwo } \sEnd } }
|layout = indent = 0\cm
}}
![sAltTwo = { a,2 r }
sEnd = { b4 c d r \bar "|." }
sVolta = { d e f g }
sAltOne = { a2 b }
\paper { #(set-paper-size "a4") }
\header { tagline = ##f }
\version "2.22.0"
\score {
\midi { }
\layout { line-width = #180
indent = 0\cm}
\new Staff { \time 4/4 \override Staff.TimeSignature #'transparent = ##t \relative c'' { \repeat volta 2 \sVolta \alternative { \sAltOne \sAltTwo } \sEnd } } }](http://upload.wikimedia.org/score/d/y/dyxasi6syq0xlerev3mj0mujzf7982o/dyxasi6s.png)
- Note: different code for score on page #2: especially different base for
\relative