]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge branch 'master' of ssh://kainhofer@git.sv.gnu.org/srv/git/lilypond into dev...
authorReinhold Kainhofer <reinhold@kainhofer.com>
Wed, 2 Apr 2008 23:13:15 +0000 (01:13 +0200)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Wed, 2 Apr 2008 23:13:15 +0000 (01:13 +0200)
35 files changed:
Documentation/user/repeats.itely
Documentation/user/text.itely
input/lsr/adding-fingerings-to-tablatures.ly
input/lsr/adjusting-lyrics-vertical-spacing.ly
input/lsr/aligning-and-centering-instrument-names.ly
input/lsr/aligning-lyrics.ly
input/lsr/aligning-marks-with-various-notation-objects.ly [new file with mode: 0644]
input/lsr/automatic-beam-subdivisions.ly
input/lsr/automatic-beams-two-per-two-in-4-4-or-2-2-time-signature.ly
input/lsr/blanking-staff-lines-using-the--whiteout-command.ly
input/lsr/center-text-below-hairpin-dynamics.ly
input/lsr/changing-the-tuplet-number.ly
input/lsr/custodes.ly
input/lsr/demo-midiinstruments.ly
input/lsr/demonstrating-all-headers.ly
input/lsr/display-bracket-with-only-one-staff-in-a-system.ly
input/lsr/engraving-ties-manually.ly
input/lsr/entering-several-tuplets-using-only-one--times-command.ly
input/lsr/formatting-lyrics-syllables.ly
input/lsr/piano-template-simple.ly
input/lsr/piano-template-with-centered-lyrics.ly
input/lsr/piano-template-with-melody-and-lyrics.ly
input/lsr/printing-marks-at-the-end-of-a-line-or-a-score.ly [new file with mode: 0644]
input/lsr/printing-marks-on-every-staff.ly [new file with mode: 0644]
input/lsr/single-staff-template-with-notes,-lyrics,-and-chords.ly
input/lsr/text.snippet-list
input/lsr/vertically-centered-dynamics-and-textscripts.ly
input/lsr/vocal-ensemble-template-with-lyrics-aligned-below-and-above-the-staves.ly
input/regression/musicxml/18a-FiguredBass.xml [new file with mode: 0644]
input/regression/musicxml/19a-PageLayout-PrintMusic.xml [changed mode: 0755->0644]
input/regression/musicxml/AAA-intro-regression.ly
python/musicexp.py
python/musicxml.py
python/rational.py
scripts/musicxml2ly.py

index 46bd713f66f129bb59cfad0b0a9cc95a891e6408..2404c14e53328057d2b5aab9ee742a59128a0942 100644 (file)
@@ -95,12 +95,11 @@ to be played more than once.
 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:
 
@@ -167,8 +166,8 @@ c1
 @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
@@ -179,8 +178,7 @@ 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}.
 
@@ -190,9 +188,6 @@ Internals Reference: @internalsref{VoltaBracket},
 @internalsref{RepeatedMusic}, @internalsref{VoltaRepeatedMusic},
 @internalsref{UnfoldedRepeatedMusic}.
 
-@c Examples:
-
-
 @knownissues
 
 @cindex repeat, ambiguous
@@ -261,22 +256,55 @@ c4 c4
 
 @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
index 900d7d5ff193ef0f352fbef3b766b07c352664bc..1d21ed4a7f5e51789bbb038ff84f0cc8705663df 100644 (file)
@@ -242,15 +242,14 @@ c c
 
 @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
 
index 64fb4d5f25df791fac9cd927dd557176e1f7d333..c997121e8fc8ef09621bffc5ce79f6879e58f3b5 100644 (file)
@@ -9,15 +9,15 @@ To add fingerings to tablatures, you can use a combination of
 @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]
   }
 }
index 68a31e707bc1f41e6e224c4ccdaa4736c113f4a2..1e71ef88cd6b37578532fc0c567c9e4928b89cd5 100644 (file)
@@ -5,31 +5,22 @@
 \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 }
+>>
index 586103c4a0de81a63b92d5e352ac6f3d9b1ee9f8..becef5b1a0b136bf6f88899df66154ab641c17f5 100644 (file)
@@ -7,49 +7,47 @@
  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
+  }
 >>
