The syntax for a normal repeat is
@example
-\repeat @var{variant} @var{repeatcount} @var{repeatbody}
+\repeat volta @var{repeatcount} @var{repeatbody}
@end example
-where @var{variant} is @qq{volta} and @var{repeatbody} is a music
-expression. Alternate endings can be produced using
-@code{\alternative}.
+where @var{repeatbody} is a music expression. Alternate endings can
+be produced using @code{\alternative}.
Normal repeats without alternate endings:
@c Is there a way to have a final bar ("|.") at the end of the
@c previous line? Doesn't seem to be.
If you want to start a repeat at the beginning of a line and have a
-double bar at the end of the previous line, use @code{\bar}. See
-@ref{Bar lines} for more information.
+double bar at the end of the previous line, use @code{\bar}. For more
+information, see @ref{Bar lines}.
@lilypond[quote,ragged-right,fragment,verbatim,relative=2]
c4 c c c
@seealso
-Music Glossary: @rglos{repeat}.
-@c FIXME : add @rglos{volta} after glossary addition
+Music Glossary: @rglos{repeat}, @rglos{volta}.
Notation Reference: @ref{Bar lines}, @ref{Modifying context plug-ins}.
@internalsref{RepeatedMusic}, @internalsref{VoltaRepeatedMusic},
@internalsref{UnfoldedRepeatedMusic}.
-@c Examples:
-
-
@knownissues
@cindex repeat, ambiguous
@seealso
-Notation Reference: @ref{Bar lines}.
+Notation Reference: @ref{Bar lines}, @ref{Text markup}.
Snippets: @lsrdir{Repeats,Repeats}
Internals Reference: @internalsref{VoltaBracket},
-@internalsref{RepeatedMusic}, @internalsref{VoltaRepeatedMusic},
-and @internalsref{UnfoldedRepeatedMusic}.
+@internalsref{RepeatedMusic}, @internalsref{VoltaRepeatedMusic}.
@node Written-out repeats
@subsubsection Written-out repeats
-unfold
+@cindex written-out repeats
+@cindex repetitious music
+@cindex repeats, written-out
+
+By using the @code{unfold} command, repeats can be used to simplify
+the writing out of repetitious music. The syntax is
+
+@example
+\repeat unfold @var{repeatcount} @var{repeatbody}
+@end example
+
+Unfold repeats can be made with or without alternate endings. Unfold
+repeats without alternate endings:
+@lilypond[quote,ragged-right,verbatim,fragment,relative=2]
+c1
+\repeat unfold 2 { c4 d e f }
+c1
+@end lilypond
+Unfold repeats with alternate endings:
+@lilypond[quote,ragged-right,verbatim,fragment,relative=2]
+c1
+\repeat unfold 2 { g f e d }
+ \alternative {
+ { cis2 g' }
+ { cis,2 b }
+ }
+c1
+@end lilypond
+
+@seealso
+
+Snippets: @lsrdir{Repeats,Repeats}.
+
+Internals Reference: @internalsref{RepeatedMusic},
+@internalsref{UnfoldedRepeatedMusic}.
@node Short repeats
@subsection Short repeats
@snippets
-@c FIXME: uncomment these when they have been added to git.
-@c @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
-@c {printing-marks-at-the-end-of-a-line-or-a-score.ly}
+@lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
+{printing-marks-at-the-end-of-a-line-or-a-score.ly}
-@c @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
-@c {aligning-marks-with-various-notation-objects.ly}
+@lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
+{aligning-marks-with-various-notation-objects.ly}
-@c @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
-@c {printing-marks-on-every-staff.ly}
+@lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
+{printing-marks-on-every-staff.ly}
@seealso
@code{\\markup} and @code{\\finger}.
" }
% begin verbatim
-one = \markup{ \finger "1" }
-two = \markup{ \finger "2" }
-threetwo = \markup{ \column {\finger "3" \finger "2"} }
-threefour = \markup{ \column {\finger "3" \finger "4"} }
+one = \markup { \finger "1" }
+two = \markup { \finger "2" }
+threeTwo = \markup { \column { \finger "3" \finger "2" } }
+threeFour = \markup { \column { \finger "3" \finger "4" } }
\score {
\context TabStaff {
\stemUp
- e8\4^\one b\2 < e, g\3 e'\1 >^>[ b\2 e\4]
- < a\3 fis'\1 >^>^\threetwo[ b\2 e\4]
+ e8\4^\one b\2 <e, g\3 e'\1>^>[ b\2 e\4]
+ <a\3 fis'\1>^>^\threeTwo[ b\2 e\4]
}
}
\header {
lsrtags = "text, vocal-music, spacing"
texidoc = "
-This snippets shows you how to bring the lyrics line closer to the
-Staff.
+This snippet shows you how to bring the lyrics line closer to the
+staff.
" }
% begin verbatim
% Default layout:
-\score{
- <<
- \new Staff \new Voice = m \relative c'{ c4 d e f g f e d c1}
- \new Lyrics \lyricsto m {aa aa aa aa aa aa aa aa aa }
- >>
-}
+<<
+ \new Staff \new Voice = melody \relative c '{ c4 d e f g f e d c1 }
+ \new Lyrics \lyricsto melody { aa aa aa aa aa aa aa aa aa }
+>>
-% Reducing the minimum space below the Staff and above the Lyrics:
-
-\score {
- <<
- \new Staff \with {
- \override VerticalAxisGroup #'minimum-Y-extent = #'(-1. 4)}
- \new Voice = m \relative c'{ c4 d e f g f e d c1 }
- \new Lyrics \with {
- \override VerticalAxisGroup #'minimum-Y-extent = #'(-1.2 . 1)}
- \lyricsto m {aa aa aa aa aa aa aa aa aa }
- >>
-
- \header {
- tagline = ""
- }
-}
+% Reducing the minimum space below the staff and above the lyrics:
+<<
+ \new Staff \with {
+ \override VerticalAxisGroup #'minimum-Y-extent = #'(-1 . 4) }
+ \new Voice = melody \relative c' { c4 d e f g f e d c1 }
+ \new Lyrics \with {
+ \override VerticalAxisGroup #'minimum-Y-extent = #'(-1.2 . 1) }
+ \lyricsto melody { aa aa aa aa aa aa aa aa aa }
+>>
texidoc = "
Instrument names are generally printed at the left side of the staves.
To align the names of several different intruments, you can put them in
-a \\markup block and use one of the following possibilites:
-
+a @code{\\markup} block and use one of the following possibilites:
*
- Right-aligned instrument names: this is LilyPond's default behavior
+ Right-aligned instrument names: this is the default behavior
*
- Center-aligned instrument names: with the \\hcenter-in #n syntax, you
- can place the instrument names inside a padded box (n being the width
+ Center-aligned instrument names: with the @code{\\hcenter-in #n}
+command, you
+ can place the instrument names inside a padded box (@code{n} being the
+width
of the box)
*
Left-aligned instrument names: you have to print the names on top of an
- empty box, using the \\combine command
- with a \\hspace #n object.
+ empty box, using the @code{\\combine} command
+ with an @code{\\hspace #n} object.
" }
% begin verbatim
-\paper{
- indent = #0
+\paper {
+ indent = #0
left-margin = #30
line-width = #160
}
-\new StaffGroup \relative
-<<
+\new StaffGroup \relative <<
\new Staff {
- \set Staff.instrumentName = "blabla"
- c1^"default" c1 \break
- \set Staff.instrumentName = \markup { \hcenter-in #10 "blabla" }
- c1^"centered" c1 \break
- \set Staff.instrumentName = \markup {\combine \hspace #8 "blabla" }
- c1^"left-aligned" c1
-
+ \set Staff.instrumentName = "Piccolo"
+ c1^"default" c \break
+ \set Staff.instrumentName = \markup { \hcenter-in #10 "Piccolo" }
+ c1^"centered" c \break
+ \set Staff.instrumentName = \markup { \combine \hspace #8 "Piccolo" }
+ c1^"left-aligned" c
}
\new Staff {
- \set Staff.instrumentName = "blo"
- c1 c1 \break
- \set Staff.instrumentName = \markup { \hcenter-in #10 "blo" }
- c1 c1 \break
- \set Staff.instrumentName = \markup {\combine \hspace #8 "blo" }
- c1 c1
- }
-
+ \set Staff.instrumentName = "Flute"
+ c1 c \break
+ \set Staff.instrumentName = \markup { \hcenter-in #10 "Flute" }
+ c1 c \break
+ \set Staff.instrumentName = \markup { \combine \hspace #8 "Flute" }
+ c1 c
+ }
>>
lsrtags = "text, vocal-music"
texidoc = "
You can specify different horizontal alignment for your lyrics, by
-overriding the @code{#'self-alignment-X} property of the
-@code{LyricText} object. @code{#-1} is left, @code{#0} is center and
-@code{#1} is right; however, you can use @code{#LEFT}, @code{#CENTER}
-and @code{#RIGHT} as well.
+overriding the @code{self-alignment-X} property of the @code{LyricText}
+object. @code{#-1} is left, @code{#0} is center and @code{#1} is right;
+however, you can use @code{#LEFT}, @code{#CENTER} and @code{#RIGHT} as
+well.
" }
% begin verbatim
\relative c'' {
\addlyrics {
\once \override LyricText #'self-alignment-X = #LEFT "This is left-aligned"
\once \override LyricText #'self-alignment-X = #CENTER "This is centered"
- \once \override LyricText #'self-alignment-X = #1 "this is right-aligned"
+ \once \override LyricText #'self-alignment-X = #1 "This is right-aligned"
}
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR http://lsr.dsi.unimi.it
+%% This file is in the public domain.
+\version "2.11.38"
+
+\header {
+ lsrtags = "text"
+ texidoc = "
+If specified, text marks may be aligned with notation objects other
+than bar lines. These objects include @code{ambitus},
+@code{breathing-sign}, @code{clef}, @code{custos}, @code{staff-bar},
+@code{left-edge}, @code{key-cancellation}, @code{key-signature}, and
+@code{time-signature}.
+
+
+
+In such cases, text marks will be horizontally centered above the
+object. However this can be changed, as demonstrated on the second line
+of this example (in a score with multiple staves, this setting should
+be done for all the staves).
+
+
+" }
+% begin verbatim
+\relative c' {
+ e1
+
+ % the RehearsalMark will be centered above the Clef
+ \override Score.RehearsalMark #'break-align-symbols = #'(clef)
+ \key a \major
+ \clef treble
+ \mark "↓"
+ e
+
+ % the RehearsalMark will be centered above the TimeSignature
+ \override Score.RehearsalMark #'break-align-symbols = #'(time-signature)
+ \key a \major
+ \clef treble
+ \time 3/4
+ \mark "↓"
+ e2.
+
+ % the RehearsalMark will be centered above the KeySignature
+ \override Score.RehearsalMark #'break-align-symbols = #'(key-signature)
+ \key a \major
+ \clef treble
+ \time 4/4
+ \mark "↓"
+ e1
+
+ \break
+ e
+
+ % the RehearsalMark will be aligned with the left edge of the KeySignature
+ \once \override Score.KeySignature #'break-align-anchor-alignment = #LEFT
+ \mark "↓"
+ \key a \major
+ e
+
+ % the RehearsalMark will be aligned with the right edge of the KeySignature
+ \once \override Score.KeySignature #'break-align-anchor-alignment = #RIGHT
+ \key a \major
+ \mark "↓"
+ e
+
+ % the RehearsalMark will be aligned with the left edge of the KeySignature
+ % and then shifted right by 1 unit.
+ \once \override Score.KeySignature #'break-align-anchor = #1
+ \key a \major
+ \mark "↓"
+ e1
+}
<< {
\voiceOne
\set subdivideBeams = ##t
- b'32[ a g f c' b a g b^"subdivision enabled" a g f c' b a g]
+ b'32[ a g f c' b a g b^"subdivide beams" a g f c' b a g]
\oneVoice
}
\new Voice {
texidoc = "
In a simple time signature of 2/2 or 4/4, 8th notes are beamed by
default as two sets of four. Using a macro which overrides the
-autobeaming behaviour, this snippet changes the beaming to quarter note
+autobeaming behavior, this snippet changes the beaming to quarter note
beats.
" }
% begin verbatim
% Automatic beams two per two in 4/4 or 2/2 time signature
-% _____
-% Default | | | |
-% _ _
-% I want | | | |
+% _____
+% Default | | | |
+% _ _
+% Required | | | |
% The good way adapted from David Bobroff
g8^\markup { without the macro } g g g g g g g |
g g g g4 g8 g g |
}
- %Use the macro
+ %Use the macro
\new Staff \relative c'' {
\time 4/4
\qbeam
white box will not overlap any other grob.
" }
% begin verbatim
-{
+\relative {
\override TextScript #'extra-offset = #'(2 . 4)
- c'2-\markup { \whiteout \pad-markup #0.5 foo } c
+ c2-\markup { \whiteout \pad-markup #0.5 "middle C" } c
}
lsrtags = "expressive-marks, text"
texidoc = "
This example provides a function to typeset a hairpin (de)crescendo
-with some additional text below it, such as \"molto\" or \"poco\".The
+with some additional text below it, such as \"molto\" or \"poco\". The
example also illustrates how to modify the way an object is normally
printed, using some Scheme code.
" }
lsrtags = "rhythms"
texidoc = "
By default, only the numerator of the tuplet number is printed over the
-tuplet bracket, i.e. the denominator of the argument to the
+tuplet bracket, i.e., the denominator of the argument to the
@code{\\times} command. Alternatively, num:den of the tuplet number may
be printed, or the tuplet number may be suppressed altogether.
" }
Custodes may be engraved in various styles.
" }
% begin verbatim
-\layout {
- \context {
- \Staff
- \consists Custos_engraver
- }
- ragged-right = ##t
-}
-
-{
- \override Staff.Custos #'neutral-position = #4
-
- \override Staff.Custos #'style = #'hufnagel
- c'1^"hufnagel"
- \break < d' a' f''>1
+\layout { ragged-right = ##t }
- \override Staff.Custos #'style = #'medicaea
- c'1^"medicaea"
- \break < d' a' f''>1
-
- \override Staff.Custos #'style = #'vaticana
- c'1^"vaticana"
- \break < d' a' f''>1
-
- \override Staff.Custos #'style = #'mensural
- c'1^"mensural"
- \break < d' a' f''>1
+\new Staff \with { \consists "Custos_engraver" } \relative c' {
+ \override Staff.Custos #'neutral-position = #4
+
+ \override Staff.Custos #'style = #'hufnagel
+ c1^"hufnagel" \break
+ <d a' f'>
+
+ \override Staff.Custos #'style = #'medicaea
+ c^"medicaea" \break
+ <d a' f'>
+
+ \override Staff.Custos #'style = #'vaticana
+ c^"vaticana" \break
+ <d a' f'>
+
+ \override Staff.Custos #'style = #'mensural
+ c^"mensural" \break
+ <d a' f'>
}
-
\header {
lsrtags = "vocal-music, piano-music, strings, midi"
texidoc = "
-Problem: How to know which MidiInstrument would be best for your
-composition? Solution: A Lilypond demo file.
-" }
-% begin verbatim
-%\version "2.11.38"
+Problem: How to know which @code{midiInstrument} would be best for your
+composition?Solution: A LilyPond demo file.
-basemelodie = { c'4. \mf g c'16 b' c'' d'' | e'' d'' e'' f'' g''4 g'''4 r | r1 }
-melodie = { \tempo 4 = 150 \basemelodie }
+" }
+% begin verbatim
\header {
title = "Demo of all midi sounds"
- arranger = "Myself"
+ arranger = "Myself "
}
-\score {
+basemelodie = \relative c' {
+ c4. \mf g c16 b' c d |
+ e d e f g4 g'4 r |
+ r1
+}
+melodie = { \tempo 4 = 150 \basemelodie }
+
+\score {
\new Staff <<
\new Voice { \melodie
- } %Voice
- >> %Staff
- \layout { }
-} %score
+ }
+ >>
+ \layout { }
+}
\score {
\new Staff <<
- \tempo 4 = 180
- %\set Staff.instrumentName="S/A"
+ %\set Staff.instrumentName= "S/A"
%\set Staff.midiMinimumVolume = #0.2
%\set Staff.midiMaximumVolume = #0.4
%\set Voice.dynamicAbsoluteVolumeFunction = #0.6
\new Voice { r \mf
- \set Staff.midiInstrument="acoustic grand" \melodie
- \set Staff.midiInstrument="bright acoustic" \melodie
- \set Staff.midiInstrument="electric grand" \melodie
- \set Staff.midiInstrument="honky-tonk" \melodie
- \set Staff.midiInstrument="electric piano 1" \melodie
- \set Staff.midiInstrument="electric piano 2" \melodie
- \set Staff.midiInstrument="harpsichord" \melodie
- \set Staff.midiInstrument="clav" \melodie
- \set Staff.midiInstrument="celesta" \melodie
- \set Staff.midiInstrument="glockenspiel" \melodie
- \set Staff.midiInstrument="music box" \melodie
- \set Staff.midiInstrument="vibraphone" \melodie
- \set Staff.midiInstrument="marimba" \melodie
- \set Staff.midiInstrument="xylophone" \melodie
- \set Staff.midiInstrument="tubular bells" \melodie
- \set Staff.midiInstrument="dulcimer" \melodie
- \set Staff.midiInstrument="drawbar organ" \melodie
- \set Staff.midiInstrument="percussive organ" \melodie
- \set Staff.midiInstrument="rock organ" \melodie
- \set Staff.midiInstrument="church organ" \melodie
- \set Staff.midiInstrument="reed organ" \melodie
- \set Staff.midiInstrument="accordion" \melodie
- \set Staff.midiInstrument="harmonica" \melodie
- \set Staff.midiInstrument="concertina" \melodie
- \set Staff.midiInstrument="acoustic guitar (nylon)" \melodie
- \set Staff.midiInstrument="acoustic guitar (steel)" \melodie
- \set Staff.midiInstrument="electric guitar (jazz)" \melodie
- \set Staff.midiInstrument="electric guitar (clean)" \melodie
- \set Staff.midiInstrument="electric guitar (muted)" \melodie
- \set Staff.midiInstrument="overdriven guitar" \melodie
- \set Staff.midiInstrument="distorted guitar" \melodie
- \set Staff.midiInstrument="acoustic bass" \melodie
- \set Staff.midiInstrument="electric bass (finger)" \melodie
- \set Staff.midiInstrument="electric bass (pick)" \melodie
- \set Staff.midiInstrument="fretless bass" \melodie
- \set Staff.midiInstrument="slap bass 1" \melodie
- \set Staff.midiInstrument="slap bass 2" \melodie
- \set Staff.midiInstrument="synth bass 1" \melodie
- \set Staff.midiInstrument="synth bass 2" \melodie
- \set Staff.midiInstrument="violin" \melodie
- \set Staff.midiInstrument="viola" \melodie
- \set Staff.midiInstrument="cello" \melodie
- \set Staff.midiInstrument="contrabass" \melodie
- \set Staff.midiInstrument="tremolo strings" \melodie
- \set Staff.midiInstrument="pizzicato strings" \melodie
- \set Staff.midiInstrument="orchestral strings" \melodie
- \set Staff.midiInstrument="timpani" \melodie
- \set Staff.midiInstrument="string ensemble 1" \melodie
- \set Staff.midiInstrument="string ensemble 2" \melodie
- \set Staff.midiInstrument="synthstrings 1" \melodie
- \set Staff.midiInstrument="synthstrings 2" \melodie
- \set Staff.midiInstrument="choir aahs" \melodie
- \set Staff.midiInstrument="voice oohs" \melodie
- \set Staff.midiInstrument="synth voice" \melodie
- \set Staff.midiInstrument="orchestra hit" \melodie
- \set Staff.midiInstrument="trumpet" \melodie
- \set Staff.midiInstrument="trombone" \melodie
- \set Staff.midiInstrument="tuba" \melodie
- \set Staff.midiInstrument="muted trumpet" \melodie
- \set Staff.midiInstrument="french horn" \melodie
- \set Staff.midiInstrument="brass section" \melodie
- \set Staff.midiInstrument="synthbrass 1" \melodie
- \set Staff.midiInstrument="synthbrass 2" \melodie
- \set Staff.midiInstrument="soprano sax" \melodie
- \set Staff.midiInstrument="alto sax" \melodie
- \set Staff.midiInstrument="tenor sax" \melodie
- \set Staff.midiInstrument="baritone sax" \melodie
- \set Staff.midiInstrument="oboe" \melodie
- \set Staff.midiInstrument="english horn" \melodie
- \set Staff.midiInstrument="bassoon" \melodie
- \set Staff.midiInstrument="clarinet" \melodie
- \set Staff.midiInstrument="piccolo" \melodie
- \set Staff.midiInstrument="flute" \melodie
- \set Staff.midiInstrument="recorder" \melodie
- \set Staff.midiInstrument="pan flute" \melodie
- \set Staff.midiInstrument="blown bottle" \melodie
- \set Staff.midiInstrument="shakuhachi" \melodie
- \set Staff.midiInstrument="whistle" \melodie
- \set Staff.midiInstrument="ocarina" \melodie
- \set Staff.midiInstrument="lead 1 (square)" \melodie
- \set Staff.midiInstrument="lead 2 (sawtooth)" \melodie
- \set Staff.midiInstrument="lead 3 (calliope)" \melodie
- \set Staff.midiInstrument="lead 4 (chiff)" \melodie
- \set Staff.midiInstrument="lead 5 (charang)" \melodie
- \set Staff.midiInstrument="lead 6 (voice)" \melodie
- \set Staff.midiInstrument="lead 7 (fifths)" \melodie
- \set Staff.midiInstrument="lead 8 (bass+lead)" \melodie
- \set Staff.midiInstrument="pad 1 (new age)" \melodie
- \set Staff.midiInstrument="pad 2 (warm)" \melodie
- \set Staff.midiInstrument="pad 3 (polysynth)" \melodie
- \set Staff.midiInstrument="pad 4 (choir)" \melodie
- \set Staff.midiInstrument="pad 5 (bowed)" \melodie
- \set Staff.midiInstrument="pad 6 (metallic)" \melodie
- \set Staff.midiInstrument="pad 7 (halo)" \melodie
- \set Staff.midiInstrument="pad 8 (sweep)" \melodie
- \set Staff.midiInstrument="fx 1 (rain)" \melodie
- \set Staff.midiInstrument="fx 2 (soundtrack)" \melodie
- \set Staff.midiInstrument="fx 3 (crystal)" \melodie
- \set Staff.midiInstrument="fx 4 (atmosphere)" \melodie
- \set Staff.midiInstrument="fx 5 (brightness)" \melodie
- \set Staff.midiInstrument="fx 6 (goblins)" \melodie
- \set Staff.midiInstrument="fx 7 (echoes)" \melodie
- \set Staff.midiInstrument="fx 8 (sci-fi)" \melodie
- \set Staff.midiInstrument="sitar" \melodie
- \set Staff.midiInstrument="banjo" \melodie
- \set Staff.midiInstrument="shamisen" \melodie
- \set Staff.midiInstrument="koto" \melodie
- \set Staff.midiInstrument="kalimba" \melodie
- \set Staff.midiInstrument="bagpipe" \melodie
- \set Staff.midiInstrument="fiddle" \melodie
- \set Staff.midiInstrument="shanai" \melodie
- \set Staff.midiInstrument="tinkle bell" \melodie
- \set Staff.midiInstrument="agogo" \melodie
- \set Staff.midiInstrument="steel drums" \melodie
- \set Staff.midiInstrument="woodblock" \melodie
- \set Staff.midiInstrument="taiko drum" \melodie
- \set Staff.midiInstrument="melodic tom" \melodie
- \set Staff.midiInstrument="synth drum" \melodie
- \set Staff.midiInstrument="reverse cymbal" \melodie
- \set Staff.midiInstrument="guitar fret noise" \melodie
- \set Staff.midiInstrument="breath noise" \melodie
- \set Staff.midiInstrument="seashore" \melodie
- \set Staff.midiInstrument="bird tweet" \melodie
- \set Staff.midiInstrument="telephone ring" \melodie
- \set Staff.midiInstrument="helicopter" \melodie
- \set Staff.midiInstrument="applause" \melodie
- \set Staff.midiInstrument="gunshot" \melodie
- } %Voice
- >> %Staff
+ \set Staff.midiInstrument = "acoustic grand" \melodie
+ \set Staff.midiInstrument = "bright acoustic" \melodie
+ \set Staff.midiInstrument = "electric grand" \melodie
+ \set Staff.midiInstrument = "honky-tonk" \melodie
+ \set Staff.midiInstrument = "electric piano 1" \melodie
+ \set Staff.midiInstrument = "electric piano 2" \melodie
+ \set Staff.midiInstrument = "harpsichord" \melodie
+ \set Staff.midiInstrument = "clav" \melodie
+ \set Staff.midiInstrument = "celesta" \melodie
+ \set Staff.midiInstrument = "glockenspiel" \melodie
+ \set Staff.midiInstrument = "music box" \melodie
+ \set Staff.midiInstrument = "vibraphone" \melodie
+ \set Staff.midiInstrument = "marimba" \melodie
+ \set Staff.midiInstrument = "xylophone" \melodie
+ \set Staff.midiInstrument = "tubular bells" \melodie
+ \set Staff.midiInstrument = "dulcimer" \melodie
+ \set Staff.midiInstrument = "drawbar organ" \melodie
+ \set Staff.midiInstrument = "percussive organ" \melodie
+ \set Staff.midiInstrument = "rock organ" \melodie
+ \set Staff.midiInstrument = "church organ" \melodie
+ \set Staff.midiInstrument = "reed organ" \melodie
+ \set Staff.midiInstrument = "accordion" \melodie
+ \set Staff.midiInstrument = "harmonica" \melodie
+ \set Staff.midiInstrument = "concertina" \melodie
+ \set Staff.midiInstrument = "acoustic guitar (nylon)" \melodie
+ \set Staff.midiInstrument = "acoustic guitar (steel)" \melodie
+ \set Staff.midiInstrument = "electric guitar (jazz)" \melodie
+ \set Staff.midiInstrument = "electric guitar (clean)" \melodie
+ \set Staff.midiInstrument = "electric guitar (muted)" \melodie
+ \set Staff.midiInstrument = "overdriven guitar" \melodie
+ \set Staff.midiInstrument = "distorted guitar" \melodie
+ \set Staff.midiInstrument = "acoustic bass" \melodie
+ \set Staff.midiInstrument = "electric bass (finger)" \melodie
+ \set Staff.midiInstrument = "electric bass (pick)" \melodie
+ \set Staff.midiInstrument = "fretless bass" \melodie
+ \set Staff.midiInstrument = "slap bass 1" \melodie
+ \set Staff.midiInstrument = "slap bass 2" \melodie
+ \set Staff.midiInstrument = "synth bass 1" \melodie
+ \set Staff.midiInstrument = "synth bass 2" \melodie
+ \set Staff.midiInstrument = "violin" \melodie
+ \set Staff.midiInstrument = "viola" \melodie
+ \set Staff.midiInstrument = "cello" \melodie
+ \set Staff.midiInstrument = "contrabass" \melodie
+ \set Staff.midiInstrument = "tremolo strings" \melodie
+ \set Staff.midiInstrument = "pizzicato strings" \melodie
+ \set Staff.midiInstrument = "orchestral strings" \melodie
+ \set Staff.midiInstrument = "timpani" \melodie
+ \set Staff.midiInstrument = "string ensemble 1" \melodie
+ \set Staff.midiInstrument = "string ensemble 2" \melodie
+ \set Staff.midiInstrument = "synthstrings 1" \melodie
+ \set Staff.midiInstrument = "synthstrings 2" \melodie
+ \set Staff.midiInstrument = "choir aahs" \melodie
+ \set Staff.midiInstrument = "voice oohs" \melodie
+ \set Staff.midiInstrument = "synth voice" \melodie
+ \set Staff.midiInstrument = "orchestra hit" \melodie
+ \set Staff.midiInstrument = "trumpet" \melodie
+ \set Staff.midiInstrument = "trombone" \melodie
+ \set Staff.midiInstrument = "tuba" \melodie
+ \set Staff.midiInstrument = "muted trumpet" \melodie
+ \set Staff.midiInstrument = "french horn" \melodie
+ \set Staff.midiInstrument = "brass section" \melodie
+ \set Staff.midiInstrument = "synthbrass 1" \melodie
+ \set Staff.midiInstrument = "synthbrass 2" \melodie
+ \set Staff.midiInstrument = "soprano sax" \melodie
+ \set Staff.midiInstrument = "alto sax" \melodie
+ \set Staff.midiInstrument = "tenor sax" \melodie
+ \set Staff.midiInstrument = "baritone sax" \melodie
+ \set Staff.midiInstrument = "oboe" \melodie
+ \set Staff.midiInstrument = "english horn" \melodie
+ \set Staff.midiInstrument = "bassoon" \melodie
+ \set Staff.midiInstrument = "clarinet" \melodie
+ \set Staff.midiInstrument = "piccolo" \melodie
+ \set Staff.midiInstrument = "flute" \melodie
+ \set Staff.midiInstrument = "recorder" \melodie
+ \set Staff.midiInstrument = "pan flute" \melodie
+ \set Staff.midiInstrument = "blown bottle" \melodie
+ \set Staff.midiInstrument = "shakuhachi" \melodie
+ \set Staff.midiInstrument = "whistle" \melodie
+ \set Staff.midiInstrument = "ocarina" \melodie
+ \set Staff.midiInstrument = "lead 1 (square)" \melodie
+ \set Staff.midiInstrument = "lead 2 (sawtooth)" \melodie
+ \set Staff.midiInstrument = "lead 3 (calliope)" \melodie
+ \set Staff.midiInstrument = "lead 4 (chiff)" \melodie
+ \set Staff.midiInstrument = "lead 5 (charang)" \melodie
+ \set Staff.midiInstrument = "lead 6 (voice)" \melodie
+ \set Staff.midiInstrument = "lead 7 (fifths)" \melodie
+ \set Staff.midiInstrument = "lead 8 (bass+lead)" \melodie
+ \set Staff.midiInstrument = "pad 1 (new age)" \melodie
+ \set Staff.midiInstrument = "pad 2 (warm)" \melodie
+ \set Staff.midiInstrument = "pad 3 (polysynth)" \melodie
+ \set Staff.midiInstrument = "pad 4 (choir)" \melodie
+ \set Staff.midiInstrument = "pad 5 (bowed)" \melodie
+ \set Staff.midiInstrument = "pad 6 (metallic)" \melodie
+ \set Staff.midiInstrument = "pad 7 (halo)" \melodie
+ \set Staff.midiInstrument = "pad 8 (sweep)" \melodie
+ \set Staff.midiInstrument = "fx 1 (rain)" \melodie
+ \set Staff.midiInstrument = "fx 2 (soundtrack)" \melodie
+ \set Staff.midiInstrument = "fx 3 (crystal)" \melodie
+ \set Staff.midiInstrument = "fx 4 (atmosphere)" \melodie
+ \set Staff.midiInstrument = "fx 5 (brightness)" \melodie
+ \set Staff.midiInstrument = "fx 6 (goblins)" \melodie
+ \set Staff.midiInstrument = "fx 7 (echoes)" \melodie
+ \set Staff.midiInstrument = "fx 8 (sci-fi)" \melodie
+ \set Staff.midiInstrument = "sitar" \melodie
+ \set Staff.midiInstrument = "banjo" \melodie
+ \set Staff.midiInstrument = "shamisen" \melodie
+ \set Staff.midiInstrument = "koto" \melodie
+ \set Staff.midiInstrument = "kalimba" \melodie
+ \set Staff.midiInstrument = "bagpipe" \melodie
+ \set Staff.midiInstrument = "fiddle" \melodie
+ \set Staff.midiInstrument = "shanai" \melodie
+ \set Staff.midiInstrument = "tinkle bell" \melodie
+ \set Staff.midiInstrument = "agogo" \melodie
+ \set Staff.midiInstrument = "steel drums" \melodie
+ \set Staff.midiInstrument = "woodblock" \melodie
+ \set Staff.midiInstrument = "taiko drum" \melodie
+ \set Staff.midiInstrument = "melodic tom" \melodie
+ \set Staff.midiInstrument = "synth drum" \melodie
+ \set Staff.midiInstrument = "reverse cymbal" \melodie
+ \set Staff.midiInstrument = "guitar fret noise" \melodie
+ \set Staff.midiInstrument = "breath noise" \melodie
+ \set Staff.midiInstrument = "seashore" \melodie
+ \set Staff.midiInstrument = "bird tweet" \melodie
+ \set Staff.midiInstrument = "telephone ring" \melodie
+ \set Staff.midiInstrument = "helicopter" \melodie
+ \set Staff.midiInstrument = "applause" \melodie
+ \set Staff.midiInstrument = "gunshot" \melodie
+ }
+ >>
\midi { }
-} %score
-
-
+}
" }
% begin verbatim
\header {
-copyright = "copyright"
-title = "title"
-subtitle = "subtitle"
-composer = "composer"
-arranger = "arranger"
-instrument = "instrument"
-metre = "metre"
-opus = "opus"
-piece = "piece"
-poet = "poet"
-texidoc = "All header fields with special meanings."
+ copyright = "copyright"
+ title = "title"
+ subtitle = "subtitle"
+ composer = "composer"
+ arranger = "arranger"
+ instrument = "instrument"
+ metre = "metre"
+ opus = "opus"
+ piece = "piece"
+ poet = "poet"
+ texidoc = "All header fields with special meanings."
copyright = "public domain"
enteredby = "jcn"
source = "urtext"
-
}
-
\score {
- \relative c'' { c1 c1 c1 c1 }
+ \relative c'' { c1 c c c }
}
\score {
- \relative c'' { c1 c1 c1 c1 }
-
- \header {
-
- title = "localtitle"
- subtitle = "localsubtitle"
- composer = "localcomposer"
- arranger = "localarranger"
- instrument = "localinstrument"
- metre = "localmetre"
- opus = "localopus"
- piece = "localpiece"
- poet = "localpoet"
- copyright = "localcopyright"
- }
+ \relative c'' { c1 c c c }
+ \header {
+ title = "localtitle"
+ subtitle = "localsubtitle"
+ composer = "localcomposer"
+ arranger = "localarranger"
+ instrument = "localinstrument"
+ metre = "localmetre"
+ opus = "localopus"
+ piece = "localpiece"
+ poet = "localpoet"
+ copyright = "localcopyright"
+ }
}
-
ragged-right = ##t
indent = 0\cm
}
-\book {
- \score {
- \new StaffGroup <<
- % Must be lower than your actual amount off staff lines
- \override StaffGroup.SystemStartBracket #'collapse-height = #1
- \override Score.SystemStartBar #'collapse-height = #1
- \new Staff {
- c'4 d' e' f'
- }
- >>
- }
- \score {
- \new PianoStaff <<
- \override PianoStaff.SystemStartBrace #'collapse-height = #1
- \override Score.SystemStartBar #'collapse-height = #1
- \new Staff {
- c'4 d' e' f'
- }
- >>
- }
+
+\score {
+ \new StaffGroup <<
+ % Must be lower than your actual amount off staff lines
+ \override StaffGroup.SystemStartBracket #'collapse-height = #1
+ \override Score.SystemStartBar #'collapse-height = #1
+ \new Staff {
+ c'4 d' e' f'
+ }
+ >>
+}
+
+\score {
+ \new PianoStaff <<
+ \override PianoStaff.SystemStartBrace #'collapse-height = #1
+ \override Score.SystemStartBar #'collapse-height = #1
+ \new Staff {
+ c'4 d' e' f'
+ }
+ >>
}
" }
% begin verbatim
\relative c' {
- <c e g>2~ <c e g> |
+ <c e g>2 ~ <c e g> |
\override TieColumn #'tie-configuration =
#'((0.0 . 1) (-2.0 . 1) (-4.0 . 1))
- <c e g>~ <c e g> |
+ <c e g> ~ <c e g> |
}
The property @code{tupletSpannerDuration} sets how long each of the
tuplets contained within the brackets after @code{\\times} should last.
Many consecutive tuplets can then be placed within a single
-@code{\\times @{ ... @}} expression, thus saving typing.
+@code{\\times} expression, thus saving typing.
In the example, two triplets are shown, while @code{\\times} was
entered only once.
\header {
lsrtags = "text, vocal-music"
texidoc = "
-To format single lyrics syllables, you can simply use \\markup @{ ....
-@} on these lyrics!
+To format individual syllables in lyrics, use @code{\\markup @{ ....
+@}} on these lyrics.
" }
% begin verbatim
% Tip taken from http://lists.gnu.org/archive/html/lilypond-user/2007-12/msg00215.html
\header {
- title = "Markup can be used inside lyrics!"
+ title = "Markup can be used inside lyrics!"
}
-melody = \relative c'' { c4 c c c }
-lyr = \lyricmode {
- Lyrics \markup { \italic can } \markup {\with-color #red contain }
- \markup {\fontsize #8 \bold "Markup!" }
+mel = \relative c'' { c4 c c c }
+lyr = \lyricmode {
+ Lyrics \markup { \italic "can" } \markup {\with-color #red "contain" }
+ \markup {\fontsize #8 \bold "Markup!" }
}
-\context Staff <<
- \context Voice = "mel" << \melody >>
- \context Lyrics \lyricsto "mel" \lyr
+<<
+ \context Voice = melody \mel
+ \context Lyrics \lyricsto melody \lyr
>>
" }
% begin verbatim
upper = \relative c'' {
- \clef treble
- \key c \major
- \time 4/4
-
- a b c d
- }
-
- lower = \relative c {
- \clef bass
- \key c \major
- \time 4/4
-
- a2 c
- }
-
- \score {
- \new PianoStaff <<
- \set PianoStaff.instrumentName = "Piano "
- \new Staff = "upper" \upper
- \new Staff = "lower" \lower
- >>
- \layout { }
- \midi { }
- }
+ \clef treble
+ \key c \major
+ \time 4/4
+
+ a b c d
+
+}
+lower = \relative c {
+ \clef bass
+ \key c \major
+ \time 4/4
+
+ a2 c
+
+}
+
+\score {
+ \new PianoStaff <<
+ \set PianoStaff.instrumentName = "Piano "
+ \new Staff = "upper" \upper
+ \new Staff = "lower" \lower
+ >>
+ \layout { }
+ \midi { }
+}
" }
% begin verbatim
upper = \relative c'' {
- \clef treble
- \key c \major
- \time 4/4
-
- a b c d
- }
-
- lower = \relative c {
- \clef bass
- \key c \major
- \time 4/4
-
- a2 c
- }
-
- text = \lyricmode {
- Aaa Bee Cee Dee
- }
-
- \score {
- \new GrandStaff <<
- \new Staff = upper { \new Voice = "singer" \upper }
- \new Lyrics \lyricsto "singer" \text
- \new Staff = lower {
- \clef bass
- \lower
- }
- >>
- \layout {
- \context { \GrandStaff \accepts "Lyrics" }
- \context { \Lyrics \consists "Bar_engraver" }
- }
- \midi { }
- }
+ \clef treble
+ \key c \major
+ \time 4/4
+
+ a b c d
+
+}
+lower = \relative c {
+ \clef bass
+ \key c \major
+ \time 4/4
+
+ a2 c
+
+}
+
+text = \lyricmode {
+ Aaa Bee Cee Dee
+}
+
+\score {
+ \new GrandStaff <<
+ \new Staff = upper { \new Voice = "singer" \upper }
+ \new Lyrics \lyricsto "singer" \text
+ \new Staff = lower { \lower }
+ >>
+ \layout {
+ \context {
+ \GrandStaff
+ \accepts "Lyrics"
+ }
+ \context {
+ \Lyrics
+ \consists "Bar_engraver"
+ }
+ }
+ \midi { }
+}
" }
% begin verbatim
melody = \relative c'' {
- \clef treble
- \key c \major
- \time 4/4
-
- a b c d
- }
-
- text = \lyricmode {
- Aaa Bee Cee Dee
- }
-
- upper = \relative c'' {
- \clef treble
- \key c \major
- \time 4/4
-
- a b c d
- }
-
- lower = \relative c {
- \clef bass
- \key c \major
- \time 4/4
-
- a2 c
- }
-
- \score {
- <<
- \new Voice = "mel" {
- \autoBeamOff
- \melody
- }
- \new Lyrics \lyricsto mel \text
-
- \new PianoStaff <<
- \new Staff = "upper" \upper
- \new Staff = "lower" \lower
- >>
- >>
- \layout {
- \context { \RemoveEmptyStaffContext }
- }
- \midi { }
- }
+ \clef treble
+ \key c \major
+ \time 4/4
+
+ a b c d
+
+}
+text = \lyricmode {
+ Aaa Bee Cee Dee
+}
+
+upper = \relative c'' {
+ \clef treble
+ \key c \major
+ \time 4/4
+
+ a b c d
+
+}
+
+lower = \relative c {
+ \clef bass
+ \key c \major
+ \time 4/4
+
+ a2 c
+
+}
+
+\score {
+ <<
+ \new Voice = "mel" { \autoBeamOff \melody }
+ \new Lyrics \lyricsto mel \text
+
+ \new PianoStaff <<
+ \new Staff = "upper" \upper
+ \new Staff = "lower" \lower
+ >>
+ >>
+ \layout {
+ \context { \RemoveEmptyStaffContext }
+ }
+ \midi { }
+}
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR http://lsr.dsi.unimi.it
+%% This file is in the public domain.
+\version "2.11.38"
+
+\header {
+ lsrtags = "text"
+ texidoc = "
+Marks can be printed at the end of the current line, instead of the
+beginning of the following line. This is particularly useful when a
+mark has to be added at the end of a score -- when there is no next
+line.
+
+In such cases, the right end of the mark has to be aligned with the
+final barline, as demonstrated on the second line of this example.
+" }
+% begin verbatim
+\relative c'' {
+ \override Score.RehearsalMark #'break-visibility = #begin-of-line-invisible
+ g2 c d, a'
+ \mark \default
+ \break
+
+ \override Score.RehearsalMark #'self-alignment-X = #right
+ g b, c1 \bar "||"
+ \mark "D.C. al Fine"
+}
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR http://lsr.dsi.unimi.it
+%% This file is in the public domain.
+\version "2.11.38"
+
+\header {
+ lsrtags = "text"
+ texidoc = "
+Although text marks are normally only printed above the topmost staff,
+they may also be printed on every staff.
+" }
+% begin verbatim
+{
+ \new Score \with {
+ \remove "Mark_engraver"
+ }
+ <<
+ \new Staff \with {
+ \consists "Mark_engraver"
+ }
+ { c''1 \mark "molto" c'' }
+ \new Staff \with {
+ \consists "Mark_engraver"
+ }
+ { c'1 \mark "molto" c' }
+ >>
+}
" }
% begin verbatim
melody = \relative c' {
- \clef treble
- \key c \major
- \time 4/4
-
- a b c d
- }
-
- text = \lyricmode {
- Aaa Bee Cee Dee
- }
-
- harmonies = \chordmode {
- a2 c2
- }
-
- \score {
- <<
- \new ChordNames {
- \set chordChanges = ##t
- \harmonies
- }
- \new Voice = "one" {
- \autoBeamOff
- \melody
- }
- \new Lyrics \lyricsto "one" \text
- >>
- \layout { }
- \midi { }
- }
+ \clef treble
+ \key c \major
+ \time 4/4
+
+ a4 b c d
+}
+
+text = \lyricmode {
+ Aaa Bee Cee Dee
+}
+
+harmonies = \chordmode {
+ a2 c
+}
+
+\score {
+ <<
+ \new ChordNames {
+ \set chordChanges = ##t
+ \harmonies
+ }
+ \new Voice = "one" { \autoBeamOff \melody }
+ \new Lyrics \lyricsto "one" \text
+ >>
+ \layout { }
+ \midi { }
+}
-combining-dynamics-with-markup-texts.ly
creating-text-spanners.ly
creating-real-parenthesized-dynamics.ly
-markup-lines.ly
-three-sided-box.ly
center-text-below-hairpin-dynamics.ly
-ottava-text.ly
demonstrating-all-headers.ly
-utf-8.ly
+printing-marks-at-the-end-of-a-line-or-a-score.ly
changing-the-default-text-font-family.ly
combining-two-parts-on-the-same-staff.ly
aligning-and-centering-instrument-names.ly
-vocal-ensemble-template-with-lyrics-aligned-below-and-above-the-staves.ly
outputting-the-version-number.ly
-blanking-staff-lines-using-the--whiteout-command.ly
formatting-lyrics-syllables.ly
how-to-put-ties-between-syllables-in-lyrics.ly
+combining-dynamics-with-markup-texts.ly
+vocal-ensemble-template-with-lyrics-aligned-below-and-above-the-staves.ly
+aligning-marks-with-various-notation-objects.ly
+markup-lines.ly
+printing-marks-on-every-staff.ly
+three-sided-box.ly
piano-template-with-centered-lyrics.ly
+utf-8.ly
+blanking-staff-lines-using-the--whiteout-command.ly
+ottava-text.ly
adjusting-lyrics-vertical-spacing.ly
aligning-lyrics.ly
\header {
lsrtags = "tweaks-and-overrides, spacing"
texidoc = "
-By setting the Y-extent property to a fixed value (here -1.5 . 1.5), we
-force LilyPond to align every elements of the DynamicLineSpanner (text
-elements and dynamics) to a common reference point, regardless to the
-actual extent of these objects. This way, every element will be
-vertically centered, for a nicer output (you can compare the first and
-the second line in this example; the trick is only applied on the
-second line).
+By setting the @code{Y-extent} property to a fixed value, all
+@code{DynamicLineSpanner} objects (hairpins and dynamic texts) are
+aligned to a common reference point, regardless of their actual extent.
+This way, every element will be vertically centered, for a nicer output
+(you can compare the first and the second line in this example; the
+trick is only applied on the second line).
The same idea is used to align the text scripts along their baseline.
" }
% begin verbatim
-\paper { indent = 0 line-width = 5\in }
-
-music = \relative c''
-{
- c2\p^\markup { "gorgeous" } c\f^\markup { "fantastic" }
- c4\p c \f \> c c \! \p
+music = \relative c'' {
+ c2\p^\markup { "gorgeous" } c\f^\markup { "fantastic" }
+ c4\p c\f\> c c\!\p
}
-\score
{
- {
- \music \break
-
- \override DynamicLineSpanner #'staff-padding = #2.0
- \override DynamicLineSpanner #'Y-extent = #'(-1.5 . 1.5)
- \override TextScript #'Y-extent = #'(-1.5 . 1.5)
- \music
- }
+ \music \break
+ \override DynamicLineSpanner #'staff-padding = #2.0
+ \override DynamicLineSpanner #'Y-extent = #'(-1.5 . 1.5)
+ \override TextScript #'Y-extent = #'(-1.5 . 1.5)
+ \music
}
-
texidoc = "
This template is basically the same as the simple \"Vocal ensemble\"
template, with the exception that here all the lyrics lines are placed
-using alignAboveContext and alignBelowContext.
+using @code{alignAboveContext} and @code{alignBelowContext}.
" }
% begin verbatim
global = {
- \key c \major
- \time 4/4
- }
-
- sopMusic = \relative c'' {
- c4 c c8[( b)] c4
- }
- sopWords = \lyricmode {
- hi hi hi hi
- }
-
- altoMusic = \relative c' {
- e4 f d e
- }
- altoWords =\lyricmode {
- ha ha ha ha
- }
-
- tenorMusic = \relative c' {
- g4 a f g
- }
- tenorWords = \lyricmode {
- hu hu hu hu
- }
-
- bassMusic = \relative c {
- c4 c g c
- }
- bassWords = \lyricmode {
- ho ho ho ho
- }
-
- \score {
- \new ChoirStaff <<
- \new Staff = women <<
- \new Voice =
- "sopranos" { \voiceOne << \global \sopMusic >> }
- \new Voice =
- "altos" { \voiceTwo << \global \altoMusic >> }
- >>
- \new Lyrics \with {alignAboveContext=women} \lyricsto sopranos \sopWords
- \new Lyrics \with {alignBelowContext=women} \lyricsto altos \altoWords
- % we could remove the line about this with the line below, since we want
- % the alto lyrics to be below the alto Voice anyway.
- % \new Lyrics \lyricsto altos \altoWords
-
- \new Staff = men <<
- \clef bass
- \new Voice =
- "tenors" { \voiceOne <<\global \tenorMusic >> }
- \new Voice =
- "basses" { \voiceTwo <<\global \bassMusic >> }
- >>
-
- \new Lyrics \with {alignAboveContext=men} \lyricsto tenors \tenorWords
- \new Lyrics \with {alignBelowContext=men} \lyricsto basses \bassWords
- % again, we could replace the line above this with the line below.
- % \new Lyrics \lyricsto basses \bassWords
- >>
-
- \layout {
- \context {
- % a little smaller so lyrics
- % can be closer to the staff
- \Staff
- \override VerticalAxisGroup #'minimum-Y-extent = #'(-3 . 3)
- }
- }
- }
-
-
- \score {
- \new ChoirStaff <<
- \new Staff = women <<
- \new Voice =
- "sopranos" { \voiceOne << \global \sopMusic >> }
- \new Voice =
- "altos" { \voiceTwo << \global \altoMusic >> }
- >>
-
- \new Lyrics \with {alignAboveContext=women} \lyricsto sopranos \sopWords
- \new Lyrics \lyricsto altos \altoWords
-
- \new Staff = men <<
- \clef bass
- \new Voice =
- "tenors" { \voiceOne <<\global \tenorMusic >> }
- \new Voice =
- "basses" { \voiceTwo <<\global \bassMusic >> }
- >>
-
- \new Lyrics \with {alignAboveContext=men} \lyricsto tenors \tenorWords
- \new Lyrics \lyricsto basses \bassWords
- >>
-
- \layout {
- \context {
- % a little smaller so lyrics
- % can be closer to the staff
- \Staff
- \override VerticalAxisGroup #'minimum-Y-extent = #'(-3 . 3)
- }
- }
- }
+ \key c \major
+ \time 4/4
+}
+sopMusic = \relative c'' {
+ c4 c c8[( b)] c4
+}
+sopWords = \lyricmode {
+ hi hi hi hi
+}
+
+altoMusic = \relative c' {
+ e4 f d e
+}
+altoWords = \lyricmode {
+ ha ha ha ha
+}
+
+tenorMusic = \relative c' {
+ g4 a f g
+}
+tenorWords = \lyricmode {
+ hu hu hu hu
+}
+
+bassMusic = \relative c {
+ c4 c g c
+}
+bassWords = \lyricmode {
+ ho ho ho ho
+}
+
+\score {
+ \new ChoirStaff <<
+ \new Staff = women <<
+ \new Voice = "sopranos" { \voiceOne << \global \sopMusic >> }
+ \new Voice = "altos" { \voiceTwo << \global \altoMusic >> }
+ >>
+ \new Lyrics \with { alignAboveContext = women } \lyricsto sopranos \sopWords
+ \new Lyrics \with { alignBelowContext = women } \lyricsto altos \altoWords
+ % we could remove the line about this with the line below, since we want
+ % the alto lyrics to be below the alto Voice anyway.
+ % \new Lyrics \lyricsto altos \altoWords
+
+ \new Staff = men <<
+ \clef bass
+ \new Voice = "tenors" { \voiceOne << \global \tenorMusic >> }
+ \new Voice = "basses" { \voiceTwo << \global \bassMusic >> }
+ >>
+ \new Lyrics \with { alignAboveContext = men } \lyricsto tenors \tenorWords
+ \new Lyrics \with { alignBelowContext = men } \lyricsto basses \bassWords
+ % again, we could replace the line above this with the line below.
+ % \new Lyrics \lyricsto basses \bassWords
+ >>
+ \layout {
+ \context {
+ % a little smaller so lyrics
+ % can be closer to the staff
+ \Staff
+ \override VerticalAxisGroup #'minimum-Y-extent = #'(-3 . 3)
+ }
+ }
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 1.0 Partwise//EN"
+ "http://www.musicxml.org/dtds/partwise.dtd">
+<score-partwise version="1.1">
+ <movement-title>Figured Bass</movement-title>
+ <identification/>
+ <part-list>
+ <score-part id="P1">
+ <part-name>MusicXML Part</part-name>
+ <score-instrument id="P1-I1">
+ <instrument-name>Acoustic Grand Piano</instrument-name>
+ </score-instrument>
+ <midi-instrument id="P1-I1">
+ <midi-channel>1</midi-channel>
+ <midi-program>1</midi-program>
+ </midi-instrument>
+ </score-part>
+ </part-list>
+ <!--=========================================================-->
+ <part id="P1">
+ <measure number="1">
+ <attributes>
+ <divisions>8</divisions>
+ <key>
+ <fifths>0</fifths>
+ <mode>major</mode>
+ </key>
+ <time symbol="common">
+ <beats>4</beats>
+ <beat-type>4</beat-type>
+ </time>
+ <clef>
+ <sign>G</sign>
+ <line>2</line>
+ </clef>
+ </attributes>
+ <sound tempo="120"/>
+ <figured-bass>
+ <figure><figure-number>3</figure-number></figure>
+ <duration>4</duration>
+ </figured-bass>
+ <note>
+ <pitch><step>G</step><octave>4</octave></pitch>
+ <duration>4</duration>
+ <voice>1</voice>
+ <type>eighth</type>
+ <stem>up</stem>
+ </note>
+ <note>
+ <pitch><step>G</step><octave>4</octave></pitch>
+ <duration>4</duration>
+ <voice>1</voice>
+ <type>eighth</type>
+ <stem>up</stem>
+ </note>
+ <figured-bass>
+ <figure><figure-number>1</figure-number><prefix>sharp</prefix></figure>
+ <figure><figure-number>3</figure-number><prefix>flat</prefix></figure>
+ <figure><figure-number>5</figure-number><prefix>natural</prefix></figure>
+ <duration>6</duration>
+ </figured-bass>
+ <note>
+ <pitch><step>G</step><octave>4</octave></pitch>
+ <duration>6</duration>
+ <voice>1</voice>
+ <type>eighth</type>
+ <dot/>
+ <stem>up</stem>
+ </note>
+ <figured-bass parentheses="yes">
+ <figure><figure-number>6</figure-number></figure>
+ <duration>2</duration>
+ </figured-bass>
+ <note>
+ <pitch><step>G</step><octave>4</octave></pitch>
+ <duration>2</duration>
+ <voice>1</voice>
+ <type>16th</type>
+ <stem>up</stem>
+ </note>
+ <figured-bass>
+ <figure><figure-number>5</figure-number><suffix>slash</suffix></figure>
+ <figure><figure-number>127</figure-number><prefix>flat</prefix><suffix>slash</suffix></figure>
+ <duration>8</duration>
+ </figured-bass>
+ <note>
+ <pitch><step>G</step><octave>4</octave></pitch>
+ <duration>8</duration>
+ <voice>1</voice>
+ <type>eighth</type>
+ <dot/>
+ <stem>up</stem>
+ </note>
+ <figured-bass>
+ </figured-bass>
+ <note>
+ <pitch><step>G</step><octave>4</octave></pitch>
+ <duration>8</duration>
+ <voice>1</voice>
+ <type>quarter</type>
+ <stem>up</stem>
+ </note>
+ <barline location="right">
+ <bar-style>light-heavy</bar-style>
+ </barline>
+ </measure>
+ </part>
+ <!--=========================================================-->
+</score-partwise>
@itemize
@item 00 ... Basics: Pitches, durations, rests, clefs, keys, time sigs, ties, etc.
@item 01 ... Chords
-@item 02 ... Articulations, Ornaments, Technicals, Texts
-@item 03 ... Dynamics (single symbols, not spanners like hairpins)
-@item 04 ... Spanners (hairpins, octave shifts, trills, etc.)
+@item 02 ... MusicXML notations and articulations (articulations, ornaments, technicals, text markup)
+@item 03 ... MusicXML directions (dynamics; single symbols, not spanners like hairpins)
+@item 04 ... Spanners (hairpin, octave shift, trill, glissando, etc.)
@item 05 ... Header information (title, composer, poet, etc.)
@item 06 ... Lyrics
@item 08 ... Multiple parts (staves)
@item 14 ... Multi-staff parts (one voice on multiple staves, e.g. PianoStaff)
@item 15 ... Percussion
@item 17 ... Guitar notation: Chord names, Fretboards, Tablature notation
+@item 18 ... Figured bass
@item 19 ... Page layout: font/paper size, margins, spacing
-@item 20 ...
+@item 20 ... Compressed MusicXML files
+@item 99 ... Compatibility modes with broken MusicXML exporters (i.e. ignore beams for Sibelius 5)
@end itemize
")
else:
return ''
+class FiguredBassNote (Music):
+ def __init__ (self):
+ Music.__init__ (self)
+ self.number = ''
+ self.prefix = ''
+ self.suffix = ''
+ def set_prefix (self, prefix):
+ self.prefix = prefix
+ def set_suffix (self, suffix):
+ self.prefix = suffix
+ def set_number (self, number):
+ self.number = number
+ def ly_expression (self):
+ res = ''
+ if self.number:
+ res += self.number
+ else:
+ res += '_'
+ if self.prefix:
+ res += self.prefix
+ if self.suffix:
+ res += self.suffix
+ return res
+
+
+class FiguredBassEvent (NestedMusic):
+ def __init__ (self):
+ NestedMusic.__init__ (self)
+ self.duration = None
+ self.real_duration = 0
+ self.parentheses = False
+ return
+ def set_duration (self, dur):
+ self.duration = dur
+ def set_parentheses (self, par):
+ self.parentheses = par
+ def set_real_duration (self, dur):
+ self.real_duration = dur
+
+ def print_ly (self, printer):
+ figured_bass_events = [e for e in self.elements if
+ isinstance (e, FiguredBassNote)]
+ if figured_bass_events:
+ notes = []
+ for x in figured_bass_events:
+ notes.append (x.ly_expression ())
+ contents = string.join (notes)
+ if self.parentheses:
+ contents = '[%s]' % contents
+ printer ('<%s>' % contents)
+ self.duration.print_ly (printer)
+
class MultiMeasureRest(Music):
printer.newline ()
n = 0
nr_voices = len (voices)
- for [v, lyrics] in voices:
+ for [v, lyrics, figuredbass] in voices:
n += 1
voice_count_text = ''
if nr_voices > 1:
for l in lyrics:
printer ('\\new Lyrics \\lyricsto "%s" \\%s' % (v,l))
printer.newline()
+ if figuredbass:
+ printer ('\context FiguredBass = "%s" \\%s' % (figuredbass, figuredbass))
printer ('>>')
def print_ly (self, printer):
measure_position = Rational (0)
for n in m.get_all_children ():
+ # figured bass has a duration, but applies to the next note
+ # and should not change the current measure position!
+ if isinstance (n, FiguredBass):
+ n._divisions = factor.denominator ()
+ continue
+
if isinstance (n, Hash_text):
continue
dur = Rational (0)
if not (voice_id or isinstance (n, Attributes) or
isinstance (n, Direction) or isinstance (n, Partial) or
- isinstance (n, Barline) or isinstance (n, Harmony) ):
+ isinstance (n, Barline) or isinstance (n, Harmony) or
+ isinstance (n, FiguredBass) ):
continue
if isinstance (n, Attributes) and not start_attr:
voices[v].add_element (n)
continue
- if isinstance (n, Harmony):
- # store the harmony element until we encounter the next note
- # and assign it only to that one voice.
+ if isinstance (n, Harmony) or isinstance (n, FiguredBass):
+ # store the harmony or figured bass element until we encounter
+ # the next note and assign it only to that one voice.
assign_to_next_note.append (n)
continue
else:
return ''
+class FiguredBass (Music_xml_node):
+ pass
+
+
## need this, not all classes are instantiated
## for every input file. Only add those classes, that are either directly
'duration': Duration,
'frame': Frame,
'frame-note': Frame_Note,
+ 'figured-bass': FiguredBass,
'glissando': Glissando,
'grace': Grace,
'harmony': Harmony,
raise TypeError('denominator must have integer type')
if not denominator:
raise ZeroDivisionError('rational construction')
- # Store the fraction in reduced form as _n/_d
- factor = _gcf(numerator, denominator)
- self._n = numerator // factor
- self._d = denominator // factor
+ self._d = denominator
+ self._n = numerator
+ self.normalize_self()
+ # Cancel the fraction to reduced form
+ def normalize_self(self):
+ factor = _gcf(self._n, self._d)
+ self._n = self._n // factor
+ self._d = self._d // factor
if self._d < 0:
self._n = -self._n
self._d = -self._d
+
def numerator(self):
return self._n
return structure
-
def musicxml_duration_to_lily (mxl_note):
d = musicexp.Duration ()
# if the note has no Type child, then that method spits out a warning and
def rational_to_lily_duration (rational_len):
d = musicexp.Duration ()
- d.duration_log = {1: 0, 2: 1, 4:2, 8:3, 16:4, 32:5, 64:6, 128:7, 256:8, 512:9}.get (rational_len.denominator (), -1)
- d.factor = Rational (rational_len.numerator ())
- if d.duration_log < 0:
+
+ rational_len.normalize_self ()
+ d_log = {1: 0, 2: 1, 4:2, 8:3, 16:4, 32:5, 64:6, 128:7, 256:8, 512:9}.get (rational_len.denominator (), -1)
+
+ # Duration of the form 1/2^n or 3/2^n can be converted to a simple lilypond duration
+ if (d_log >= 0 and rational_len.numerator() in (1,3,5,7) ):
+ # account for the dots!
+ d.dots = (rational_len.numerator()-1)/2
+ d.duration_log = d_log - d.dots
+ elif (d_log >= 0):
+ d.duration_log = d_log
+ d.factor = Rational (rational_len.numerator ())
+ else:
error_message (_ ("Encountered rational duration with denominator %s, "
"unable to convert to lilypond duration") %
rational_len.denominator ())
# TODO: Test the above error message
return None
- else:
- return d
+
+ return d
def musicxml_partial_to_lily (partial_len):
if partial_len > 0:
return res
+def musicxml_figured_bass_note_to_lily (n):
+ res = musicexp.FiguredBassNote ()
+ suffix_dict = { 'sharp' : "+",
+ 'flat' : "-",
+ 'natural' : "!",
+ 'double-sharp' : "++",
+ 'flat-flat' : "--",
+ 'sharp-sharp' : "++",
+ 'slash' : "/" }
+ prefix = n.get_maybe_exist_named_child ('prefix')
+ if prefix:
+ res.set_prefix (suffix_dict.get (prefix.get_text (), ""))
+ fnumber = n.get_maybe_exist_named_child ('figure-number')
+ if fnumber:
+ res.set_number (fnumber.get_text ())
+ suffix = n.get_maybe_exist_named_child ('suffix')
+ if suffix:
+ res.set_suffix (suffix_dict.get (suffix.get_text (), ""))
+ if n.get_maybe_exist_named_child ('extend'):
+ # TODO: Implement extender lines (unfortunately, in lilypond you have
+ # to use \set useBassFigureExtenders = ##t, which turns them on
+ # globally, while MusicXML has a property for each note...
+ # I'm not sure there is a proper way to implement this cleanly
+ #n.extend
+ pass
+ return res
+
+
+
+def musicxml_figured_bass_to_lily (n):
+ if not isinstance (n, musicxml.FiguredBass):
+ return
+ res = musicexp.FiguredBassEvent ()
+ for i in n.get_named_children ('figure'):
+ note = musicxml_figured_bass_note_to_lily (i)
+ if note:
+ res.append (note)
+ dur = n.get_maybe_exist_named_child ('duration')
+ if dur:
+ # TODO: implement duration (given in base steps!)
+ # apply the duration to res
+ length = Rational(int(dur.get_text()), n._divisions)*Rational(1,4)
+ res.set_real_duration (length)
+ duration = rational_to_lily_duration (length)
+ if duration:
+ res.set_duration (duration)
+ if hasattr (n, 'parentheses') and n.parentheses == "yes":
+ res.set_parentheses (True)
+ return res
+
instrument_drumtype_dict = {
'Acoustic Snare Drum': 'acousticsnare',
'Side Stick': 'sidestick',
class VoiceData:
def __init__ (self):
+ self.voicename = None
self.voicedata = None
self.ly_voice = None
+ self.figured_bass = None
self.lyrics_dict = {}
self.lyrics_order = []
ignore_lyrics = False
current_staff = None
+
+ pending_figured_bass = []
# Make sure that the keys in the dict don't get reordered, since
# we need the correct ordering of the lyrics stanzas! By default,
for k in return_value.lyrics_order:
lyrics[k] = []
- voice_builder = LilyPondVoiceBuilder()
+ voice_builder = LilyPondVoiceBuilder ()
+ figured_bass_builder = LilyPondVoiceBuilder ()
for n in voice._elements:
if n.get_name () == 'forward':
else:
voice_builder.add_command (a)
continue
+
+ if isinstance (n, musicxml.FiguredBass):
+ a = musicxml_figured_bass_to_lily (n)
+ if a:
+ pending_figured_bass.append (a)
+ continue
is_chord = n.get_maybe_exist_named_child ('chord')
if not is_chord:
if voice_builder.current_duration () == 0 and n._duration > 0:
voice_builder.set_duration (n._duration)
+ # if we have a figured bass, set its voice builder to the correct position
+ # and insert the pending figures
+ if pending_figured_bass:
+ try:
+ figured_bass_builder.jumpto (n._when)
+ except NegativeSkip, neg:
+ pass
+ for fb in pending_figured_bass:
+ figured_bass_builder.add_music (fb, fb.real_duration)
+ pending_figured_bass = []
+
+
notations_children = n.get_typed_children (musicxml.Notations)
tuplet_event = None
span_events = []
v.mode = mode
return_value.ly_voice = v
+ # create \figuremode { figured bass elements }
+ if figured_bass_builder.elements:
+ fbass_music = musicexp.SequentialMusic ()
+ fbass_music.elements = figured_bass_builder.elements
+ v = musicexp.ModeChangingMusicWrapper()
+ v.mode = 'figuremode'
+ v.element = fbass_music
+ return_value.figured_bass = v
+
return return_value
def musicxml_id_to_lily (id):
str = "Part%sVoice%sLyrics%s" % (part_id, name, lyricsnr)
return musicxml_id_to_lily (str)
+def music_xml_figuredbass_name_to_lily_name (part_id, voicename):
+ str = "Part%sVoice%sFiguredBass" % (part_id, voicename)
+ return musicxml_id_to_lily (str)
+
def print_voice_definitions (printer, part_list, voices):
for part in part_list:
part_id = part.id
printer.newline()
for l in voice.lyrics_order:
lname = music_xml_lyrics_name_to_lily_name (part_id, name, l)
- printer.dump ('%s = ' %lname )
+ printer.dump ('%s = ' % lname )
voice.lyrics_dict[l].print_ly (printer)
printer.newline()
+ if voice.figured_bass:
+ fbname = music_xml_figuredbass_name_to_lily_name (part_id, name)
+ printer.dump ('%s = ' % fbname )
+ voice.figured_bass.print_ly (printer)
+ printer.newline()
def uniq_list (l):
# format the information about the staff in the form
# [staffid,
# [
-# [voiceid1, [lyricsid11, lyricsid12,...] ...],
-# [voiceid2, [lyricsid21, lyricsid22,...] ...],
+# [voiceid1, [lyricsid11, lyricsid12,...], figuredbassid1],
+# [voiceid2, [lyricsid21, lyricsid22,...], figuredbassid2],
# ...
# ]
# ]
-# raw_voices is of the form [(voicename, lyricsids)*]
+# raw_voices is of the form [(voicename, lyricsids, havefiguredbass)*]
def format_staff_info (part_id, staff_id, raw_voices):
voices = []
- for (v, lyricsids) in raw_voices:
+ for (v, lyricsids, figured_bass) in raw_voices:
voice_name = music_xml_voice_name_to_lily_name (part_id, v)
voice_lyrics = [music_xml_lyrics_name_to_lily_name (part_id, v, l)
for l in lyricsids]
- voices.append ([voice_name, voice_lyrics])
+ figured_bass_name = ''
+ if figured_bass:
+ figured_bass_name = music_xml_figuredbass_name_to_lily_name (part_id, v)
+ voices.append ([voice_name, voice_lyrics, figured_bass_name])
return [staff_id, voices]
def update_score_setup (score_structure, part_list, voices):
staves = uniq_list (staves)
staves.sort ()
for s in staves:
- thisstaff_raw_voices = [(voice_name, voice.lyrics_order)
+ thisstaff_raw_voices = [(voice_name, voice.lyrics_order, voice.figured_bass)
for (voice_name, voice) in nv_dict.items ()
if voice.voicedata._start_staff == s]
staves_info.append (format_staff_info (part_id, s, thisstaff_raw_voices))
else:
- thisstaff_raw_voices = [(voice_name, voice.lyrics_order)
+ thisstaff_raw_voices = [(voice_name, voice.lyrics_order, voice.figured_bass)
for (voice_name, voice) in nv_dict.items ()]
staves_info.append (format_staff_info (part_id, None, thisstaff_raw_voices))
score_structure.set_part_information (part_id, staves_info)