index fcd55166d1575adf07a39d431647d585b3b67a8a..677bbba44095fceed2f0cf8f74434fd52b9f66f0 100644 (file)
@@ -6,10 +6,10 @@
   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'' {
@@ -18,5 +18,5 @@ and @code{#RIGHT} as well.
 \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"  
 }
diff --git a/input/lsr/aligning-marks-with-various-notation-objects.ly b/input/lsr/aligning-marks-with-various-notation-objects.ly
new file mode 100644 (file)
index 0000000..c51271c
--- /dev/null
@@ -0,0 +1,71 @@
+%% 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
+}
index bfe06865f334721a24a1849875020c04a4b138e2..70b9962317eb99cb9c74015ec6e3ce701f203044 100644 (file)
@@ -15,7 +15,7 @@ specified in @code{beatLength}).
     << {
       \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 {
index ae1c92d6d5b12125ae2eafce2f6612414fdbc9c6..9d4c1d4c12b1782db8e8f00b2e1848956bc97174 100644 (file)
@@ -7,15 +7,15 @@
  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
 
@@ -33,7 +33,7 @@ qbeam= {
       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
index 5161cd6a5b4c5456a5f40563cc5052c43fc6b15a..18feb70cc647be4142af10835131a6baea8a8b87 100644 (file)
@@ -10,7 +10,7 @@ Since staff lines are in a lower layer than most other grobs, this
 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
 } 
index 4196d310697e1ddf720059e425b30775694056cb..a26e579de9021bb5b29b0fff26b8a801cf300827 100644 (file)
@@ -6,7 +6,7 @@
   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.  
 " }
index a5b17af197bf35c110bf7b286d527e6a9dee1e3b..9f3fb3f9f9620ad26dd9c9d8b81d57cff4551bce 100644 (file)
@@ -6,7 +6,7 @@
   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.
 " }
index a3d250f11d50f4d4bd1383691abada68deaa3db2..b823da152a277c6d720bde3592899d1fa7498896 100644 (file)
@@ -8,31 +8,24 @@
 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'>
 }
-
index dc2dc609c95a5ee7c3f86fade214e9693b72a5c5..3444daee8d5895af524a9e578a308e490aa352a5 100644 (file)
 \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
-
-
+}
index 09536d4e965ee6f4dd7a1b5ce146c204cba24d28..c8e09c9d63d6299a8962fd037381a8dd0ff8bb40 100644 (file)
@@ -9,43 +9,38 @@ A demonstration of all headers.
 " }
 % 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"
+   }
 }
-
index d6799fe1be258c8aa790c373a6708c75d8b1c5a1..d0627939a6051297984147b5e33363040cefa7cb 100644 (file)
@@ -34,24 +34,24 @@ For staff contexts with @code{'SystemStartBrace}, such as
   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'
+    }
+  >>
 }
index 58781733e66a41d9decf1e1b42df3f2b14d30816..ea7ea694b49f58e4cc13a66084c211f2f85aace3 100644 (file)
@@ -12,8 +12,8 @@ number indicates the direction (1 = up, -1 = down).
 " }
 % 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> |
 }
index be11a8303a48010030d557d09c7c07e9e8a31d29..15c23bf838485aea499290576c64a53cb92b19bb 100644 (file)
@@ -8,7 +8,7 @@
 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.
index b57aec0fcd74f2b4635ffcc5bf06c57afabdfd4b..b45eaf6f1a816c7bf4b1e124b70d557bb63ab2bc 100644 (file)
@@ -5,23 +5,23 @@
 \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
 >>
 
index 06d260833ce6ebd7df65367df805a3fe52253e9b..b507542bdc813f7091dba9c2a3082795abbeafd3 100644 (file)
@@ -9,28 +9,29 @@ Here is a simple piano staff with some notes.
 " }
 % 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 { }
+}
index 9727132ff76567e390e1c1698d4a9d0707ba7a37..91b05bbc1a054e4449ca6522adfd3f0d9144c8c2 100644 (file)
@@ -11,38 +11,42 @@ staff).
 " }
 % 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 { }
+}
index 3b9f4c5f29ea324a01ab078bc423b79103af5680..76c7ee89555d813ad2a0a559cb3c719fd1b5371e 100644 (file)
@@ -10,49 +10,48 @@ with piano accompaniment underneath.
 " }
 % 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 { }
+}
diff --git a/input/lsr/printing-marks-at-the-end-of-a-line-or-a-score.ly b/input/lsr/printing-marks-at-the-end-of-a-line-or-a-score.ly
new file mode 100644 (file)
index 0000000..858a304
--- /dev/null
@@ -0,0 +1,26 @@
+%% 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"
+}
diff --git a/input/lsr/printing-marks-on-every-staff.ly b/input/lsr/printing-marks-on-every-staff.ly
new file mode 100644 (file)
index 0000000..e0b2bb1
--- /dev/null
@@ -0,0 +1,26 @@
+%% 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' }
+  >>
+}
index 8f05237b12e38ad748588a4a1ce5c1dd62216e69..0d3db03bc61210b9bc91c027cbee176a16d434e2 100644 (file)
@@ -10,34 +10,31 @@ chords.
 " }
 % 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 { }
+}
index e724cc45ff51570448e83d08a75dd41fe84e37c2..1c7cba928366b0e73551170bfa0062e881e1d13b 100644 (file)
@@ -1,20 +1,23 @@
-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
index 5d183b4fd25d6cd42a98a9c7635c43dd73d59c73..6923de54c2016f4ffaaaf7dfb9046c349a412a49 100644 (file)
@@ -5,34 +5,25 @@
 \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
 }
-
index d3042b5a497d9a9f1f9868e0c9300972c7e31485..633332bb0dca7866d65b052a04ab2d5b4b3854e2 100644 (file)
  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)
+    }
+  }
+}
diff --git a/input/regression/musicxml/18a-FiguredBass.xml b/input/regression/musicxml/18a-FiguredBass.xml
new file mode 100644 (file)
index 0000000..d578ac7
--- /dev/null
@@ -0,0 +1,109 @@
+<?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>
index 78e151d74ed2d38df951cdb46c2993e4504bc26b..5e4914fc9758938a46e0e6cba25802a41942b895 100644 (file)
@@ -29,9 +29,9 @@ The files are categorized by their first two digits with the following meaning:
 @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)
@@ -42,8 +42,10 @@ The files are categorized by their first two digits with the following meaning:
 @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
 ")
 
index 2ae8a6784f3ea480f3343d6539323fd79ec706d0..cdd0271486c2944f6242030b9fbf1f104d963f0e 100644 (file)
@@ -1270,6 +1270,58 @@ class StaffChange (Music):
         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):
 
@@ -1388,7 +1440,7 @@ class Staff (StaffGroup):
             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:
@@ -1400,6 +1452,8 @@ class Staff (StaffGroup):
                 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):
index e0612802b79beb84532a7de77dc730893d972223..adfd1027cbc53bb396325947ab5bdae7cad3748b 100644 (file)
@@ -529,6 +529,12 @@ class Part (Music_xml_node):
                 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)
@@ -656,7 +662,8 @@ class Part (Music_xml_node):
 
            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:
@@ -688,9 +695,9 @@ class Part (Music_xml_node):
                     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
 
@@ -880,6 +887,10 @@ class Frame_Note (Music_xml_node):
         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
@@ -902,6 +913,7 @@ class_dict = {
        'duration': Duration,
         'frame': Frame,
         'frame-note': Frame_Note,
+        'figured-bass': FiguredBass,
         'glissando': Glissando,
        'grace': Grace,
         'harmony': Harmony,
index 705829e120835269894d3991ad28013208d1d598..5a9ee629b3bcdc56328f9ecc9b9a4951d4fabe56 100644 (file)
@@ -38,13 +38,18 @@ class Rational(object):
            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
 
index a429b752510dbcb104937f080be03548f4493572..e8ae92c2196875e686b41b7f50cc5c60d8aad72e 100644 (file)
@@ -426,7 +426,6 @@ def extract_score_structure (part_list, staffinfo):
     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 
@@ -443,16 +442,26 @@ def musicxml_duration_to_lily (mxl_note):
 
 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:
@@ -1233,6 +1242,56 @@ def musicxml_harmony_to_lily (n):
 
     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',
@@ -1425,8 +1484,10 @@ class LilyPondVoiceBuilder:
 
 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 = []
 
@@ -1454,6 +1515,8 @@ def musicxml_voice_to_lily_voice (voice):
     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,
@@ -1462,7 +1525,8 @@ def musicxml_voice_to_lily_voice (voice):
     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':
@@ -1495,6 +1559,12 @@ def musicxml_voice_to_lily_voice (voice):
                 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:
@@ -1584,6 +1654,18 @@ def musicxml_voice_to_lily_voice (voice):
             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 = []
@@ -1759,6 +1841,15 @@ def musicxml_voice_to_lily_voice (voice):
         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):
@@ -1925,6 +2016,10 @@ def music_xml_lyrics_name_to_lily_name (part_id, name, lyricsnr):
     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
@@ -1936,9 +2031,14 @@ def print_voice_definitions (printer, part_list, voices):
             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):
@@ -1947,19 +2047,22 @@ 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):
@@ -1981,12 +2084,12 @@ 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)