]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge branch 'master' into lilypond/translation
authorFrancisco Vila <francisco.vila@hispalinux.es>
Mon, 15 Dec 2008 10:15:12 +0000 (11:15 +0100)
committerFrancisco Vila <francisco.vila@hispalinux.es>
Mon, 15 Dec 2008 10:15:12 +0000 (11:15 +0100)
36 files changed:
Documentation/de/user/fretted-strings.itely
Documentation/es/user/fretted-strings.itely
Documentation/topdocs/NEWS.tely
Documentation/user/fretted-strings.itely
Documentation/user/music-glossary.tely
Documentation/user/tweaks.itely
input/lsr/stand-alone-two-column-markup.ly
input/lsr/tick-bar-lines.ly
input/new/tick-bar-lines.ly [new file with mode: 0644]
input/regression/bar-line-tick.ly [new file with mode: 0644]
input/regression/flags-straight-stockhausen-boulez.ly [new file with mode: 0644]
input/regression/flags-straight.ly [new file with mode: 0644]
input/regression/fret-diagrams.ly
input/regression/predefined-fretboards.ly
lily/bar-line.cc
lily/include/bar-line.hh
lily/include/paper-book.hh
lily/include/paper-column.hh
lily/paper-book.cc
lily/paper-column.cc
lily/separation-item.cc
lily/spacing-spanner.cc
lily/span-bar.cc
ly/declarations-init.ly
ly/predefined-fretboards-init.ly
ly/predefined-guitar-fretboards.ly
ly/predefined-guitar-ninth-fretboards.ly
mf/feta-toevallig.mf
python/convertrules.py
python/musicexp.py
scm/c++.scm
scm/define-grob-properties.scm
scm/flag-styles.scm
scm/fret-diagrams.scm
scm/output-lib.scm
scm/predefined-fretboards.scm

index 03311ea9b5226bff5c9897bc2992c0595ac105b7..ff45c9387ad6021a88c10838673fbdebecb5dbf9 100644 (file)
@@ -620,7 +620,7 @@ Fingersatz und Barre kann im ausführlichen Modus notiert werden.
 <<
   \context ChordNames {
      \chordmode {
-       f1 g
+       f1 g c
      }
   }
   \context Staff {
@@ -647,7 +647,15 @@ Fingersatz und Barre kann im ausführlichen Modus notiert werden.
         (open 2)
         (place-fret 1 3 3)
       )
-  }
+    < c e g c' e'> ^\markup
+      \fret-diagram-verbose #'(
+        (capo 3)
+        (mute 6)
+        (place-fret 4 5 1)
+        (place-fret 3 5 2)
+        (place-fret 2 5 3)
+      )
+   }
 >>
 @end lilypond
 
@@ -886,7 +894,7 @@ Tonhöhe benutzt werden.
 
 \storePredefinedDiagram \chordmode {c'}
                         #guitar-tuning
-                        #(offset-fret 2 (chord-shape 'bes))
+                        #(offset-fret 2 (chord-shape 'bes guitar-tuning))
 
 mychords = \chordmode{
   c1 c'
@@ -922,16 +930,16 @@ Bunddiagramme zu definieren.
 
 % add a new chord shape
 
-\addChordShape #'powerf #"1-1;3-3;3-4;x;x;x;"
+\addChordShape #'powerf #guitar-tuning #"1-1;3-3;3-4;x;x;x;"
 
 % add some new chords based on the power chord shape
 
 \storePredefinedDiagram \chordmode {f'}
                         #guitar-tuning
-                        #(chord-shape 'powerf)
+                        #(chord-shape 'powerf guitar-tuning) 
 \storePredefinedDiagram \chordmode {g'}
                         #guitar-tuning
-                        #(offset-fret 2 (chord-shape 'powerf))
+                        #(offset-fret 2 (chord-shape 'powerf guitar-tuning))
 
 mychords = \chordmode{
   f1 f' g g'
index 128f5c221e4aca2da127ccfd754ef4149f7a8803..fbad4ce15f2769ca5927d36447a7661c6627d786 100644 (file)
@@ -625,7 +625,7 @@ prolija @code{fret-diagram-verbose}.
 <<
   \context ChordNames {
      \chordmode {
-       f1 g
+       f1 g c
      }
   }
   \context Staff {
@@ -652,7 +652,15 @@ prolija @code{fret-diagram-verbose}.
         (open 2)
         (place-fret 1 3 3)
       )
-  }
+    < c e g c' e'> ^\markup
+      \fret-diagram-verbose #'(
+        (capo 3)
+        (mute 6)
+        (place-fret 4 5 1)
+        (place-fret 3 5 2)
+        (place-fret 2 5 3)
+      )
+   }
 >>
 @end lilypond
 
@@ -892,7 +900,7 @@ usando distinas octavas para las notas.
 
 \storePredefinedDiagram \chordmode {c'}
                         #guitar-tuning
-                        #(offset-fret 2 (chord-shape 'bes))
+                        #(offset-fret 2 (chord-shape 'bes guitar-tuning))
 
 mychords = \chordmode{
   c1 c'
@@ -927,16 +935,16 @@ definir diagramas de traste predefinidos.
 
 % add a new chord shape
 
-\addChordShape #'powerf #"1-1;3-3;3-4;x;x;x;"
+\addChordShape #'powerf #guitar-tuning #"1-1;3-3;3-4;x;x;x;"
 
 % add some new chords based on the power chord shape
 
 \storePredefinedDiagram \chordmode {f'}
                         #guitar-tuning
-                        #(chord-shape 'powerf)
+                        #(chord-shape 'powerf guitar-tuning) 
 \storePredefinedDiagram \chordmode {g'}
                         #guitar-tuning
-                        #(offset-fret 2 (chord-shape 'powerf))
+                        #(offset-fret 2 (chord-shape 'powerf guitar-tuning))
 
 mychords = \chordmode{
   f1 f' g g'
index 0632df85786ec992a32926328f4d410c98a810dd..f18656a179add6f7ddfdb9860c3f96076c6988c3 100644 (file)
@@ -62,6 +62,19 @@ which scares away people.
 
 @end ignore
 
+@item
+Straight flags (used in old scores of e.g. Bach, but also in different form in 
+modern scores of e.g. Stockhausen) are now implemented:
+@lilypond
+\relative c'' {
+  \override Stem #'flag = #modern-straight-flag
+  c,16 \acciaccatura {c'8} d4 d32 
+  \bar":"
+  \override Stem #'flag = #old-straight-flag
+  c,16 \acciaccatura {c'8} d4 d32 
+}
+@end lilypond
+
 @item
 @code{\bookpart} blocks may be used to split a book into several parts,
 separated by a page break, in order to ease the page breaking, or to use
index 84a68f466fd437fa9fc175f7adf22325ca400606..3479ffe0553df2c71cb00f331cdf9e062f9effd4 100644 (file)
@@ -604,14 +604,18 @@ element of the list indicates an item to be placed on the fret diagram.
 @end lilypond
 
 Fingering indications and barres can be included in a
-fret-diagram-verbose markup string.
+fret-diagram-verbose markup string.  Unique to the 
+fret-diagram-verbose interface is a capo indication that 
+can be placed on the fret diagram.  The capo indication is
+a thick bar that covers all strings.  The fret with the
+capo will be the lowest fret in the fret diagram.
 
 @c \override is necessary to make fingering visible
 @lilypond[quote, verbatim]
 <<
   \context ChordNames {
      \chordmode {
-       f1 g
+       f1 g c
      }
   }
   \context Staff {
@@ -638,7 +642,15 @@ fret-diagram-verbose markup string.
         (open 2)
         (place-fret 1 3 3)
       )
-  }
+    < c e g c' e'> ^\markup
+      \fret-diagram-verbose #'(
+        (capo 3)
+        (mute 6)
+        (place-fret 4 5 1)
+        (place-fret 3 5 2)
+        (place-fret 2 5 3)
+      )
+   }
 >>
 @end lilypond
 
@@ -838,8 +850,10 @@ mychords = \chordmode{
 @cindex adding custom fret diagrams
 
 Fret diagrams can be added to the fret diagram table.  To add a diagram,
-you must specify the chord for the diagram, the tuning to be used, and the
-fret-diagram-terse definition string for the diagram.
+you must specify the chord for the diagram, the tuning to be used, and 
+a definition for the diagram.  The diagram definition can be either a
+fret-diagram-terse definition string or a fret-diagram-verbose
+marking list.
 
 @lilypond[verbatim, ragged-right, quote]
 \include "predefined-guitar-fretboards.ly"
@@ -870,7 +884,7 @@ octaves of pitches.
 
 \storePredefinedDiagram \chordmode {c'}
                         #guitar-tuning
-                        #(offset-fret 2 (chord-shape 'bes))
+                        #(offset-fret 2 (chord-shape 'bes guitar-tuning))
 
 mychords = \chordmode{
   c1 c'
@@ -898,23 +912,25 @@ In addition to fret diagrams, LilyPond stores an internal list of chord
 shapes.  The chord shapes are fret diagrams that can be shifted along
 the neck to different posistions to provide different chords.  Chord
 shapes can be added to the internal list and then used to define
-predefined fret diagrams.
+predefined fret diagrams.  Like fret diagrams, chord shapes can be
+entered as either fret-diagram-terse strings or fret-diagram-verbose
+marking lists.
 
 @lilypond[verbatim, ragged-right, quote]
 \include "predefined-guitar-fretboards.ly"
 
 % add a new chord shape
 
-\addChordShape #'powerf #"1-1;3-3;3-4;x;x;x;"
+\addChordShape #'powerf #guitar-tuning #"1-1;3-3;3-4;x;x;x;"
 
 % add some new chords based on the power chord shape
 
 \storePredefinedDiagram \chordmode {f'}
                         #guitar-tuning
-                        #(chord-shape 'powerf)
+                        #(chord-shape 'powerf guitar-tuning) 
 \storePredefinedDiagram \chordmode {g'}
                         #guitar-tuning
-                        #(offset-fret 2 (chord-shape 'powerf))
+                        #(offset-fret 2 (chord-shape 'powerf guitar-tuning))
 
 mychords = \chordmode{
   f1 f' g g'
index 9cd294fc72bc02e1c5575fef86b84b9680f2b1d3..6e779da344fa7e4c63bcc796d68ec35cd327b559 100644 (file)
@@ -688,18 +688,33 @@ An accidental alters a note by:
 @item Canceling the effects of the key signature or previous accidentals.
 @end itemize
 
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
-<< 
-  \context Staff \relative c'' {
-    \set Staff.extraNatural = ##f
-    gisis1 gis g! ges geses
+@lilypond[quote,notime]
+\score {
+  \new Staff {
+    \relative c'' {
+      \set Staff.extraNatural = ##f
+      gisis1 gis g! ges geses
+    }
   }
-  \lyrics {
-    \override Lyrics .LyricText #'self-alignment-X = #-1
-    "db. sharp" sharp natural flat "db. flat"
+  \addlyrics {
+    \markup {
+      \center-column { double sharp }
+    }
+    sharp
+    natural
+    flat
+    \markup {
+      \center-column { double flat }
+    }
   }
->>
+  \layout {
+    \context {
+      \Score
+      \override SpacingSpanner
+        #'base-shortest-duration = #(ly:make-moment 1 32)
+    }
+  }
+}
 @end lilypond
 
 
@@ -753,25 +768,22 @@ that the sound should fade away to nothing.
 
 @notation{Al niente} is indicated by circling the tip of the hairpin:
 
-@lilypond[fragment,ragged-right]
-\relative c'' {
-  \override Hairpin #'circled-tip = ##t
-  c1\<
-  c2\> c\<
-  c1\!
-}
+@lilypond[quote,relative=2]
+\override Hairpin #'circled-tip = ##t
+c1\<
+c2\> c\<
+c1\!
 @end lilypond
 
-or with the actual phrase @notation{al niente}.  This may be easier with
-text markup, rather than as part of the @notation{decrescendo} text:
+or with the actual phrase @notation{al niente}:
 
-@lilypond[fragment,ragged-right]
-\relative c'' {
-  \dimTextDecresc
-  c1~\>
-  c~
-  c\!-\markup { \italic "al niente" }
-}
+@lilypond[quote,relative=2]
+\dimTextDecresc
+\override DynamicTextSpanner #'(bound-details right text) =
+  \markup { \italic { al niente } }
+c1\> ~
+c1 ~
+c1\!
 @end lilypond
 
 Since one does not crescendo @emph{to} nothing, it is not correct to use
@@ -899,15 +911,17 @@ S: upptakt,
 FI: kohotahti.
 
 An anacrusis (also known as pickup or upbeat) is an incomplete measure
-of music before a section of music. It also refers to the initial
+of music before a section of music.  It also refers to the initial
 note(s) of a melody occurring in that incomplete measure.
 
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,relative=1]
 \key f \major
 \time 4/4
-\relative c' {
-  \partial 4 f4 | bes4. a8 bes4 c |
-  bes( a) g f | bes4. a8 bes4 c | f,2. \bar "||" }
+\partial 4 f4
+bes4. a8 bes4 c
+bes4( a) g f
+bes4. a8 bes4 c
+f,2. \bar "||"
 @end lilypond
 
 
@@ -929,10 +943,8 @@ FI: luonnollinen molliasteikko.
 
 Also called @q{natural minor scale}.
 
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
-\relative c'' {
-  a1 b c d e f g a }
+@lilypond[quote,notime,relative=2]
+a1 b c d e f g a
 @end lilypond
 
 
@@ -980,45 +992,43 @@ before the beat.  While the short appoggiatura is performed as a short
 note regardless of the duration of the main note the duration of the
 long appoggiatura is proportional to that of the main note.
 
-@lilypond[line-width=13.0\cm]
-\context Voice \relative c'' {
-  \key d \major
-  \time 4/4
-
-%\override Score.TextScript #'font-style = #'large
-  <d a fis>4_"notation" r
-  { \override Stem #'flag-style = #'()
-    \grace g16
-    \revert Stem #'flag-style
-  }
-  fis8 e16 fis
-  { \override Stem #'flag-style = #'()
-    \grace a16
-    \revert Stem #'flag-style
-  }
-  g8 fis16 g |
-  \cadenzaOn a4 \bar "||" \cadenzaOff
-
-  <d, a fis>4_"performance" r g16 ( fis) e fis a ( g) fis g |
-  \cadenzaOn a4 \bar "||" \cadenzaOff
-}
+@lilypond[quote,relative=2]
+\key d \major
+\time 4/4
+<d a fis>4_"notation" r
+\grace g16
+fis8 e16 fis
+\grace a16
+g8 fis16 g |
+a4 \bar "||"
+
+\set Score.measurePosition = #ZERO-MOMENT
+<d, a fis>4_"performance" r
+g16( fis) e fis
+a16 ( g) fis g |
+a4 \bar "||"
 @end lilypond
 
 An appoggiatura may have more notes preceding the main note.
 
-@lilypond[line-width=13.0\cm]
-\relative c'' {
-  \key as \major
-  \time 2/4
-%  \override Score.TextScript #'font-style = #'large
-  \grace { bes16 } as8_"notation" as16 bes as8 g |
-  \grace { as16[( bes] } < c as >4-)
-  \grace { as16[( bes] } < c as >4-) \bar "||"
-  \grace { bes16 } as8_"performance" as16 bes as8 g |
-  << \context Voice = va { \stemUp\tieUp as32 bes c8. as32 bes c8. }
-    \context Voice = vb { \stemDown\tieDown as16 ~ as8. as16 ~ as8. } >>
-  \bar "||"
-}
+@lilypond[quote,relative=2]
+\key as \major
+\time 2/4
+\grace bes16 as8-"notation" as16 bes as8 g |
+\grace { as16[( bes] } <c as>4)
+\grace { as16[( bes] } <c as>4) \bar "||"
+
+\grace bes16 as8-"performance" as16 bes as8 g |
+<<
+  {
+    \voiceOne
+    as32 bes c8. as32 bes c8.
+  }
+  \new Voice {
+    \voiceTwo
+    as16 ~ as8. as16 ~ as8.
+  }
+>>
 @end lilypond
 
 
@@ -1040,22 +1050,33 @@ FI: arpeggio, murtosointu.
 
 [Italian: @q{harp-like, played like a harp}.]
 
-@lilypond[fragment,line-width=13.0\cm]
- \context PianoStaff <<
-  \context Staff = SA \relative c'' {
-    \time 4/4
-    \clef treble
-    r8 g16 c e g, c e r8 g,16 c e g, c e |
-    r8 a,16 d f a, d f r8 a,16 d f a, d f \bar "||" }
-  \context Staff = SB \relative c' {
-    \clef bass
-    << \context Voice = va {
-        \stemUp
-        r16 e8. ( e4) r16 e8. ( e4) |
-        r16 d8. ( d4) r16 d8. ( d4) }
-      \context Voice = vb {
-        \stemDown
-        c2 c | c c } >>
+@lilypond[quote,line-width=13\cm]
+\new PianoStaff <<
+  \context Staff = "SA" {
+    \relative c'' {
+      \clef treble
+      \time 4/4
+      r8 g16 c e g, c e r8 g,16 c e g, c e
+      r8 a,16 d f a, d f r8 a,16 d f a, d f
+      \bar "||"
+    }
+  }
+  \context Staff = "SB" {
+    \relative c' {
+      \clef bass
+      <<
+        {
+          \voiceOne
+          r16 e8. ( e4) r16 e8. ( e4)
+          r16 d8. ( d4) r16 d8. ( d4)
+        }
+        \new Voice {
+          \voiceTwo
+          c2 c
+          c2 c
+        }
+      >>
+    }
   }
 >>
 @end lilypond
@@ -1327,14 +1348,11 @@ FI: palkki.
 Line connecting a series of notes (shorter than a quarter note). The
 number of beams determines the note value of the connected notes.
 
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
-%\override TextScript #'font-style = #'large
-\relative c'' {
-  g8_"1/8"[ g g g] s16
-  g16_"1/16"[ g g g] s16
-  g32_"1/32"[ s32 g32 s32 g32 s32 g32] s16
-  g64_"1/64"[ s32 g64 s32 g64 s32 g64] s32 }
+@lilypond[quote,notime,relative=2,line-width=13\cm]
+g8-"1/8"[ g g g] s16
+g16-"1/16"[ g g g] s
+g32-"1/32"[ s g s g s g] s16
+g64-"1/64"[ s32 g64 s32 g64 s32 g64] s32
 @end lilypond
 
 
@@ -1358,12 +1376,12 @@ Note value used for counting, most often half-, fourth-, and eighth notes.
 The base counting value and the number of them in each measure is indicated
 at the start of the music by the @notation{time signature}.
 
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,relative=2]
 \key g \major
 \time 4/4
-\relative c'' { g4 c b a | g1 \bar "||"}
+g4 c b a | g1 \bar "||"
 \time 3/8
-\relative c'' { g8 d' c | b c a | g4. \bar "||"}
+g8 d' c | b c a | g4. \bar "||"
 @end lilypond
 
 
@@ -1405,19 +1423,42 @@ Curly braces are used for connecting piano staves, and sometimes for connecting
 the staves of like instruments in an orchestral score when written on different
 staves (e.g. first and second flutes):
 
-@lilypond[fragment,ragged-right]
-\context GrandStaff <<
-  \relative c''\context Staff = SA { \clef treble g4 e c2 }
-  \relative c \context Staff = SB { \clef bass c1 \bar "|." } >>
+@lilypond[quote]
+\new GrandStaff <<
+  \context Staff = "SA" {
+    \relative c'' {
+      \clef treble
+      g4 e c2
+    }
+  }
+  \context Staff = "SB" {
+    \relative c {
+      \clef bass
+      c1
+      \bar "|."
+    }
+  }
+>>
 @end lilypond
 
 Angular brackets for connecting parts in an orchestral or choral score:
 
-@lilypond[fragment,ragged-right]
-\context StaffGroup <<
-%  \set StaffGroup.minVerticalAlign = #12
-  \relative c'' \context Staff = SA { \clef treble g4 e c2 }
-  \relative c \context Staff = SB { \clef bass c1 \bar "|." } >>
+@lilypond[quote]
+\new StaffGroup <<
+  \context Staff = "SA" {
+    \relative c'' {
+      \clef treble
+      g4 e c2
+    }
+  }
+  \context Staff = "SB" {
+    \relative c {
+      \clef bass
+      c1
+      \bar "|."
+    }
+  }
+>>
 @end lilypond
 
 
@@ -1456,7 +1497,7 @@ FI: vaskisoitin.
 
 A family of blown musical instruments made of brass, all using a cup
 formed mouth piece.  The brass instruments commonly used in a symphony
-orchestra are trumpet, trombone, french horn, and tube.
+orchestra are trumpet, trombone, french horn, and tuba.
 
 
 @seealso
@@ -1501,9 +1542,8 @@ Note value twice as long as a whole note.  Mainly used in pre-1650 music.
 The shortest note value generally used in white mensural notation, hence the
 name, which originally meant @q{of short duration}.
 
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
-\relative c'' { g\breve }
+@lilypond[quote,notime,relative=2]
+g\breve
 @end lilypond
 
 
@@ -1545,22 +1585,19 @@ FI: C-avain.
 Clef symbol indicating the position of the middle C.  Used on all note
 lines.
 
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
-\override Score.Clef #'full-size-change = ##t
-<<
-  \context Staff \relative c' {
-    \clef soprano c1 
-    \clef mezzosoprano c 
-    \clef alto c 
-    \clef tenor c 
-    \clef baritone c 
-  }
-  \context Lyrics \lyrics {
-    \override Lyrics .LyricText #'self-alignment-X = #-1
-    "Soprano  " "Mezzosoprano  " "Alto  " "Tenor  " Baritone
-  }
->>
+@lilypond[quote,notime,relative=1,line-width=13.0\cm]
+\new Staff {
+  \override Staff.Clef #'full-size-change = ##t
+  \clef soprano c1
+  \clef mezzosoprano c1
+  \clef alto c1
+  \clef tenor c1
+  \clef baritone c1
+}
+\addlyrics {
+  \override Lyrics . LyricText #'self-alignment-X = #LEFT
+  "Soprano  " "Mezzosoprano  " "Alto  " "Tenor  " Baritone
+}
 @end lilypond
 
 
@@ -1689,36 +1726,36 @@ S: ackord,
 FI: sointu.
 
 Three or more tones sounding simultaneously.  In traditional European music
-the base chord is a @emph{triad} consisting of two thirds. @emph{Major}
+the base chord is a @emph{triad} consisting of two thirds.  @emph{Major}
 (major + minor third) as well as @emph{minor} (minor + major third) chords
-may be extended with more thirds. Four-tone @emph{seventh chords} and
+may be extended with more thirds.  Four-tone @emph{seventh chords} and
 five-tone @emph{ninth} major chords are most often used as dominants
 (functional harmony).  Chords having no third above the lower notes to
 define their mood are a special case called @q{open chords}.  The lack of
 the middle third means their quality is ambivalent -- neither major nor
 minor.
 
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
-%\override TextScript #'font-style = #'large
+@lilypond[quote,notime,line-width=13.0\cm]
 <<
-\context Staff \relative c'' {
-  \set Staff.extraNatural = ##f
-  <g b d>1 
-  <g bes d>
-  <g bes des>
-  <g b dis> 
-  <g b d f> 
-  <g b d f a> 
-}
-\lyrics{
-  "major  "
-  "minor  "
-  "diminished  "
-  "augmented  "
-  "seventh-chord  "
-  ninth-chord
-}
+  \new Staff {
+    \relative c'' {
+      \set Staff.extraNatural = ##f
+      <g b d>1
+      <g bes d>
+      <g bes des>
+      <g b dis>
+      <g b d f>
+      <g b d f a>
+    }
+  }
+  \lyrics {
+    "major  "
+    "minor  "
+    "diminished  "
+    "augmented  "
+    "seventh-chord  "
+    ninth-chord
+  }
 >>
 @end lilypond
 
@@ -1742,9 +1779,8 @@ FI: kromaattinen asteikko.
 
 A scale consisting of all 12 semitones.
 
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
-\relative c' { c1 cis d dis e f fis g gis a ais b c }
+@lilypond[quote,notime,relative=1,line-width=13.0\cm]
+c1 cis d dis e f fis g gis a ais b c
 @end lilypond
 
 
@@ -2046,8 +2082,8 @@ geometrically describes the development of a range of pitches
 geometrical shape of a cluster covers the area in which any single
 pitch contained in the cluster would be notated as an ordinary note.
 
-@lilypond[fragment,relative=2,ragged-right]
-\makeClusters { <c e> <b f'> <b g'> <c g> <f e> }
+@lilypond[quote,relative=2]
+\makeClusters { <c e>4 <b f'> <b g'> <c g>8 <f e> }
 @end lilypond
 
 
@@ -2183,8 +2219,10 @@ A meter that includes a triplet subdivision within the beat: see
 A time signature that additively combines two or more unequal meters, e.g.,
 "3/8 + 2/8" instead of "5/8".  Sometimes called additive time signatures.
 
-@lilypond[fragment,line-width=13.0\cm]
-#(define (compound-time grob one two three num)
+@end enumerate
+
+@lilypond[quote,line-width=13.0\cm]
+#(define ((compound-time one two three num) grob)
   (grob-interpret-markup grob
     (markup
       #:override '(baseline-skip . 0)
@@ -2199,8 +2237,8 @@ A time signature that additively combines two or more unequal meters, e.g.,
 \relative c' {
   \key f \major
   #(set-time-signature 8 8 '(3 2 3))
-  \override Staff.TimeSignature #'stencil = #(lambda (grob)
-    (compound-time grob "3" "2" "3" "8"))
+  \override Staff.TimeSignature #'stencil =
+    #(compound-time "3" "2" "3" "8")
   #(override-auto-beam-setting '(end 1 8 8 8) 3 8)
   #(override-auto-beam-setting '(end 1 8 8 8) 5 8)
   
@@ -2210,8 +2248,6 @@ A time signature that additively combines two or more unequal meters, e.g.,
 }
 @end lilypond
 
-@end enumerate
-
 
 @seealso
 @ref{compound meter}, @ref{meter}, @ref{polymetric time signature}.
@@ -2258,7 +2294,7 @@ all) instruments that play in concert pitch:
 @itemize
 @item violin
 @item viola
-@item violincello
+@item violoncello
 @end itemize
 
 @end multitable
@@ -2277,7 +2313,7 @@ are, technically speaking, @emph{transposing instruments}:
 
 @item piccolo (plays an octave higher)
 @item celesta (plays an octave higher)
-@item double-bass (plays an octave lower)
+@item double bass (plays an octave lower)
 
 @end itemize
 
@@ -2301,9 +2337,10 @@ FI: asteittainen liike.
 Progressing melodically by intervals of a second, as contrasted with
 @emph{disjunct movement}.
 
-@lilypond[fragment,line-width=13.0\cm]
-\key g \major \time 4/4
-\relative c'' { g4 g g a | b2 a | g4 b a a | g1 \bar "||" }
+@lilypond[quote,relative=2,line-width=13.0\cm]
+\key g \major
+\time 4/4
+g4 g g a | b2 a | g4 b a a | g1 \bar "||"
 @end lilypond
 
 
@@ -2378,14 +2415,12 @@ combination into a single musical fabric of lines or parts which have
 distinct melodic significance.  A frequently used polyphonic technique
 is imitation, in its strictest form found in the canon needing only
 one part to be written down while the other parts are performed with a
-given displacement.  Imitation is also the contrapunctal technique
+given displacement.  Imitation is also the contrapuntal technique
 used in the @emph{fugue} which, since the music of the baroque era,
 has been one of the most popular polyphonic composition methods.
 
-@lilypond[fragment,staffsize=12,line-width=13.0\cm]
-\set Score.implicitTimeSignatureVisibility = #all-invisible
-\override Score.TimeSignature #'break-visibility = #all-invisible
-\context PianoStaff <<
+@lilypond[quote,staffsize=12,line-width=13.0\cm]
+\new PianoStaff <<
   \context Staff = SA \relative c' {
     \key bes \major
     \time 4/4
@@ -2456,9 +2491,10 @@ FI: cresendo, voimistuen.
 Increasing volume.  Indicated by a rightwards opening horizontal wedge
 (hairpin) or the abbreviation @notation{cresc.}.
 
-@lilypond[fragment,ragged-right]
-\key g \major \time 4/4
-\relative c'' { g4 \< a b c | d1\! \bar "|." }
+@lilypond[quote,relative=2]
+\key g \major
+\time 4/4
+g4\< a b c | d1\! \bar "|."
 @end lilypond
 
 
@@ -2509,22 +2545,19 @@ There were different appearences for different notation styles.  Nowadays,
 they have survived only in special forms of musical notation such as the
 @emph{Editio Vaticana}, dating from the beginning of the 20th century
 
-@lilypond
+@lilypond[quote,ragged-right]
 \score {
-  {
-%   \override Staff.Custos #'neutral-position = #4
-    \override Staff.Custos #'neutral-direction = #down
+  \new Staff {
+    \override Staff.Custos #'neutral-direction = #DOWN
     \override Staff.Custos #'style = #'hufnagel
     c'1 \break
     <d' a' f''>1
   }
-
   \layout {
     \context {
       \Staff
-      \consists Custos_engraver
+      \consists "Custos_engraver"
     }
-    ragged-right = ##t
   }
 }
 @end lilypond
@@ -2609,17 +2642,17 @@ Abbreviated @notation{D.S.}.  Repetition, not from the beginning, but from
 another place frequently near the beginning marked by a sign
 (@notation{segno}):
 
-@lilypond[fragment,ragged-right]
-%\override TextScript #'font-style = #'large
-\override TextScript #'font-shape = #'italic
-\key g \major \time 4/4
-\relative c'' {
-  d1 |
-  g,4^\segno a b c |
-  b a g2_\markup{
-    \line { "D.S. " \tiny \raise #1 \musicglyph #"scripts.segno" } }
-  \bar "|."
+@lilypond[quote,relative=2]
+\key g \major
+\time 4/4
+d1
+g,4^\segno a b c
+b4 a g2-\markup {
+  \italic "D.S. "
+  \tiny \raise #1
+  \musicglyph #"scripts.segno"
 }
+\bar "|."
 @end lilypond
 
 
@@ -2641,11 +2674,10 @@ FI: decresendo, hiljentyen.
 Decreasing tone volume.  Indicated by a leftwards opening horizontal
 wedge (hairpin) or the abbreviation @notation{decresc.}.
 
-@lilypond[fragment,ragged-right]
-\relative c'' {
-  \key g \major \time 4/4
-  d4 \> c b a | g1 \! \bar "|."
-}
+@lilypond[quote,relative=2]
+\key g \major
+\time 4/4
+d4\> c b a | g1 \! \bar "|."
 @end lilypond
 
 
@@ -2684,35 +2716,29 @@ DK: diatonisk skala,
 S: diatonisk skala,
 FI: diatoninen asteikko.
 
-A scale consisting of 5@w{ }whole tones and 2@w{ }semitones (S). Scales
+A scale consisting of 5@w{ }whole tones and 2@w{ }semitones (S).  Scales
 played on the white keys of a piano keybord are diatonic.  These scales
 are sometimes called, somewhat inaccurately, @q{church modes}).
 
 These @emph{modes} are used in Gregorian chant and in pre-baroque early music
 but also to some extent in newer jazz music.
 
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
-%\override Score.LyricText #'font-style = #'large
-%\override Score.TextScript #'font-style = #'large
+@lilypond[quote,notime,relative=1]
 <<
-  \context Staff \relative c' {
+  {
     c1 d
-    \override TextScript #'padding = #-4
     e^"~~ S" f g a b^"~~ S" c
   }
-  \context Lyrics \lyrics {
+  \lyrics {
     Ionian
   }
 >>
 @end lilypond
 
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,relative=1]
 <<
-  \context Staff \relative c' {
+  {
     d1
-    \override TextScript #'padding = #-4
     e^"~~ S" f g a b^"~~ S" c d
   }
   \lyrics {
@@ -2721,11 +2747,9 @@ but also to some extent in newer jazz music.
 >>
 @end lilypond
 
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,relative=1]
 <<
-  \relative c' {
-    \override TextScript #'padding = #-4
+  {
     e1^"~~ S" f g a b^"~~ S" c d e
   }
   \lyrics {
@@ -2734,12 +2758,10 @@ but also to some extent in newer jazz music.
 >>
 @end lilypond
 
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,relative=1]
 <<
-  \relative c' {
+  {
     f1 g a
-    \override TextScript #'padding = #-4
     b^"~~ S" c d e^"~~ S" f
   }
   \lyrics {
@@ -2748,27 +2770,22 @@ but also to some extent in newer jazz music.
 >>
 @end lilypond
 
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,relative=2]
 <<
-  \relative c'' {
+  {
     g1 a
-    \override TextScript #'padding = #-4
-    b^"~~ S" c d e^"~~ S" f g }
+    b^"~~ S" c d e^"~~ S" f g
+  }
   \lyrics {
     Mixolydian
   }
 >>
 @end lilypond
 
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
-%\override Score.LyricText #'font-style = #'large
-%\override Score.TextScript #'font-style = #'large
+@lilypond[quote,notime,relative=2]
 <<
-  \relative c'' {
+  {
     a1
-    \override TextScript #'padding = #-4
     b^"~~ S" c d e^"~~ S" f g a
   }
   \lyrics {
@@ -2777,13 +2794,9 @@ but also to some extent in newer jazz music.
 >>
 @end lilypond
 
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
-%\override Score.LyricText #'font-style = #'large
-%\override Score.TextScript #'font-style = #'large
+@lilypond[quote,notime,relative=2]
 <<
-  \relative c'' {
-    \override TextScript #'padding = #-4
+  {
     b1^"~~ S" c d e^"~~ S" f g a b
   }
   \lyrics {
@@ -2797,75 +2810,61 @@ compositional music are primarily the major and the minor scales.  In
 the harmonic minor scale type an augmented second (A) occurs between
 the 6th and 7th tone.
 
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,relative=1]
 <<
-  \relative c' {
+  {
     c1 d
-    \override TextScript #'padding = #-4
     e^"~~ S" f g a b^"~~ S" c
   }
- \lyrics {
 \lyrics {
     Major
   }
 >>
 @end lilypond
 
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,relative=2]
 <<
-  \relative c'' {
+  {
     a1
-    \override TextScript #'padding = #-4
     b^"~~ S" c d e^"~~ S" f g a
   }
- \lyrics {
 \lyrics {
     "Ancient (or Natural) minor"
   }
 >>
 @end lilypond
 
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,relative=2]
 <<
-  \relative c'' {
+  {
     a1
-    \override TextScript #'padding = #-4
     b^"~~ S" c d e^"~~ S" f!^"~~ A" gis^"~~ S" a
   }
-  \context Lyrics \lyrics {
+  \lyrics {
     "Harmonic minor"
   }
 >>
 @end lilypond
 
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
-%\override Score.LyricText #'font-style = #'large
-%\override Score.TextScript #'font-style = #'large
+@lilypond[quote,notime,relative=2]
 <<
-  \relative c'' {
+  {
     a1
-    \override TextScript #'padding = #-4
     b^"~~ S" c d e fis gis^"~~ S" a
   }
-   \lyrics {
+  \lyrics {
     "Melodic minor ascending"
   }
 >>
 @end lilypond
 
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
-%\override Score.LyricText #'font-style = #'large
-%\override Score.TextScript #'font-style = #'large
+@lilypond[quote,notime,relative=3]
 <<
-  \relative c'' {
-    a'1
-    \override TextScript #'padding = #-4
-    a g! f!^"~~ S" e d c^"~~ S" b a
+  {
+    a1
+    g! f!^"~~ S" e d c^"~~ S" b a
   }
-   \lyrics {
+  \lyrics {
     "Melodic minor descending"
   }
 >>
@@ -2969,13 +2968,13 @@ FI: melodian hyppivä liike.
 Progressing melodically by intervals larger than a major second, as contrasted
 with conjunct movement.
 
-@lilypond[fragment,ragged-right]
+@lilypond[quote,relative=1]
 \key a \major
 \time 4/4
-\relative c' {
-  \partial 8 e8 |
-  a4. gis8 b a e cis |
-  fis2 d4. \bar "||" }
+\partial 8 e8 |
+a4. gis8 b a e cis |
+fis2 d4.
+\bar "||"
 @end lilypond
 
 
@@ -3506,16 +3505,16 @@ FI: enharmoninen.
 Two notes, intervals, or scales are enharmonic if they have different
 names but equal pitch.
 
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,line-width=13.0\cm]
 <<
-\context Staff \relative c'' {
-  gis1  as <des g,!>  <cis g!> 
-}
-\context Lyrics \lyrics {
-  \override Lyrics .LyricText #'self-alignment-X = #-1
-  "g sharp  " "a flat  " "dim fifth  " "augm fourth"
-}
+  \new Staff {
+    \relative c'' {
+      gis1 as <des g,!> <cis g!>
+    }
+  }
+  \lyrics {
+    "g sharp  " "a flat  " "dim fifth  " "augm fourth"
+  }
 >>
 @end lilypond
 
@@ -3666,29 +3665,28 @@ played an octave higher (for example, bass recorder) while 8@w{ }below
 the clef symbol indicates playing an octave lower (for example, on the
 Double Bass).
 
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
-\override Staff.Clef #'full-size-change = ##t
+@lilypond[quote,notime,line-width=13.0\cm]
 <<
-\relative c {
-  \clef varbaritone
-  f1
-  \clef bass
-  f1
-  \clef subbass
-  f1
-  \clef "F^8"
-  f1
-  \clef "F_8"
-  f1
-}
- \lyrics {
-  "varbaritone  "
-  "bass  "
-  "sub-bass  "
-  "octave up  "
-  "octave down"
-}
+  \relative c {
+    \override Staff.Clef #'full-size-change = ##t
+    \clef varbaritone
+    f1
+    \clef bass
+    f1
+    \clef subbass
+    f1
+    \clef "F^8"
+    f1
+    \clef "F_8"
+    f1
+  }
+  \lyrics {
+    "varbaritone  "
+    "bass  "
+    "sub-bass  "
+    "octave up  "
+    "octave down"
+  }
 >>
 @end lilypond
 
@@ -3755,11 +3753,10 @@ FI: fermaatti, pidäke.
 
 Prolonged note or rest of indefinite duration.
 
-@lilypond[fragment,ragged-right]
+@lilypond[quote,relative=2]
 \time 4/4
-\relative c'' {
-  a4 b c2^\fermata \bar "|."
-}
+a4 b c2^\fermata
+\bar "|."
 @end lilypond
 
 
@@ -3802,30 +3799,37 @@ A method of indicating an accompaniment part by the bass notes only,
 together with figures designating the chief intervals and chords to be
 played above the bass notes.
 
-TODO: Make the upper clef smaller, since it's usually "realized" in performance.
-
-@lilypond[fragment,line-width=13.0\cm]
-\context GrandStaff <<
-  \context Staff = lh \relative c'' {
-    \time 4/4
-    \key es \major
+@lilypond[quote,line-width=13.0\cm]
+\new GrandStaff <<
+  \new Staff = "rh" \with {
+    fontSize = #-3
+    \override StaffSymbol #'staff-space = #(magstep -3)
+  } \relative c'' {
     \clef treble
-    << \context Voice = rha {
-        \stemUp
-        es4 d c bes | bes }
-      \context Voice = rhb {
-        \stemDown
-        < bes g >8 as < as f > g < g es > f < d f > es | < g es >4 }
+    \key es \major
+    \time 4/4
+    <<
+      \context Voice = "rha" {
+        \voiceOne
+        es4 d c bes
+        bes4
+      }
+      \context Voice = "rhb" {
+        \voiceTwo
+        <bes g>8 as <as f> g <g es> f <d f> es
+        <g es>4
+      }
     >>
   }
-  <<
-    \context Staff = rh \relative c' {
+  \new Staff = "lh" \relative c' {
     \clef bass
     \key es \major
-    es8 c d bes c as bes16 as g f | es4
-    }
-    \figures { s8 <6> s <4 2> s <6> s16 s <6> <4 2>  }
-  >>
+    es8 c d bes c as bes16 as g f
+    es4
+  }
+  \figures {
+    s8 <6> s <4 2> s <6> s16 s <6> <4 2>
+  }
 >>
 @end lilypond
 
@@ -3869,15 +3873,11 @@ FI: lippu, viiri.
 Ornament at the end of the stem of a note used for notes with values less
 than a quarter note.  The number of flags determines the note value.
 
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
-%\override Score.TextScript #'font-style = #'large
-\relative c'' {
-  g8_"8th" s8
-  g16_"16th" s8
-  g32_"32nd" s8
-  g64_"64th" s8
-}
+@lilypond[quote,notime,relative=2]
+g8-"8th" s8
+g16-"16th" s8
+g32-"32nd" s8
+g64-"64th" s8
 @end lilypond
 
 
@@ -4075,14 +4075,16 @@ chords.
 
 TODO: what does the @q{p} mean in Sp, Dp, Tp?
 
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,relative=2,line-width=13.0\cm]
 <<
-\context Voice \relative c'' {
-  <g e c >1 < a f d > < b g e >
-  <c a f > < d b g > < e c a > < f d b > }
-\context Lyrics \lyrics {
-  T Sp Dp S D Tp \markup{ D\translate #(cons -2 0) {"|"}  } }
+  {
+    <g e c>1 <a f d> <b g e>
+    <c a f> <d b g> <e c a> <f d b>
+  }
+  \lyrics {
+    T Sp Dp S D Tp
+    \markup { D \translate #'(-2 . 0) | }
+  }
 >>
 @end lilypond
 
@@ -4128,30 +4130,25 @@ must be played an octave higher while 8 below the clef symbol indicates
 playing or singing an octave lower (used most frequently to notate the tenor
 part in modern choral scores).
 
-@lilypond[fragment,notime,ragged-right]
-<<
-  \set Score.automaticBars = ##f
+@lilypond[quote,notime]
+\relative c'' {
   \override Staff.Clef #'full-size-change = ##t
-
-  \relative c'' {
-    \set Score.proportionalNotationDuration = #(ly:make-moment 1 8)
-    \clef french
-    g1
-    \clef treble
-    g
-    \clef "G^8"
-    g
-    \clef "G_8"
-    g
-  }
-  \context Lyrics \lyrics {
-    \override Lyrics . LyricText #'X-offset = #-5
-    "french violin clef"
-    "violin clef"
-    "octave up"
-    "octave down"
-  }
->>
+  \set Score.proportionalNotationDuration = #(ly:make-moment 1 8)
+  \clef french
+  g1
+  \clef treble
+  g1
+  \clef "G^8"
+  g1
+  \clef "G_8"
+  g1
+}
+\addlyrics {
+  "french violin clef"
+  "violin clef"
+  "octave up"
+  "octave down"
+}
 @end lilypond
 
 
@@ -4274,12 +4271,10 @@ usage.  In the standard usage of these countries, @notation{B} means
 Graphical version of the @notation{crescendo} and @notation{decrescendo}
 dynamic marks.
 
-@lilypond[fragment,ragged-right]
-\relative c'' {
-  c1\<
-  c2\> c\<
-  c1\!
-}
+@lilypond[quote,relative=2]
+c1\<
+c2\> c\<
+c1\!
 @end lilypond
 
 
@@ -4341,17 +4336,16 @@ FI: harmoninen kadenssi.
 
 A sequence of chords that terminates a musical phrase or section.
 
-@lilypond[fragment,ragged-right]
-\context PianoStaff <<
-  \context Staff = SA \relative c'' {
-    \time 4/4
+@lilypond[quote]
+\new PianoStaff <<
+  \context Staff = "SA" \relative c'' {
     \clef treble
-    \context Voice
-    \partial 4 < c g e >4 |
-    < c a f > < b g d > < c g e >2
+    \time 4/4
+    \partial 4 <c g e>4 |
+    <c a f> <b g d> <c g e>2
   }
   <<
-    \context Staff = SB \relative c {
+    \context Staff = "SB" \relative c {
       \clef bass
       \partial 4 c4 | f, g c2
       \bar "|."
@@ -4361,7 +4355,6 @@ A sequence of chords that terminates a musical phrase or section.
     }
   >>
 >>
-
 @end lilypond
 
 
@@ -4415,30 +4408,22 @@ categories @emph{consonances} and @emph{dissonances}.
 
 Consonances:
 
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
-%\override Score.TextScript #'font-style = #'large
-\context Voice \relative c'' {
-  <g g>1_"unison  " s
-  <g b>_"third  " s
-  <g c>_"fourth  " s
-  <g d'>_"fifth  " s
-  <g e'>_"sixth  " s
-  <g g'>_"octave  " s
-  <g b'>_"tenth" s s
-}
+@lilypond[quote,notime,relative=2,line-width=13.0\cm]
+<g g>1_"unison  " s
+<g b>_"third  " s
+<g c>_"fourth  " s
+<g d'>_"fifth  " s
+<g e'>_"sixth  " s
+<g g'>_"octave  " s
+<g b'>_"tenth" s s
 @end lilypond
 
 Dissonances:
 
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
-%\override Score.TextScript #'font-style = #'large
-\context Voice \relative c'' {
-  <g a>1_"second  " s s
-  <g f'>_"seventh  " s s
-  <g a'>_"ninth" s s
-}
+@lilypond[quote,notime,relative=2,line-width=13.0\cm]
+<g a>1_"second  " s s
+<g f'>_"seventh  " s s
+<g a'>_"ninth" s s
 @end lilypond
 
 For harmony that uses three or more notes, see @ref{chord}.
@@ -4470,20 +4455,22 @@ as a special effect (or @emph{affect}) at cadences.
 
 For example, this phrase in 6/4 time
 
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,relative=1,line-width=13.0\cm]
 \key c \major
 \time 6/4
-\relative c' {
-  c2. e | d2 c d | c1. \bar "||" }
+c2. e | d2 c d | c1. \bar "||"
 @end lilypond
 
 may be thought of having alternating time signatures
 
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,relative=1,line-width=13.0\cm]
 \key c \major
 \time 6/4
-\relative c' {
-  c2. e | \time 3/2 d2 c d | \time 6/4 c1. \bar "||" }
+c2. e
+\time 3/2
+d2 c d
+\time 6/4
+c1. \bar "||"
 @end lilypond
 
 and is therefore a polymeter (second definition) of considerable antiquity.
@@ -4572,63 +4559,60 @@ fifth are identical (or @emph{enharmonic}) and are called @emph{tritonus}
 because they consist of three whole tones.  The addition of such two
 intervals forms an octave.
 
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,line-width=13.0\cm]
 <<
-\context Voice \relative c'' {
-  < g g >1 
-  < g as >^"minor" 
-  < g a! > 
-  < g ais >^"augm" 
-  < gis bes >^"dimin" 
-  < g! bes >^"minor" 
-  < g b! >^"major" 
-  < g bis >^"augm" 
-}
-\context Lyrics \lyrics {
-  "unison " "second " "second " "second "
-  "third  " "third " "third " "third"
-}
+  \context Voice \relative c'' {
+    < g g >1
+    < g as >^"minor"
+    < g a! >
+    < g ais >^"augm"
+    < gis bes >^"dimin"
+    < g! bes >^"minor"
+    < g b! >^"major"
+    < g bis >^"augm"
+  }
+  \context Lyrics \lyrics {
+    "unison " "second " "second " "second "
+    "third  " "third " "third " "third"
+  }
 >>
 @end lilypond
 
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,line-width=13.0\cm]
 <<
-\context Staff \relative c'' {
-  < g c >1^"perfect" 
-  < g cis >^"aug" 
-  < g d' >^"perfect" 
-  < g des' > ^"dim" 
-  < gis es' >^"dim" 
-  < g! es' >^"minor" 
-  < g e'! >^"major" 
-  < g eis' >^"aug" 
-}
- \lyrics {
-  "fourth  " "fourth  " "fifth  " "fifth  "
-  "sixth  " "sixth  " "sixth  " "sixth"
-}
+  \context Staff \relative c'' {
+    <g c >1^"perfect"
+    <g cis>^"aug"
+    <g d'>^"perfect"
+    <g des'> ^"dim"
+    <gis es'>^"dim"
+    <g! es'>^"minor"
+    <g e'!>^"major"
+    <g eis'>^"aug"
+  }
  \lyrics {
+    "fourth  " "fourth  " "fifth  " "fifth  "
+    "sixth  " "sixth  " "sixth  " "sixth"
+  }
 >>
 @end lilypond
 
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,line-width=13.0\cm]
 <<
-\context Staff \relative c'' {
-  < gis f'! >1^"dimin" 
-  < g! f'! >^"minor" 
-  < g fis' >^"major" 
-  < g g' > 
-  < g as' >^"minor" 
-  < g a'! >^"major" 
-  < g bes' >^"minor" 
-  < g b'! >^"major" 
-}
-\context Lyrics \lyrics {
-  "seventh " "seventh " "seventh " "octave "
-  "ninth " "ninth " "tenth " "tenth"
-}
+  \context Staff \relative c'' {
+    <gis f'!>1^"dimin"
+    <g! f'!>^"minor"
+    <g fis'>^"major"
+    <g g'>
+    <g as'>^"minor"
+    <g a'!>^"major"
+    <g bes'>^"minor"
+    <g b'!>^"major"
+  }
+  \context Lyrics \lyrics {
+    "seventh " "seventh " "seventh " "octave "
+    "ninth " "ninth " "tenth " "tenth"
+  }
 >>
 @end lilypond
 
@@ -4694,14 +4678,10 @@ FI: käänteisintervalli.
 
 The difference between an interval and an octave.
 
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
-%\override Score.TextScript #'font-style = #'large
-\context Staff \relative c'' {
-  < g a >1_"second " s s < g' a, >_"seventh " s s \bar "||"
-  < g, b >_"third  " s s < g' b, >_"sixth  " s s \bar "||"
-  < g, c >_"fourth  " s s < g' c, >_"fifth  " s s \bar "||"
-}
+@lilypond[quote,notime,relative=2,line-width=13.0\cm]
+<g a>1_"second " s s <g' a,>_"seventh " s s \bar "||"
+<g, b>_"third  " s s <g' b,>_"sixth  " s s \bar "||"
+<g, c>_"fourth  " s s <g' c,>_"fifth  " s s \bar "||"
 @end lilypond
 
 
@@ -4840,9 +4820,10 @@ FI: apuviiva.
 
 A ledger line is an extension of the staff.
 
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
-\relative c'' { a,1 s c'' }
+@lilypond[quote,notime,relative=2]
+a,1
+s1
+c''1
 @end lilypond
 
 
@@ -4866,8 +4847,7 @@ To be performed (a) without any perceptible interruption between the
 notes, unlike (b) @notation{leggiero} or @notation{non-legato}, (c)
 @notation{portato}, or (d) @notation{staccato}.
 
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,line-width=13.0\cm]
 <<
   \context Staff \relative c'' {
     c4-( d e-) \bar "||"
@@ -5024,12 +5004,9 @@ FI: pitkä appoggiatura, pitkä etuhele.
 
 Note value: double length of @notation{breve}.
 
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
-\relative c'' {
-  \override NoteHead #'style = #'mensural
-  g\longa g\breve
-}
+@lilypond[quote,notime,relative=2]
+\override NoteHead #'style = #'mensural
+g\longa g\breve
 @end lilypond
 
 
@@ -5357,7 +5334,7 @@ beat on each quarter note is conventionally written with a time signature of
 
 Simple duple meter (F.J. Haydn, 1732-1809; or a Croatian folk tune):
 
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,line-width=13.0\cm]
 \relative c'' {
   \time 2/4
   \key g \major
@@ -5366,7 +5343,7 @@ Simple duple meter (F.J. Haydn, 1732-1809; or a Croatian folk tune):
 
 Simple triple meter:
 
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,line-width=13.0\cm]
 \relative c'' {
   \time 3/4
   \key c \minor
@@ -5375,7 +5352,7 @@ Simple triple meter:
 
 Simple quadruple meter (French folk tune, @emph{Au clair de la lune}):
 
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,line-width=13.0\cm]
 \relative c'' {
   \time 4/4
   \key g \major
@@ -5384,7 +5361,7 @@ Simple quadruple meter (French folk tune, @emph{Au clair de la lune}):
 
 Simple quintuple meter (B. Marcello, 1686-1739):
 
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,line-width=13.0\cm]
 \relative c'' {
   \time 5/4
   \key c \major
@@ -5399,7 +5376,7 @@ the source, with sharps in the accompaniment where the voice has flats and
 
 Compound duple meter (unknown):
 
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,line-width=13.0\cm]
 \relative c' {
   \time 6/8
   \key f \major
@@ -5410,7 +5387,7 @@ Compound duple meter (unknown):
 
 Compound triple meter (J.S. Bach, 1685-1750):
 
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,line-width=13.0\cm]
 \relative c' {
   \time 9/8
   \key g \major
@@ -5421,7 +5398,7 @@ Compound triple meter (J.S. Bach, 1685-1750):
 
 Compound quadruple meter (P. Yon, 1886-1943):
 
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,line-width=13.0\cm]
 \relative c' {
   \time 12/8
   \key e \major
@@ -5565,14 +5542,11 @@ FI: keski-C.
 
 First C below the 440 Hz A.
 
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,relative=1]
 \override Staff.Clef #'full-size-change = ##t
-\relative c' {
-  \clef bass c1 s
-  \clef alto c s
-  \clef treble c s
-}
+\clef bass c1 s
+\clef alto c s
+\clef treble c s
 @end lilypond
 
 
@@ -5699,7 +5673,7 @@ FI: teema, sävelaihe.
 The briefest intelligible and self-contained fragment of a musical
 theme or subject.
 
-@lilypond[line-width=13.0\cm]
+@lilypond[quote,line-width=13.0\cm]
 \score{
 \relative c'' {
   \set Score.implicitTimeSignatureVisibility = #all-invisible
@@ -5735,7 +5709,7 @@ S: sats,
 FI: osa.
 
 Greater musical works like @ref{symphony} and @ref{sonata} most often
-consist of several -- more or less -- independant pieces called
+consist of several -- more or less -- independent pieces called
 movements.
 
 
@@ -5761,14 +5735,14 @@ longer spans of rest, with a number above to indicate the duration (in
 measures) of the rest. The former style is called @q{Kirchenpausen} in
 German, as a reminiscence of its use in Renaissance vocal polyphony.
 
-@lilypond[fragment,ragged-right]
-\relative c'' {
-  a1
-  \set Score.skipBars = ##t R1*3
-  a1
-  \set Score.skipBars = ##t R1*122
-  a1
-}
+@lilypond[quote,relative=2]
+a1
+\set Score.skipBars = ##t
+R1*3
+a1
+\set Score.skipBars = ##t
+R1*122
+a1
 @end lilypond
 
 
@@ -5901,9 +5875,7 @@ double-length note value @emph{longa} or the quadruple-length note value
 
 @c TODO -- add maxima to this example, in a way that doesn't break it.
 
-@lilypond[fragment,notime,line-width=13.0\cm]
-%\override Score.TextScript #'font-style = #'large
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,line-width=13.0\cm]
 \relative c'' {
   \override NoteHead #'style = #'mensural
   a\longa_"longa" a\breve_"breve"
@@ -5914,9 +5886,7 @@ double-length note value @emph{longa} or the quadruple-length note value
 
 @c TODO -- add maxima rest to this example
 
-@lilypond[fragment,notime,line-width=13.0\cm]
-%\override Score.TextScript #'font-style = #'large
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,line-width=13.0\cm]
 \relative c'' {
   r\longa_"longa" r\breve_"breve"
   r1_"1/1" r2_"1/2" r4_"1/4" s16 r8_"1/8" s16
@@ -5926,8 +5896,7 @@ double-length note value @emph{longa} or the quadruple-length note value
 An augmentation dot after a note multiplies the duration by one and a
 half.  Another dot adds yet a fourth of the duration.
 
-@lilypond[fragment,line-width=13.0\cm]
-%\override Score.TextScript #'font-style = #'large
+@lilypond[quote,line-width=13.0\cm]
 \relative c'' {
   \time 4/4
   g4._"pointed" g8 g2 | g4 ~ g8 g g2 \bar "||"
@@ -5939,8 +5908,7 @@ subdivision by@w{ }3 (@emph{triplets}) and@w{ }5 (@emph{quintuplets}).
 Subdivisions by@w{ }2 (@emph{duplets}) or@w{ }4 (@emph{quadruplets}) of
 dotted notes are also frequently used.
 
-@lilypond[fragment,line-width=13.0\cm]
-%\override Score.TextScript #'font-style = #'large
+@lilypond[quote,line-width=13.0\cm]
 \relative c'' {
   \time 4/4
   \times 2/3 {g8_"triplets" g g} g4 g8 g g4 \bar "||"
@@ -5948,7 +5916,7 @@ dotted notes are also frequently used.
 }
 @end lilypond
 
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,line-width=13.0\cm]
 \relative c'' {
   \time 3/4
   \times 3/2 {g4_"duplets" g} |
@@ -6100,10 +6068,9 @@ middle of the 19th century and onwards the trill is performed with the main
 note first while in the music from the preceding baroque and classic periods
 the upper note is played first.
 
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,line-width=13.0\cm]
 <<
   \context Staff = sa {
-% \override Score.TextScript #'font-style = #'large
     \relative c'' {
       c2._"pre-1850" b4\trill | c1 \bar "||"
       c2._"post-1850" b4\trill | c1 \bar "||"
@@ -6120,10 +6087,9 @@ Other frequently used ornaments are the @emph{turn}, the @emph{mordent}, and
 the
 @emph{prall} (inverted mordent).
 
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,line-width=13.0\cm]
 <<
   \context Staff = sa {
-% \override Score.TextScript #'font-style = #'large
     \relative c'' {
       a4_"turn" b\turn c2 \bar "||"
       g4_"mordent" a b\mordent a \bar "||"
@@ -6224,13 +6190,11 @@ pattern to one or more measures.  There are other names for this symbol:
 
 @end itemize
 
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,relative=2,line-width=13.0\cm]
 \time 4/4
-\relative c' {
-  \repeat percent 4 { c4_"Beat (or slash) repeat" }
-  \repeat percent 2 { c4 e g b_"Measure repeat" }
-  \repeat percent 2 { c,2 es | f4 fis g c_"Multi-measure repeat" | }
-}
+\repeat percent 4 { c4_"Beat (or slash) repeat" }
+\repeat percent 2 { c4 e g b_"Measure repeat" }
+\repeat percent 2 { c,2 es | f4 fis g c_"Multi-measure repeat" | }
 @end lilypond
 
 
@@ -6833,23 +6797,16 @@ FI: rinnakkaissävellaji.
 
 Major and minor keys that have the same key signature.
 
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
-%\override Score.TextScript #'font-style = #'large
-\relative c' {
-  \key es \major
-  es1_"e flat major" f g as bes c d es
-  \bar "||"
-}
+@lilypond[quote,notime,relative=1,line-width=13.0\cm]
+\key es \major
+es1_"e flat major" f g as bes c d es
+\bar "||"
 @end lilypond
 
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
-%\override Score.TextScript #'font-style = #'large
-\relative c' {
-  \key c \minor
-  c1_"c minor" d es f g a! b! c \bar "||"
-}
+@lilypond[quote,notime,relative=1,line-width=13.0\cm]
+\key c \minor
+c1_"c minor" d es f g a! b! c
+\bar "||"
 @end lilypond
 
 
@@ -6869,11 +6826,14 @@ DK: gen@-ta@-gel@-se,
 S: repris,
 FI: toisto.
 
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,relative=2,line-width=13.0\cm]
 \key g \major
 \time 4/4
-\relative c'' {
-  \repeat volta 2 {g4 g d' d | e e d2 | c4 c b b | a a g2 }
+\repeat volta 2 {
+  g4 g d' d
+  e4 e d2
+  c4 c b b
+  a a g2
 }
 @end lilypond
 
@@ -7006,10 +6966,9 @@ Names and symbols used in harmonic analysis to denote tones of the
 scale as roots of chords.  The most important are degrees I = tonic
 (T), IV = sub@-do@-mi@-nant (S) and V = dominant (D).
 
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,line-width=13.0\cm]
 <<
-\context Staff \relative c' {
+\new Staff \relative c' {
   c1 d e f g a b c
 }
  \lyrics {
@@ -7098,9 +7057,9 @@ DK: sekund,
 S: sekund,
 FI: sekunti.
 
-The @ref{interval} between two neigbouring tones of a scale.  A
+The @ref{interval} between two neighboring tones of a scale.  A
 @ref{diatonic scale} consists of alternating @ref{semitone}s and
-@ref{whole tone}s, hence the size of a se@-cond depends on the scale
+@ref{whole tone}s, hence the size of a second depends on the scale
 degrees in question.
 
 
@@ -7125,9 +7084,8 @@ composed music.  The interval between two neighbouring tones on the piano
 keyboard -- including black and white keys -- is a semitone.  An octave may
 be divided into 12@w{ }semitones.
 
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
-\relative c'' { g1 gis s a bes s b! c }
+@lilypond[quote,notime,relative=2,line-width=13.0\cm]
+g1 gis s a bes s b! c
 @end lilypond
 
 
@@ -7486,14 +7444,13 @@ FI: staccato, lyhyesti, terävästi.
 Playing the note(s) short.  Staccato is indicated by a dot above or
 below the note head.
 
-@lilypond[fragment,ragged-right]
+@lilypond[quote,relative=2]
 \key d \major
 \time 4/4
-\relative c'' {
-  \partial 8 a8 |
-  d4-\staccato cis-\staccato b-\staccato cis-\staccato |
-  d2. \bar "||"
-}
+\partial 8 a8 |
+d4-\staccato cis-\staccato b-\staccato cis-\staccato |
+d2.
+\bar "||"
 @end lilypond
 
 
@@ -7504,6 +7461,7 @@ None yet.
 @node staff
 @section staff
 
+UK: stave,
 ES: pentagrama,
 I: pentagramma, rigo (musicale),
 F: portée,
@@ -7546,23 +7504,17 @@ FI: nuottipalkki.
 Vertical line above or below a @ref{note head} shorter than a
 whole note.
 
-@ref{beam}.
-
-@lilypond[fragment,notime,line-width=13.0\cm]
+@lilypond[quote,notime,relative=2]
 \set Score.autoBeaming = ##f
-\set Score.automaticBars = ##f
-%\override Score.TextScript #'font-style = #'large
-\relative c'' {
-  g2_"1/2" g' s16
-  g,4_"1/4" g' s16
-  g,8_"1/8" g' s16
-  g,16_"1/16" g' s16
-}
+g2_"1/2" g' s16
+g,4_"1/4" g' s16
+g,8_"1/8" g' s16
+g,16_"1/16" g' s16
 @end lilypond
 
 
 @seealso
-None yet.
+@ref{beam}.
 
 
 @node stringendo
@@ -7778,13 +7730,11 @@ group.  Any deviation from this scheme is felt as a disturbance or
 contradiction between the underlaying (normal) pulse and the actual
 (abnormal) rhythm.
 
-@lilypond[fragment,ragged-right]
-\time 4/4
-\relative c' {
-  \partial 4
-  d8 dis |
-  e c'4 e,8 c'4 e,8 c' ( | c2)
-}
+@lilypond[quote,relative=1]
+\time 2/4
+\partial 8 d16 dis
+e16 c'8 e,16 c'8 e,16 c' ~
+c4
 @end lilypond
 
 
@@ -8020,9 +7970,8 @@ connects two succesive notes of the same pitch, and which has the
 function of uniting them into a single sound (tone) equal to the
 combined durations.
 
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
-\relative c'' { g2 ~ g4. }
+@lilypond[quote,notime,relative=2]
+g2 ~ g4. r8
 @end lilypond
 
 
@@ -8149,7 +8098,7 @@ FI: transponointi.
 Shifting a melody up or down in pitch, while keeping the same
 relative pitches.
 
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,line-width=13.0\cm]
 \context Staff {
   \time 3/4
   \relative c'' {
@@ -8159,7 +8108,7 @@ relative pitches.
 }
 @end lilypond
 
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,line-width=13.0\cm]
 \context Staff {
   \time 3/4
   \transpose c bes \relative c'' {
@@ -8215,14 +8164,10 @@ in the distance of a third (@ref{interval}).
 
 @end enumerate
 
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
-%\override Score.TextScript #'font-style = #'large
-\relative c' {
-  e2:32_"a"
-  f:32 [ e8:16 f:16 g:16 a:16 ] s4
-  \repeat tremolo 8 { e32_"b" g }
-}
+@lilypond[quote,notime,relative=1]
+e2:32_"a"
+f:32 [ e8:16 f:16 g:16 a:16 ] s4
+\repeat tremolo 8 { e32_"b" g }
 @end lilypond
 
 
index 3ed353c257fb775f10f48767e5c3cc6bb441a2cb..24a488f31e2084ca39343b0adf94e19938d1619d 100644 (file)
@@ -3431,12 +3431,14 @@ second (with the stencil removed) does not.
 Override commands are often long and tedious to type, and they
 have to be absolutely correct.  If the same overrides are to be
 used many times it may be worth defining variables to hold them.
+
 Suppose we wish to emphasize certain words in lyrics by printing
 them in bold italics.  The @code{\italic} and @code{\bold}
-commands only work within lyrics if they are also embedded in
-@code{\markup}, which makes them tedious to enter, so as an
-alternative can we instead use the @code{\override} and
-@code{\revert} commands?
+commands only work within lyrics if they are embedded, together with
+the word or words to be modified, within a @code{\markup} block,
+which makes them tedious to enter.  The need to embed the words
+themselves prevents their use in simple variables.  As an
+alternative can we use @code{\override} and @code{\revert} commands?
 
 @example
 @code{\override Lyrics . LyricText #'font-shape = #'italic}
@@ -3447,10 +3449,13 @@ alternative can we instead use the @code{\override} and
 @end example
 
 These would also be extremely tedious to enter if there were many
-words requiring emphasis.  So instead we define these as two
-variables, and use them as follows, although normally we would
-perhaps choose shorter names for the variables to make them
-quicker to type:
+words requiring emphasis.  But we @emph{can} define these as two
+variables and use those to bracket the words to be emphasized.
+Another advantage of using variables for these overrides is that
+the spaces around the dot are not necessary, since they are not
+being interpreted in @code{\lyricmode} directly.  Here's an example
+of this, although in practice  we would choose shorter names
+for the variables to make them quicker to type:
 
 @cindex LyricText, example of overriding
 @cindex font-shape property, example
@@ -3458,12 +3463,12 @@ quicker to type:
 
 @lilypond[quote,verbatim]
 emphasize = {
-  \override Lyrics . LyricText #'font-shape = #'italic
-  \override Lyrics . LyricText #'font-series = #'bold
+  \override Lyrics.LyricText #'font-shape = #'italic
+  \override Lyrics.LyricText #'font-series = #'bold
 }
 normal = {
-  \revert Lyrics . LyricText #'font-shape
-  \revert Lyrics . LyricText #'font-series
+  \revert Lyrics.LyricText #'font-shape
+  \revert Lyrics.LyricText #'font-series
 }
 
 global = { \time 4/4 \partial 4 \key c \major}
index c53c28a90cd882a1d3aca6b178fd96f91bec61cc..69d0a94279f63a5eb9d1db7713fbbf6d27a74380 100644 (file)
@@ -5,6 +5,13 @@
 \header {
   lsrtags = "text"
 
+  texidoces = "
+Los textos independientes se pueden disponer en varias columnas
+utilizando instrucciones @code{\\markup}:
+
+"
+  doctitlees = "Elemento de marcado de texto independiente en dos columnas"
+
   texidoc = "
 Stand-alone text may be arranged in several columns using
 @code{\\markup} commands:
index 29d8156938d8e01e60da024f07268858fb51c793..bce7980715660df1dd377a305293964a6e04808e 100644 (file)
@@ -1,44 +1,19 @@
-%% Do not edit this file; it is auto-generated from LSR http://lsr.dsi.unimi.it
+%% Do not edit this file; it is auto-generated from input/new
 %% This file is in the public domain.
-\version "2.11.64"
-
+\version "2.11.65"
 \header {
   lsrtags = "staff-notation"
-
   texidoc = "
 'Tick' bar lines are often used in music where the bar line is used
 only for coordination and is not meant to imply any rhythmic stress.
-
-This snippet uses overrides for the @code{'bar-size} and
-@code{'extra-offset} properties of @code{BarLine} to determine,
-respectively, the tick size and its vertical placement.
-
 "
   doctitle = "Tick bar lines"
 } % begin verbatim
 
-{
-  % Use 'bar-size to control the height of the tick,
-  % and 'extra-offset to determine its position.
-  %
-  % With 'extra-offset set to zero, the tick will be
-  % centered around the middle line of the staff.
-  %
-  % Replace Staff.BarLine with Score.BarLine to
-  % apply the method to the whole score.
-  
-  \override Staff.BarLine #'bar-size = #1
-  \override Staff.BarLine #'extra-offset = #'(0 . 2)
-  
-  c'4 d' e' f'
-  g'4 f' e' d'
-  c'4 d' e' f'
-  g'4 f' e' d'
-  
-  % Revert the overrides to get back a normal
-  % bar line at the end.
-  
-  \revert Staff.BarLine #'bar-size
-  \revert Staff.BarLine #'extra-offset
+\relative c' {
+  c4 d e f \bar "'"
+  g4 f e d \bar "'" 
+  c4 d e f \bar "'"
+  g4 f e d
   \bar "|."
 }
diff --git a/input/new/tick-bar-lines.ly b/input/new/tick-bar-lines.ly
new file mode 100644 (file)
index 0000000..8493fa5
--- /dev/null
@@ -0,0 +1,16 @@
+\version "2.11.65"
+\header {
+  lsrtags = "staff-notation"
+  texidoc = "
+'Tick' bar lines are often used in music where the bar line is used
+only for coordination and is not meant to imply any rhythmic stress.
+"
+  doctitle = "Tick bar lines"
+}
+\relative c' {
+  c4 d e f \bar "'"
+  g4 f e d \bar "'" 
+  c4 d e f \bar "'"
+  g4 f e d
+  \bar "|."
+}
diff --git a/input/regression/bar-line-tick.ly b/input/regression/bar-line-tick.ly
new file mode 100644 (file)
index 0000000..9ddf246
--- /dev/null
@@ -0,0 +1,16 @@
+
+\header { texidoc = "A ticked bar line is a short line of the same length as a
+  staff space, centered on the top-most barline." }
+
+\version "2.11.65"
+
+\paper {  ragged-right = ##t }
+
+\relative \new StaffGroup <<
+  \new Staff {
+    c4 \bar "'" c }
+  \new Staff {
+     c c
+  }
+>>
+
diff --git a/input/regression/flags-straight-stockhausen-boulez.ly b/input/regression/flags-straight-stockhausen-boulez.ly
new file mode 100644 (file)
index 0000000..bf164a9
--- /dev/null
@@ -0,0 +1,30 @@
+\version "2.11.49"
+
+stemLength = #(define-music-function (parser location length) (number?)
+  "Set the length of the next stem explicitly."
+  #{
+    \once \override Stem #'length-fraction = #$length
+  #}
+)
+
+{
+    \autoBeamOff
+    \time 3/8
+    \override Stem #'flag = #modern-straight-flag
+    \override Stem #'length-fraction = #'1.5
+    r8
+    \acciaccatura {
+         \stemDown
+         \slurUp
+         \stemLength #1
+         gis''8
+         \stemNeutral
+       } \stemLength #1.43 d'8 r16 
+       \stemLength #0.95
+       \acciaccatura c''8 
+       \stemLength #1.25
+       b'32 r
+    \bar"|.|"
+    \stemLength #1.25
+    <g! cis'>16 \stemLength #1.3 <f'! g''!>8
+}
\ No newline at end of file
diff --git a/input/regression/flags-straight.ly b/input/regression/flags-straight.ly
new file mode 100644 (file)
index 0000000..6f35966
--- /dev/null
@@ -0,0 +1,30 @@
+\version "2.11.57"
+
+\header {
+  texidoc = "Straight flag styles."
+}
+
+
+% test notes, which will be shown in different styles:
+testnotes = { \autoBeamOff c'8 d'16 c'32 d'64 \acciaccatura {c'8} d'64 
+   c''8 d''16 c''32 d''64 \acciaccatura {\stemDown c''8 \stemNeutral} d''64  }
+
+{
+  \override Score.RehearsalMark #'self-alignment-X = #LEFT
+  \time 2/4
+  \mark "modern straight"
+  \override Stem #'flag = #modern-straight-flag
+  \testnotes
+
+  \mark "old straight (large angles)"
+  \override Stem #'flag = #old-straight-flag
+  \testnotes
+%
+%   \mark "custom slant"
+% %   Custom straight flag. The parameters are: 
+% %                flag thickness and spacing
+% %                up-flag angle and length
+% %               down-flag angle and length
+%   \override Stem #'flag = #(straight-flag 0.35 0.8 -5 0.5 60 2.0)
+%   \testnotes
+}
index b7aa3a00d10483f39f7f37cf091063467994660d..e1543776700b6538403da9b22a0be527ddff3aeb 100644 (file)
@@ -5,7 +5,7 @@
 }
 
 <<
-  \chords {a2 a c c  d}
+  \chords {a2 a c c c d}
   
   \new Voice =mel {
     \textLengthOn
                                      (place-fret 2 5 4)
                                      (place-fret 1 3 1)
                                      (barre 5 1 3)) }}
-    %% simple D chord
+
+      
+      %% C major for guitar, with capo on third fret
+       % verbose style
+    c' ^\markup 
+    \override #'(size . 1.1) { % 110% of default size
+       \override #'(fret-diagram-details . (
+                    (dot-label-font-mag . 0.9)
+                    (finger-code . in-dot)
+                    (xo-font-magnification . 0.4)
+                    (xo-padding . 0.3))) {
+           \fret-diagram-verbose #'((mute 6)
+                                     (capo 3)
+                                     (open 5) 
+                                     (place-fret 4 5 1)
+                                     (place-fret 3 5 2)
+                                     (place-fret 2 5 3)
+                                     (open 1)) }}
+
+      %% simple D chord
 
     d' ^\markup 
         \override #'(fret-diagram-details . (
index 379eb8f6a77fc35c65ccdabb0e5ef630d6ab2702..078b4c33cbd468e38de43ac37aa28dcc67202b18 100644 (file)
@@ -1,17 +1,17 @@
 % add a chord shape
-\version "2.11.56"
+\version "2.11.65"
 
-\addChordShape #'bes #"x;1-1-(;3-2;3-3;3-4;1-1-);"
+\addChordShape #'bes #guitar-tuning #"x;1-1-(;3-2;3-3;3-4;1-1-);"
 
 % add chords
 
 \storePredefinedDiagram \chordmode {bes}
                         #guitar-tuning
-                        #(chord-shape 'bes)
+                        #(chord-shape 'bes guitar-tuning)
 
 \storePredefinedDiagram \chordmode {c}
                         #guitar-tuning
-                        #(offset-fret 2 (chord-shape 'bes))
+                        #(offset-fret 2 (chord-shape 'bes guitar-tuning))
 
 mychords = \chordmode {
   bes
index df97638dba6b9faa9f43e95d1780454e35d0a5c7..18ad550e9209e0e3b8f5ad026f324ffd4d6c099a 100644 (file)
@@ -198,6 +198,10 @@ Bar_line::compound_barline (Grob *me, string str, Real h,
     {
       m = dashed_bar_line (me, h, hair);
     }
+  else if (str == "'")
+    {
+      m = tick_bar_line (me, hair, h, rounded);
+    }
   else if (str == ".")
     {
       m = dot;
@@ -222,6 +226,22 @@ Bar_line::simple_barline (Grob *me,
                                        Interval (-h / 2, h / 2)), blot);
 }
 
+Stencil
+Bar_line::tick_bar_line (Grob *me, Real w, Real h, bool rounded)
+{
+  Real th = Staff_symbol_referencer::staff_space (me) / 2;
+  Real line_thick = Staff_symbol_referencer::line_thickness (me);
+
+  Real blot
+    = rounded
+    ? me->layout ()->get_dimension (ly_symbol2scm ("blot-diameter"))
+    : 0.0;
+
+  return Lookup::round_filled_box (Box (Interval (0, line_thick),
+                                        Interval (h / 2 - th, h / 2 + th)), blot);
+}
+
+
 MAKE_SCHEME_CALLBACK (Bar_line, calc_bar_size, 1);
 SCM
 Bar_line::calc_bar_size (SCM smob)
index a6585084b6ed566c6c1b2211c8b007b3997d2630..43db11e9c9e0df074f65fc9222e94b414fa9d7b8 100644 (file)
@@ -16,6 +16,7 @@ public:
   DECLARE_GROB_INTERFACE();
 
   static Stencil dashed_bar_line (Grob *me, Real h, Real thick);
+  static Stencil tick_bar_line (Grob *me, Real w, Real h, bool rounded);
   static Stencil compound_barline (Grob *, string, Real height, bool rounded);
   static Stencil simple_barline (Grob *, Real wid, Real height, bool rounded);
   static Interval bar_y_extent (Grob *, Grob *);
index 1294dd144cde89dc3c26aadf9391dbd030e0e03d..9087fd7c177c4a4fb1dfebe231e6a2ce54544cc1 100644 (file)
@@ -58,10 +58,10 @@ public:
 protected:
   void classic_output_aux (SCM output,
                           int *first_performance_number);
-  void output_aux (SCM output_channel,
-                  bool is_last,
-                  int *first_page_number,
-                  int *first_performance_number);
+  int output_aux (SCM output_channel,
+                 bool is_last,
+                 int *first_page_number,
+                 int *first_performance_number);
 };
 
 DECLARE_UNSMOB (Paper_book, paper_book)
index 314f52ec8f578e3d44842774f3611bdb13139a3a..cc2e2b90f1f530fe7ae14e077077d1381380c145 100644 (file)
@@ -48,6 +48,7 @@ public:
   static Moment when_mom (Grob *);
   static bool is_used (Grob *);
   static bool is_breakable (Grob *);
+  static bool is_extraneous_column_from_ligature (Grob *);
   static Real minimum_distance (Grob *l, Grob *r);
   static Interval break_align_width (Grob *me);
 };
index 5f9d60c5768ae40c916a1a14e832b784be66dc90..ea4424c86e777e9119f037cbb6882580a90949bc 100644 (file)
@@ -108,12 +108,13 @@ Paper_book::add_performance (SCM s)
   performances_ = scm_cons (s, performances_);
 }
 
-void
+int
 Paper_book::output_aux (SCM output_channel,
                        bool is_last,
                        int *first_page_number,
                        int *first_performance_number)
 {
+  int page_nb = 0;
   if (scm_is_pair (performances_))
     {
       SCM proc = ly_lily_module_constant ("write-performances-midis");
@@ -131,23 +132,25 @@ Paper_book::output_aux (SCM output_channel,
        if (Paper_book *pbookpart = unsmob_paper_book (scm_car (p)))
          {
            bool is_last_part = (is_last && !scm_is_pair (scm_cdr (p)));
-           pbookpart->output_aux (output_channel,
-                                  is_last_part,
-                                  first_page_number,
-                                  first_performance_number);
+           page_nb += pbookpart->output_aux (output_channel,
+                                             is_last_part,
+                                             first_page_number,
+                                             first_performance_number);
          }
     }
   else
     {
       if (scores_ == SCM_EOL)
-       return;
+       return 0;
       paper_->set_variable (ly_symbol2scm ("first-page-number"),
                            scm_long2num (*first_page_number));
       paper_->set_variable (ly_symbol2scm ("is-last-bookpart"),
                            ly_bool2scm (is_last));
       /* Generate all stencils to trigger font loads.  */
-      *first_page_number += scm_ilength (pages ());
+      page_nb = scm_ilength (pages ());
+      *first_page_number += page_nb;
     }
+  return page_nb;
 }
 
 void
@@ -155,11 +158,12 @@ Paper_book::output (SCM output_channel)
 {
   int first_page_number = robust_scm2int (paper_->c_variable ("first-page-number"), 1);
   int first_performance_number = 0;
-  output_aux (output_channel,
-             true,
-             &first_page_number,
-             &first_performance_number);
-
+  if (!output_aux (output_channel,
+                  true,
+                  &first_page_number,
+                  &first_performance_number))
+    return;
+      
   SCM scopes = SCM_EOL;
   if (ly_is_module (header_))
     scopes = scm_cons (header_, scopes);
@@ -581,7 +585,7 @@ Paper_book::pages ()
        if (Paper_book *pbookpart = unsmob_paper_book (scm_car (p)))
          pages_ = scm_append_x (scm_list_2 (pages_, pbookpart->pages ()));
     }
-  else
+  else if (scm_is_pair (scores_))
     {
       SCM proc = paper_->c_variable ("page-breaking-wrapper");
       pages_ = scm_apply_0 (proc, scm_list_1 (self_scm ()));
index b30c7de32fec89688d4e0d5e2b0893bca07bc73c..c6b7c9c85c1aec0f9f5f9957937bd2b785f6b495 100644 (file)
@@ -18,6 +18,7 @@
 #include "output-def.hh"
 #include "paper-score.hh"
 #include "pointer-group-interface.hh"
+#include "rhythmic-head.hh"
 #include "separation-item.hh"
 #include "skyline-pair.hh"
 #include "spaceable-grob.hh"
@@ -313,6 +314,33 @@ Paper_column::before_line_breaking (SCM grob)
   return SCM_UNSPECIFIED;
 }
 
+/* FIXME: This is a hack that we use to identify columns that used to
+   contain note-heads but whose note-heads were moved by one of the ligature
+   engravers. Once the ligature engravers are fixed to behave nicely, this
+   function can be removed.
+*/
+bool
+Paper_column::is_extraneous_column_from_ligature (Grob *me)
+{
+  if (!is_musical (me))
+    return false;
+
+  // If all the note-heads that I think are my children actually belong
+  // to another column, then I am extraneous.
+  extract_grob_set (me, "elements", elts);
+  bool has_notehead = false;
+  for (vsize i = 0; i < elts.size (); i++)
+    {
+      if (Rhythmic_head::has_interface (elts[i]))
+       {
+         has_notehead = true;
+         if (dynamic_cast<Item*> (elts[i])->get_column () == me)
+           return false;
+       }
+    }
+  return has_notehead;
+}
+
 
 ADD_INTERFACE (Paper_column,
               "@code{Paper_column} objects form the top-most X@tie{}parents"
index 2483bac0d67a6bbbd07ffdbde5b3e10a78b308f0..4a9eec3ea6291915d455a046a39792fccf69d0b0 100644 (file)
@@ -146,7 +146,7 @@ Separation_item::boxes (Grob *me, Grob *left)
       y[UP] += extra_height[UP];
  
       if (!x.is_empty () && !y.is_empty ())
-      out.push_back (Box (x, y));
+       out.push_back (Box (x, y));
     }
 
   return out;      
index 4a6d0b05156dd602f7bcefde0261f539f00ad0aa..be0cd01a450883c1d3bb3dbe6e6a3226f8780c49 100644 (file)
@@ -405,8 +405,20 @@ Spacing_spanner::musical_column_spacing (Grob *me,
        Note that we don't actually pack things as tightly as possible:
        we don't allow the next column to begin before this one ends.
       */
-      spring.set_distance (max (left_col->extent (left_col, X_AXIS)[RIGHT],
-                               spring.min_distance ()));
+      /* FIXME: the else clause below is the "right" thing to do,
+        but we can't do it because of all the empty columns that the
+        ligature-engravers leave lying around. In that case, the extent of
+        the column is incorrect because it includes note-heads that aren't
+        there. We get around this by only including the column extent if
+        the left-hand column is "genuine". This is a dirty hack and it
+        should be fixed in the ligature-engravers. --jneem
+      */
+      if (Paper_column::is_extraneous_column_from_ligature (left_col))
+       spring.set_distance (spring.min_distance ());
+      else
+       spring.set_distance (max (left_col->extent (left_col, X_AXIS)[RIGHT],
+                                 spring.min_distance ()));
+
       spring.set_inverse_stretch_strength (1.0);
     }
 
index 08a04e3cffc6d9b538f2c627703c47a6ec19c141..31d91b1fc7502bcf79d0a269a5ca90423b0d12b5 100644 (file)
@@ -190,6 +190,8 @@ Span_bar::calc_glyph_name (SCM smob)
     type = "|.|";
   else if (type == ":|.:")
     type = "|.";
+  else if (type == "'")
+    type = "";
 
   return ly_string2scm (type);
 }
index 2e2f46ecb62891f46391d0727acb80923a870127..20fbce4523414da65cab0a89f5bf7c6c59b3048f 100644 (file)
@@ -64,6 +64,7 @@ escapedSmallerSymbol = #(make-span-event 'CrescendoEvent START)
 
 
 #(define fretboard-table (make-hash-table 100))
+#(define chord-shape-table (make-hash-table 100))
 
 \include "scale-definitions-init.ly"
 
index e999c93a4d38a0792e8156c23b91dbb97ddfa298..a5d62e1a6604203a4e30e5a41f5c2235053be135 100644 (file)
@@ -4,50 +4,50 @@
 %%%%
 %%%% (c) 2008 Carl D. Sorensen <c_sorensen@byu.edu>
 
-\version "2.11.56"
-
-%%%%% define storage structures
-
-% base-chord-shapes is an alist of chord shapes
-% in the form of fret-diagram-terse strings with
-% scheme symbols as keys.  For convenience, the
-% symbols are LilyPond chordmode chord descriptions,
+\version "2.11.65"
+
+% chord-shape-table is a hash-table of chord shapes
+% in the form of diagram-descriptions that can be
+% fret-diagram-verbose markup-llsts or
+% fret-diagram-terse strings.
+% The hash keys are pairs of scheme symbols and
+% string tunings.  For convenience, the symbols in
+% this file are LilyPond chordmode chord descriptions,
 % but that is unnecessary.
 
-#(define base-chord-shapes '())
-
-
 % music function for adding a chord shape to
-% base-chord-shapes
+% chord-shape-table
 
 addChordShape =
-#(define-music-function (parser location key-symbol shape-string)
-   (symbol? string?)
-   "Add chord shape @code{shape-string} to the @code{base-chord-shapes}
-alist with the key @code{key-symbol}."
-   (set! base-chord-shapes 
-           (acons key-symbol shape-string base-chord-shapes))
+#(define-music-function (parser location key-symbol tuning shape-definition)
+   (symbol? pair? string-or-pair?)
+   "Add chord shape @code{shape-definition} to the @code{chord-shape-table}
+hash with the key @code{(cons key-symbol tuning)}."
+   (hash-set! chord-shape-table
+               (cons key-symbol tuning)
+               shape-definition)
    (make-music 'SequentialMusic 'void #t))
 
-% for convenience, to eliminate storage list in .ly references
-
-#(define (chord-shape shape-code)
-   (get-chord-shape shape-code base-chord-shapes))
+#(define (chord-shape shape-code tuning)
+   (get-chord-shape shape-code tuning chord-shape-table))
 
 % music function for adding a predefined diagram to
 % fretboard-table
 
 storePredefinedDiagram =
-#(define-music-function (parser location chord tuning terse-definition)
-  (ly:music? list? string?)
-  "Add predefined fret diagram defined by fret-diagram-terse definition
-string @code{terse-definition} for the chord pitches @code{chord} and
+#(define-music-function (parser location chord tuning diagram-definition)
+  (ly:music? pair? string-or-pair?)
+  "Add predefined fret diagram defined by @code{diagram-definition}
+for the chord pitches @code{chord} and
 the stringTuning @code{tuning}."
   (let* ((pitches (event-chord-pitches 
                     (car (extract-named-music chord 'EventChord))))
-         (hash-key (cons tuning pitches)))
+         (hash-key (cons tuning pitches))
+         (verbose-definition (if (string? diagram-definition)
+                                 (parse-terse-string diagram-definition)
+                                 diagram-definition)))
   (hash-set! fretboard-table 
              hash-key 
-             (parse-terse-string terse-definition)))
+             verbose-definition))
   (make-music 'SequentialMusic 'void #t))
 
index a448f34ba159003dcac7c246074e11faec8b7bea..5ff9ab312bf8bcd93638dd1d1842647cffaddb1c 100644 (file)
@@ -8,20 +8,20 @@
 
 \version "2.11.56"
 
-\addChordShape #'f #"1-1-(;3-3;3-4;2-2;1-1;1-1-);"
-\addChordShape #'f:m #"1-1-(;3-3;3-4;1-1;1-1;1-1-);"
-\addChordShape #'f:7 #"1-1-(;3-3;1-1;2-2;1-1;1-1-);"
-\addChordShape #'f:m7 #"1-1-(;3-3;1-1;1-1;1-1;1-1-);"
-\addChordShape #'bes #"x;1-1-(;3-2;3-3;3-4;1-1-);"
-\addChordShape #'bes:m #"x;1-1-(;3-3;3-4;2-2;1-1-);"
-\addChordShape #'bes:m7 #"x;1-1-(;3-3;1-1;2-2;1-1-);"
-\addChordShape #'bes:7 #"x;1-1-(;3-2;1-1;3-3;1-1-);"
-\addChordShape #'bes:maj7 #"x;1-1;3-3;2-2;3-4;x;"
-\addChordShape #'c:dim #"x;x;1-1;2-3;1-2;2-4;"
-\addChordShape #'c:aug #"x;x;2-2;1-1-(;1-1-);4-4;"
-\addChordShape #'cis #"x;x;3-3;1-1-(;2-2;1-1-);"
-\addChordShape #'ees:dim #"x;x;1-1;2-3;1-2;2-4;"
-\addChordShape #'a:dim #"x;x;1-1;2-3;1-2;2-4;"
+\addChordShape #'f #guitar-tuning #"1-1-(;3-3;3-4;2-2;1-1;1-1-);"
+\addChordShape #'f:m #guitar-tuning #"1-1-(;3-3;3-4;1-1;1-1;1-1-);"
+\addChordShape #'f:7 #guitar-tuning #"1-1-(;3-3;1-1;2-2;1-1;1-1-);"
+\addChordShape #'f:m7 #guitar-tuning #"1-1-(;3-3;1-1;1-1;1-1;1-1-);"
+\addChordShape #'bes #guitar-tuning #"x;1-1-(;3-2;3-3;3-4;1-1-);"
+\addChordShape #'bes:m #guitar-tuning #"x;1-1-(;3-3;3-4;2-2;1-1-);"
+\addChordShape #'bes:m7 #guitar-tuning #"x;1-1-(;3-3;1-1;2-2;1-1-);"
+\addChordShape #'bes:7 #guitar-tuning #"x;1-1-(;3-2;1-1;3-3;1-1-);"
+\addChordShape #'bes:maj7 #guitar-tuning #"x;1-1;3-3;2-2;3-4;x;"
+\addChordShape #'c:dim #guitar-tuning #"x;x;1-1;2-3;1-2;2-4;"
+\addChordShape #'c:aug #guitar-tuning #"x;x;2-2;1-1-(;1-1-);4-4;"
+\addChordShape #'cis #guitar-tuning #"x;x;3-3;1-1-(;2-2;1-1-);"
+\addChordShape #'ees:dim #guitar-tuning #"x;x;1-1;2-3;1-2;2-4;"
+\addChordShape #'a:dim #guitar-tuning #"x;x;1-1;2-3;1-2;2-4;"
 
 %%%  Add predefined chords
 
                         #"x;3-3;2-2;o;1-1;o;"  
 \storePredefinedDiagram \chordmode {c:m} 
                         #guitar-tuning 
-                        #(offset-fret 2 (chord-shape 'bes:m))
+                        #(offset-fret 2 (chord-shape 'bes:m guitar-tuning))
 \storePredefinedDiagram \chordmode {c:aug} 
                         #guitar-tuning 
-                        #(chord-shape 'c:aug)
+                        #(chord-shape 'c:aug guitar-tuning)
 \storePredefinedDiagram \chordmode {c:dim} 
                         #guitar-tuning 
-                        #(chord-shape 'c:dim)
+                        #(chord-shape 'c:dim guitar-tuning)
 \storePredefinedDiagram \chordmode {c:7} 
                         #guitar-tuning 
                         #"o;3-3;2-2;3-4;1-1;o;"  
                         #"x;3-3;2-2;o;o;o;"  
 \storePredefinedDiagram \chordmode {c:m7} 
                         #guitar-tuning 
-                        #(offset-fret 2 (chord-shape 'bes:m7))
+                        #(offset-fret 2 (chord-shape 'bes:m7 guitar-tuning))
 
 %%%%  cis chords
 %
 \storePredefinedDiagram \chordmode {cis} 
                         #guitar-tuning 
-                        #(chord-shape 'cis)
+                        #(chord-shape 'cis guitar-tuning)
 \storePredefinedDiagram \chordmode {cis:m} 
                         #guitar-tuning 
                         #"x;x;2-2;1-1;2-3;o;"  
@@ -64,7 +64,7 @@
                         #"x;4-4;3-3;2-1;2-2;x;"  
 \storePredefinedDiagram \chordmode {cis:dim} 
                         #guitar-tuning 
-                        #(offset-fret 1 (chord-shape 'c:dim))
+                        #(offset-fret 1 (chord-shape 'c:dim guitar-tuning))
 \storePredefinedDiagram \chordmode {cis:7} 
                         #guitar-tuning 
                         #"x;x;3-2;4-3;2-1;4-4;"  
@@ -88,7 +88,7 @@
                         #"x;4-4;3-3;2-1;2-2;x;"  
 \storePredefinedDiagram \chordmode {des:dim} 
                         #guitar-tuning 
-                        #(offset-fret 1 (chord-shape 'c:dim))
+                        #(offset-fret 1 (chord-shape 'c:dim guitar-tuning))
 \storePredefinedDiagram \chordmode {des:7} 
                         #guitar-tuning 
                         #"x;x;3-2;4-3;2-1;4-4;"  
 %
 \storePredefinedDiagram \chordmode {dis} 
                         #guitar-tuning 
-                        #(offset-fret 2 (chord-shape 'cis))
+                        #(offset-fret 2 (chord-shape 'cis guitar-tuning))
 \storePredefinedDiagram \chordmode {dis:m} 
                         #guitar-tuning 
                         #"x;x;4-3;3-2;4-4;1-1;"  
                         #"3-3;2-2;1-1;o;o;3-4"  
 \storePredefinedDiagram \chordmode {dis:dim} 
                         #guitar-tuning 
-                        #(chord-shape 'ees:dim) 
+                        #(chord-shape 'ees:dim guitar-tuning
 \storePredefinedDiagram \chordmode {dis:7} 
                         #guitar-tuning 
                         #"x;x;1-1;3-3;2-2;3-4;"  
 %
 \storePredefinedDiagram \chordmode {ees} 
                         #guitar-tuning 
-                        #(offset-fret 2 (chord-shape 'cis))
+                        #(offset-fret 2 (chord-shape 'cis guitar-tuning))
 \storePredefinedDiagram \chordmode {ees:m} 
                         #guitar-tuning 
                         #"x;x;4-3;3-2;4-4;1-1;"  
                         #"3-3;2-2;1-1;o;o;3-4"  
 \storePredefinedDiagram \chordmode {ees:dim} 
                         #guitar-tuning 
-                        #(chord-shape 'ees:dim) 
+                        #(chord-shape 'ees:dim guitar-tuning
 \storePredefinedDiagram \chordmode {ees:7} 
                         #guitar-tuning 
                         #"x;x;1-1;3-3;2-2;3-4;"  
                         #"o;3-3;2-2;1-1;x;x;"  
 \storePredefinedDiagram \chordmode {e:dim} 
                         #guitar-tuning 
-                        #(offset-fret 1 (chord-shape 'ees:dim))
+                        #(offset-fret 1 (chord-shape 'ees:dim guitar-tuning))
 \storePredefinedDiagram \chordmode {e:7} 
                         #guitar-tuning 
                         #"o;2-2;o;1-1;o;o;"  
 %
 \storePredefinedDiagram \chordmode {f} 
                         #guitar-tuning 
-                        #(chord-shape 'f)
+                        #(chord-shape 'f guitar-tuning)
 \storePredefinedDiagram \chordmode {f:m} 
                         #guitar-tuning 
-                        #(chord-shape 'f:m)
+                        #(chord-shape 'f:m guitar-tuning)
 \storePredefinedDiagram \chordmode {f:aug} 
                         #guitar-tuning 
                         #"x;x;1-1;4-3;4-4;3-2;"  
                         #"x;x;o;1-1;o;1-2;"  
 \storePredefinedDiagram \chordmode {f:7} 
                         #guitar-tuning 
-                        #(chord-shape 'f:7)
+                        #(chord-shape 'f:7 guitar-tuning)
 \storePredefinedDiagram \chordmode {f:maj7} 
                         #guitar-tuning 
                         #"x;3-3;3-4;2-2;1-1;"  
 \storePredefinedDiagram \chordmode {f:m7} 
                         #guitar-tuning 
-                        #(chord-shape 'f:m7)
+                        #(chord-shape 'f:m7 guitar-tuning)
 
 %%%%  fis chords
 %
 \storePredefinedDiagram \chordmode {fis} 
                         #guitar-tuning 
-                        #(offset-fret 1 (chord-shape 'f))
+                        #(offset-fret 1 (chord-shape 'f guitar-tuning))
 \storePredefinedDiagram \chordmode {fis:m} 
                         #guitar-tuning 
-                        #(offset-fret 1 (chord-shape 'f:m))
+                        #(offset-fret 1 (chord-shape 'f:m guitar-tuning))
 \storePredefinedDiagram \chordmode {fis:aug} 
                         #guitar-tuning 
                         #"2-2;1-1;o;3-4-(;3-4-);2-3;" 
                         #"x;x;1-1;2-3;1-2;2-4;"  
 \storePredefinedDiagram \chordmode {fis:7} 
                         #guitar-tuning 
-                        #(offset-fret 1 (chord-shape 'f:7))
+                        #(offset-fret 1 (chord-shape 'f:7 guitar-tuning))
 \storePredefinedDiagram \chordmode {fis:maj7} 
                         #guitar-tuning 
                         #"x;x;4-4;3-3;2-2;1-1;"  
 \storePredefinedDiagram \chordmode {fis:m7} 
                         #guitar-tuning 
-                        #(offset-fret 1 (chord-shape 'f:m7))
+                        #(offset-fret 1 (chord-shape 'f:m7 guitar-tuning))
 
 %%%%  ges chords
 %
 \storePredefinedDiagram \chordmode {ges} 
                         #guitar-tuning 
-                        #(offset-fret 1 (chord-shape 'f))
+                        #(offset-fret 1 (chord-shape 'f guitar-tuning))
 \storePredefinedDiagram \chordmode {ges:m} 
                         #guitar-tuning 
-                        #(offset-fret 1 (chord-shape 'f:m))
+                        #(offset-fret 1 (chord-shape 'f:m guitar-tuning))
 \storePredefinedDiagram \chordmode {ges:aug} 
                         #guitar-tuning 
                         #"2-2;1-1;o;3-4-(;3-4-);2-3;" 
                         #"x;x;1-1;2-3;1-2;2-4;"  
 \storePredefinedDiagram \chordmode {ges:7} 
                         #guitar-tuning 
-                        #(offset-fret 1 (chord-shape 'f:7))
+                        #(offset-fret 1 (chord-shape 'f:7 guitar-tuning))
 \storePredefinedDiagram \chordmode {ges:maj7} 
                         #guitar-tuning 
                         #"x;x;4-4;3-3;2-2;1-1;"  
 \storePredefinedDiagram \chordmode {ges:m7} 
                         #guitar-tuning 
-                        #(offset-fret 1 (chord-shape 'f:m7))
+                        #(offset-fret 1 (chord-shape 'f:m7 guitar-tuning))
 
 %%%%  g chords
 %
                         #"3-2;2-1;o;o;o;3-3;"  
 \storePredefinedDiagram \chordmode {g:m} 
                         #guitar-tuning 
-                        #(offset-fret 2 (chord-shape 'f:m))
+                        #(offset-fret 2 (chord-shape 'f:m guitar-tuning))
 \storePredefinedDiagram \chordmode {g:aug} 
                         #guitar-tuning 
                         #"x;x;5-1;8-3;8-4;7-2;"  
                         #"x;x;5-4;4-3;3-2;2-1;"  
 \storePredefinedDiagram \chordmode {g:m7} 
                         #guitar-tuning 
-                        #(offset-fret 2 (chord-shape 'f:m7))
+                        #(offset-fret 2 (chord-shape 'f:m7 guitar-tuning))
 
 %%%%  gis chords
 %
 \storePredefinedDiagram \chordmode {gis} 
                         #guitar-tuning 
-                        #(offset-fret 3 (chord-shape 'f))
+                        #(offset-fret 3 (chord-shape 'f guitar-tuning))
 \storePredefinedDiagram \chordmode {gis:m} 
                         #guitar-tuning 
-                        #(offset-fret 3 (chord-shape 'f:m))
+                        #(offset-fret 3 (chord-shape 'f:m guitar-tuning))
 \storePredefinedDiagram \chordmode {gis:aug} 
                         #guitar-tuning 
                         #"o;3-4;2-3;1-1;1-2;o;"  
                         #"x;x;o;1-1;o;1-2;"  
 \storePredefinedDiagram \chordmode {gis:7} 
                         #guitar-tuning 
-                        #(offset-fret 3 (chord-shape 'f:7))
+                        #(offset-fret 3 (chord-shape 'f:7 guitar-tuning))
 \storePredefinedDiagram \chordmode {gis:maj7} 
                         #guitar-tuning 
                         #"x;x;1-1-(;1-1;1-1-);3-3;"  
 \storePredefinedDiagram \chordmode {gis:m7} 
                         #guitar-tuning 
-                        #(offset-fret 3 (chord-shape 'f:m7))
+                        #(offset-fret 3 (chord-shape 'f:m7 guitar-tuning))
 
 %%%%  aes chords
 %
 \storePredefinedDiagram \chordmode {aes} 
                         #guitar-tuning 
-                        #(offset-fret 3 (chord-shape 'f))
+                        #(offset-fret 3 (chord-shape 'f guitar-tuning))
 \storePredefinedDiagram \chordmode {aes:m} 
                         #guitar-tuning 
-                        #(offset-fret 3 (chord-shape 'f:m))
+                        #(offset-fret 3 (chord-shape 'f:m guitar-tuning))
 \storePredefinedDiagram \chordmode {aes:aug} 
                         #guitar-tuning 
                         #"o;3-4;2-3;1-1;1-2;o;"  
                         #"x;x;o;1-1;o;1-2;"  
 \storePredefinedDiagram \chordmode {aes:7} 
                         #guitar-tuning 
-                        #(offset-fret 3 (chord-shape 'f:7))
+                        #(offset-fret 3 (chord-shape 'f:7 guitar-tuning))
 \storePredefinedDiagram \chordmode {aes:maj7} 
                         #guitar-tuning 
                         #"x;x;1-1-(;1-1;1-1-);3-3;"  
 \storePredefinedDiagram \chordmode {aes:m7} 
                         #guitar-tuning 
-                        #(offset-fret 3 (chord-shape 'f:m7))
+                        #(offset-fret 3 (chord-shape 'f:m7 guitar-tuning))
 
 %%%%  a chords
 %
                         #"x;o;3-4;2-2;2-3;1-1;"  
 \storePredefinedDiagram \chordmode {a:dim} 
                         #guitar-tuning 
-                        #(chord-shape 'a:dim)
+                        #(chord-shape 'a:dim guitar-tuning)
 \storePredefinedDiagram \chordmode {a:7} 
                         #guitar-tuning 
                         #"x;o;2-1;o;2-3;o;"  
 %
 \storePredefinedDiagram \chordmode {ais} 
                         #guitar-tuning 
-                        #(chord-shape 'bes)
+                        #(chord-shape 'bes guitar-tuning)
 \storePredefinedDiagram \chordmode {ais:m} 
                         #guitar-tuning 
-                        #(chord-shape 'bes:m)
+                        #(chord-shape 'bes:m guitar-tuning)
 \storePredefinedDiagram \chordmode {ais:aug} 
                         #guitar-tuning 
                         #"2-2;1-1;o;3-4-(;3-4-);2-3;"  
 \storePredefinedDiagram \chordmode {ais:dim} 
                         #guitar-tuning 
-                        #(offset-fret 1 (chord-shape 'a:dim))
+                        #(offset-fret 1 (chord-shape 'a:dim guitar-tuning))
 \storePredefinedDiagram \chordmode {ais:7} 
                         #guitar-tuning 
-                        #(chord-shape 'bes:7)
+                        #(chord-shape 'bes:7 guitar-tuning)
 \storePredefinedDiagram \chordmode {ais:maj7} 
                         #guitar-tuning 
                         #"x;1-1;3-3;2-2;3-4;x;"  
 \storePredefinedDiagram \chordmode {ais:m7} 
                         #guitar-tuning 
-                        #(chord-shape 'bes:m7)
+                        #(chord-shape 'bes:m7 guitar-tuning)
 
 %%%%  bes chords
 %
 \storePredefinedDiagram \chordmode {bes} 
                         #guitar-tuning 
-                        #(chord-shape 'bes)
+                        #(chord-shape 'bes guitar-tuning)
 \storePredefinedDiagram \chordmode {bes:m} 
                         #guitar-tuning 
-                        #(chord-shape 'bes:m)
+                        #(chord-shape 'bes:m guitar-tuning)
 \storePredefinedDiagram \chordmode {bes:aug} 
                         #guitar-tuning 
                         #"2-2;1-1;o;3-4-(;3-4-);2-3;"  
 \storePredefinedDiagram \chordmode {bes:dim} 
                         #guitar-tuning 
-                        #(offset-fret 1 (chord-shape 'a:dim))
+                        #(offset-fret 1 (chord-shape 'a:dim guitar-tuning))
 \storePredefinedDiagram \chordmode {bes:7} 
                         #guitar-tuning 
-                        #(chord-shape 'bes:7)
+                        #(chord-shape 'bes:7 guitar-tuning)
 \storePredefinedDiagram \chordmode {bes:maj7} 
                         #guitar-tuning 
                         #"x;1-1;3-3;2-2;3-4;x;"  
 \storePredefinedDiagram \chordmode {bes:m7} 
                         #guitar-tuning 
-                        #(chord-shape 'bes:m7)
+                        #(chord-shape 'bes:m7 guitar-tuning)
 
 %%%%  b chords
 %
 \storePredefinedDiagram \chordmode {b} 
                         #guitar-tuning 
-                        #(offset-fret 1 (chord-shape 'bes))
+                        #(offset-fret 1 (chord-shape 'bes guitar-tuning))
 \storePredefinedDiagram \chordmode {b:m} 
                         #guitar-tuning 
-                        #(offset-fret 1 (chord-shape 'bes:m))
+                        #(offset-fret 1 (chord-shape 'bes:m guitar-tuning))
 \storePredefinedDiagram \chordmode {b:aug} 
                         #guitar-tuning 
                         #"x;3-2;2-1;o;o;x;"  
                         #"x;x;o;1-1;o;1-2;"  
 \storePredefinedDiagram \chordmode {b:7} 
                         #guitar-tuning 
-                        #(offset-fret 1 (chord-shape 'bes:7))
+                        #(offset-fret 1 (chord-shape 'bes:7 guitar-tuning))
 \storePredefinedDiagram \chordmode {b:maj7} 
                         #guitar-tuning 
                         #"x;2-1;4-3;3-2;4-4;x;"  
 \storePredefinedDiagram \chordmode {b:m7} 
                         #guitar-tuning 
-                        #(offset-fret 1 (chord-shape 'bes:m7))
+                        #(offset-fret 1 (chord-shape 'bes:m7 guitar-tuning))
 
index 519323e0dd1b245ee462900acc9eb696db223f6a..179b8bad84c38f742cfefb501651a85fce544c51 100644 (file)
@@ -8,57 +8,57 @@
 %
 
 
-\addChordShape #'c:9 #"x;3-2;2-1;3-3-(;3-3;3-3-);"
-\addChordShape #'f:9 #"1-1-(;3-3;1-1;2-2;1-1-);3-4;"
+\addChordShape #'c:9 #guitar-tuning #"x;3-2;2-1;3-3-(;3-3;3-3-);"
+\addChordShape #'f:9 #guitar-tuning #"1-1-(;3-3;1-1;2-2;1-1-);3-4;"
 
 \storePredefinedDiagram \chordmode {c:9}
                         #guitar-tuning
-                       #(chord-shape 'c:9)
+                       #(chord-shape 'c:9 guitar-tuning)
 \storePredefinedDiagram \chordmode {cis:9}
                         #guitar-tuning
-                       #(offset-fret 1 (chord-shape 'c:9))
+                       #(offset-fret 1 (chord-shape 'c:9 guitar-tuning))
 \storePredefinedDiagram \chordmode {des:9}
                         #guitar-tuning
-                       #(offset-fret 1 (chord-shape 'c:9))
+                       #(offset-fret 1 (chord-shape 'c:9 guitar-tuning))
 \storePredefinedDiagram \chordmode {d:9}
                         #guitar-tuning
-                       #(offset-fret 2 (chord-shape 'c:9))
+                       #(offset-fret 2 (chord-shape 'c:9 guitar-tuning))
 \storePredefinedDiagram \chordmode {dis:9}
                         #guitar-tuning
-                       #(offset-fret 3 (chord-shape 'c:9))
+                       #(offset-fret 3 (chord-shape 'c:9 guitar-tuning))
 \storePredefinedDiagram \chordmode {ees:9}
                         #guitar-tuning
-                       #(offset-fret 3 (chord-shape 'c:9))
+                       #(offset-fret 3 (chord-shape 'c:9 guitar-tuning))
 \storePredefinedDiagram \chordmode {e:9}
                         #guitar-tuning
                        #"o;2-2;o;1-1;o;2-3;"
 \storePredefinedDiagram \chordmode {f:9}
                         #guitar-tuning
-                       #(chord-shape 'f:9)
+                       #(chord-shape 'f:9 guitar-tuning)
 \storePredefinedDiagram \chordmode {fis:9}
                         #guitar-tuning
-                       #(offset-fret 1 (chord-shape 'f:9))
+                       #(offset-fret 1 (chord-shape 'f:9 guitar-tuning))
 \storePredefinedDiagram \chordmode {ges:9}
                         #guitar-tuning
-                       #(offset-fret 1 (chord-shape 'f:9))
+                       #(offset-fret 1 (chord-shape 'f:9 guitar-tuning))
 \storePredefinedDiagram \chordmode {g:9}
                         #guitar-tuning
-                       #(offset-fret 2 (chord-shape 'f:9))
+                       #(offset-fret 2 (chord-shape 'f:9 guitar-tuning))
 \storePredefinedDiagram \chordmode {gis:9}
                         #guitar-tuning
-                       #(offset-fret 3 (chord-shape 'f:9))
+                       #(offset-fret 3 (chord-shape 'f:9 guitar-tuning))
 \storePredefinedDiagram \chordmode {aes:9}
                         #guitar-tuning
-                       #(offset-fret 3 (chord-shape 'f:9))
+                       #(offset-fret 3 (chord-shape 'f:9 guitar-tuning))
 \storePredefinedDiagram \chordmode {a:9}
                         #guitar-tuning
-                       #(offset-fret 4 (chord-shape 'f:9))
+                       #(offset-fret 4 (chord-shape 'f:9 guitar-tuning))
 \storePredefinedDiagram \chordmode {ais:9}
                         #guitar-tuning
-                       #(offset-fret 5 (chord-shape 'f:9))
+                       #(offset-fret 5 (chord-shape 'f:9 guitar-tuning))
 \storePredefinedDiagram \chordmode {bes:9}
                         #guitar-tuning
-                       #(offset-fret 5 (chord-shape 'f:9))
+                       #(offset-fret 5 (chord-shape 'f:9 guitar-tuning))
 \storePredefinedDiagram \chordmode {b:9}
                         #guitar-tuning
-                       #(offset-fret -1 (chord-shape 'c:9))
+                       #(offset-fret -1 (chord-shape 'c:9 guitar-tuning))
index 80e81055409629b58e42386667319ff78caaddc7..ef536cae8269ebff3cd5b94fa5dd62529b0a4cbc 100644 (file)
@@ -44,6 +44,87 @@ enddef;
 
 fet_begingroup ("accidentals");
 
+%
+% Draw an arrow
+%
+% * `stemslant' gives the direction of the stem's left boundary
+%   (needed for brushed stems, equals "up" for straight stems)
+% * `extend' is used to make the stem longer or shorter (if negative);
+%   different kinds of accidentals need different values here
+%
+def draw_arrow (expr attach, stemwidth, stemslant, extend, pointingdown) =
+begingroup;
+       save htip;  % tip height
+       save wwing; % wing `radius'
+       save angle_wing_bot, angle_wing_top, angle_tip;
+       save upshift;
+       clearxy;
+
+       wwing := 0.26 stemwidth;
+       htip := staff_space * 0.85 + stafflinethickness - wwing;
+
+       % `flip' is used to reflect the arrow vertically
+       % if arrow points downward
+       transform flip;
+       if pointingdown:
+               flip = identity reflectedabout (origin, right);
+       else:
+               flip = identity;
+       fi;
+
+       z1 = attach shifted (-stemwidth / 2, 0);
+       upshift := max (0, wwing + 0.1 staff_space + extend);
+       z2 = z1 shifted (((unitvector stemslant)
+                         scaled upshift) transformed flip);
+
+       z7 = attach shifted ((stemwidth/2),0);
+       z6 = z7 shifted (((unitvector (-xpart stemslant, ypart stemslant))
+                         scaled upshift) transformed flip);
+       z2 - z3 = ( 0.38 staff_space, 0.05 htip) transformed flip;
+       z6 - z5 = (-0.38 staff_space, 0.05 htip) transformed flip;
+
+       z4 = attach shifted ((-0.2 stemwidth, upshift + htip)
+                            transformed flip);
+       z4'= attach shifted (( 0.2 stemwidth, upshift + htip)
+                            transformed flip);
+
+       % `angle_wing_bot' is the angle at which the arc
+       % from z2 to z3a enters z3a
+       % `angle_wing_top' is the angle at which the arc
+       % from z3b to z4 leaves z3b
+       % `angle_tip' is the angle at which the arc
+       % from z4 to z4' leaves z4
+       angle_wing_bot = 30;
+       angle_wing_top = 55;
+       angle_tip = 68;
+
+       z3a = z3 shifted ((((dir angle_wing_bot) rotated -90)
+                          scaled wwing) transformed flip);
+       z3b = z3 shifted ((((dir angle_wing_top) rotated 90)
+                          scaled wwing) transformed flip);
+
+       z5a = z5 shifted ((((dir (180 - angle_wing_bot)) rotated 90)
+                          scaled wwing) transformed flip);
+       z5b = z5 shifted ((((dir (180 - angle_wing_top)) rotated -90)
+                          scaled wwing) transformed flip);
+
+       % Draw the arrow
+       pickup pencircle scaled 1;
+       fill z1
+            -- z2{stemslant transformed flip}
+            .. {(-dir angle_wing_bot) transformed flip}z3a
+            .. z3b{(dir angle_wing_top) transformed flip}
+            .. z4{(dir angle_tip) transformed flip}
+            .. z4'{(dir (-angle_tip)) transformed flip}
+            .. {(dir (-angle_wing_top)) transformed flip}z5b
+            .. z5a{(-dir (-angle_wing_bot)) transformed flip}
+            .. z6{((-stemslant) reflectedabout (origin, up)) transformed flip}
+            -- z7
+            -- cycle;
+
+       labels (range 0 thru 7, 4', 3a, 3b, 5a, 5b);
+endgroup;
+enddef;
 
 save remember_pic;
 picture remember_pic;
@@ -97,17 +178,33 @@ def draw_meta_sharp (expr width, offset) =
 enddef;
 
 
-fet_beginchar ("Sharp", "sharp");
+def draw_sharp(expr arrowup, arrowdown) =
        save stem, stemx, stemwidth;
        save outer_space, interbeam;
+       save stemlength, extendleft, extendright, height, depth;
 
        stemwidth# := stafflinethickness# + .05 staff_space#;
        define_whole_blacker_pixels (stemwidth);
 
        interbeam := 1.05 staff_space_rounded;
 
-       set_char_box (0, 1.1 staff_space#,
-                     1.5 staff_space#, 1.5 staff_space#);
+       stemlength# := 1.5 staff_space#;
+       define_pixels (stemlength);
+
+       height# = stemlength#;
+       depth# = stemlength#;
+       extendright# = 0;
+       extendleft# = 0;
+       if arrowup:
+               height# := height# + 1.2 staff_space#;
+               extendright# := extendright# + 1.5 stafflinethickness#;
+       fi;
+       if arrowdown:
+               depth# := depth# + 1.2 staff_space#;
+               extendleft# := extendleft# + 1.5 stafflinethickness#;
+       fi;
+       define_pixels (extendleft, extendright);
+       set_char_box (extendleft#, 1.1 staff_space#, depth#, height#);
 
        stem := 7 / 16 * w;
        stemx := hround stem;
@@ -119,23 +216,66 @@ fet_beginchar ("Sharp", "sharp");
        draw_meta_sharp (w, -.5 interbeam);
        draw_meta_sharp (w, -.5 interbeam + vround interbeam);
 
+       % expand the charbox so that it encloses the whole arrow;
+       % this must not happen earlier because some commands above
+       % still rely on the old width
+       w := w + extendright;
+
        pickup pencircle scaled stemwidth;
 
        lft x5 = lft x6 = outer_space;
        lft x7 = lft x8 = outer_space + stemx;
-       bot y5 = -d;
+       bot y5 = -stemlength;
        top y6 = vround (1.5 staff_space - stem * beamslope);
        bot y7 = -top y6 + feta_space_shift;
-       top y8 = h;
+       top y8 = stemlength;
 
-       labels (5, 6, 7, 8);    
+       labels (5, 6, 7, 8);
 
        draw_gridline (z5, z6, stemwidth);
        draw_gridline (z7, z8, stemwidth);
 
+       if arrowup:
+               draw_arrow (z8, stemwidth, up,
+                           stafflinethickness / 2 + stemwidth / 2, false);
+       fi;
+       if arrowdown:
+               draw_arrow (z5, stemwidth, up,
+                           stafflinethickness / 2 + stemwidth / 2, true);
+       fi;
+
        remember_pic := currentpicture;
 
        draw_staff (-2, 2, 0);
+enddef;
+
+
+fet_beginchar ("Sharp", "sharp");
+       draw_sharp (false, false);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("Arrowed Sharp (arrow up)", "sharp.arrowup");
+       draw_sharp (true, false);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("Arrowed Sharp (arrow down)", "sharp.arrowdown");
+       draw_sharp (false, true);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("Arrowed Sharp (arrows up and down)", "sharp.arrowboth");
+       draw_sharp (true, true);
 fet_endchar;
 
 
@@ -329,9 +469,11 @@ draw_shifted_too;
 % The stems of the natural are brushed (at least, in Barenreiter SCS)
 %
 
-fet_beginchar ("Natural", "natural");
+def draw_natural (expr arrowup, arrowdown) =
        save stemwidth, top_stem_thick;
        save ne, pat_top, pat_bottom;
+       save depth, height, extendleft, extendright, stemlength;
+       save brush_scale_up, brush_scale_down;
        pair ne;
        path pat_top, pat_bottom;
 
@@ -339,39 +481,68 @@ fet_beginchar ("Natural", "natural");
        stemwidth# = 0.09 staff_space# + .5 stafflinethickness#;
        define_whole_blacker_pixels (top_stem_thick, stemwidth);
 
-       set_char_box (0, 2/3 staff_space#,
-                     1.5 staff_space#, 1.5 staff_space#);
+       stemlength# = 1.5 staff_space#;
+       define_pixels (stemlength);
+
+       height# = stemlength#;
+       depth# = stemlength#;
+       extendleft# = 0;
+       extendright# = 0;
+       if arrowup:
+               extendleft# := 3 stafflinethickness#;
+               height# := height# + 1.2 staff_space#;
+       fi;
+       if arrowdown:
+               extendright# := 3.15 stafflinethickness#;
+               depth# := depth# + 1.2 staff_space#;
+       fi;
+       define_pixels (extendright);
+
+       set_char_box (extendleft#, 2/3 staff_space#, depth#, height#);
 
        d := d - feta_space_shift;
 
        pickup pencircle scaled stemwidth;
 
+       brush_scale_up := 1.0;
+       brush_scale_down := 1.0;
+       % to look nice, arrowed stems must be less brushed
+       if arrowup:
+               brush_scale_up := 0.85;
+       fi;
+       if arrowdown:
+               brush_scale_down := 0.85;
+       fi;
+
        penpos1 (top_stem_thick, 0);
        penpos3 (top_stem_thick, 0);
        penpos2 (stemwidth, 0);
        penpos4 (stemwidth, 0);
+       % z1' and z3' are needed for the arrowed accidentals
+       penpos1' (top_stem_thick * brush_scale_up, 0);
+       penpos3' (top_stem_thick * brush_scale_down, 0);
 
        x2r = w;
        x4l = 0;
-       x3 = x2;
-       x1 = x4;
+       x3 = x3' = x2;
+       x1 = x1' = x4;
 
-       y1 = h;
-       y3 = -d;
+       y1 = y1' = stemlength;
+       y3 = y3' = -stemlength;
        top y2 = vround (staff_space - 3/2 stafflinethickness);
        y4 = -y2 + feta_space_shift;
 
        pat_bottom := z4r{z4r - z1r}
                      .. bot z4
                      .. z4l{z1l - z4l};
-       fill simple_serif (z1l, z1r, -30)
+       fill simple_serif (z1'l, z1'r, -30)
             -- pat_bottom
             -- cycle;
 
        pat_top := z2r{z2r - z3r}
                   .. top z2
                   .. z2l{z3l - z2l};
-       fill simple_serif (z3l, z3r, 30)
+       fill simple_serif (z3'l, z3'r, 30)
             -- pat_top
             -- cycle;
 
@@ -408,12 +579,51 @@ fet_beginchar ("Natural", "natural");
             -- z24
             -- cycle;
 
-       penlabels (1, 2, 3, 4);
+       penlabels (1, 1', 2, 3, 3', 4);
        labels (11, 11', 12, 13, 14, 21, 21', 22, 23, 24);
 
+       if arrowup:
+               draw_arrow (z1, top_stem_thick * brush_scale_up,
+                           z1'l - z4l, stafflinethickness / 2, false);
+       fi;
+       if arrowdown:
+               draw_arrow (z3, top_stem_thick * brush_scale_down,
+                           z2r - z3'r, stafflinethickness / 2, true);
+               w := w + extendright;
+       fi;
+
        remember_pic := currentpicture;
 
        draw_staff (-2, 2, 0);
+enddef;
+
+
+fet_beginchar ("Natural", "natural");
+       draw_natural (false, false);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("Arrowed Natural (arrow up)", "natural.arrowup");
+       draw_natural (true, false);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("Arrowed Natural (arrow down)", "natural.arrowdown");
+       draw_natural (false, true);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("Arrowed Natural (arrows up and down)", "natural.arrowboth");
+       draw_natural (true, true);
 fet_endchar;
 
 
@@ -431,15 +641,16 @@ draw_shifted_too;
 % TODO: document, simplify!
 %
 
-def draw_meta_flat (expr xcenter, w, crook_fatness) =
+def draw_meta_flat (expr xcenter, w, crook_fatness, arrowup, arrowdown) =
        save crook_thinness;
        save bottom_overshoot, bot_crook_dir;
-       save top_stem_thick, bottom_stem_thick, hair, smaller_hole;
+       save top_stem_thick, top_stem_thick_orig;
+       save bottom_stem_thick, hair, smaller_hole;
        save top_crook_thinness;
        save zwiep;
        save center;
        pair center, bot_crook_dir;
-       save clearing;
+       save clearing, clearing_orig;
 
        clearxy;
 
@@ -453,18 +664,31 @@ def draw_meta_flat (expr xcenter, w, crook_fatness) =
        else:
                smaller_hole = 0;
        fi;
-       clearing = 1.7 stafflinethickness;
        crook_thinness = .7 stafflinethickness + .06 staff_space;
        top_crook_thinness = 1 stafflinethickness + .065 staff_space;
+       clearing = 1.7 stafflinethickness;
+       clearing_orig = clearing;
+       if arrowup:
+               clearing := 0.5 staff_space;
+       fi;
        bottom_overshoot = stafflinethickness;
 
        bottom_stem_thick# = 0.06 staff_space# + 0.6 stafflinethickness#;
        top_stem_thick# = 0.1 staff_space# + 1.2 stafflinethickness#;
-       define_whole_blacker_pixels (bottom_stem_thick, top_stem_thick);
+       top_stem_thick_orig# = top_stem_thick#;
+       if arrowup:
+               % to look nice, arrowed stems should be less brushed
+               top_stem_thick# := top_stem_thick# * 0.8;
+       fi;
+       define_whole_blacker_pixels (bottom_stem_thick, top_stem_thick,
+                                    top_stem_thick_orig);
 
        if odd (top_stem_thick - bottom_stem_thick):
                top_stem_thick := top_stem_thick - 1;
        fi;
+       if odd (top_stem_thick_orig - bottom_stem_thick):
+               top_stem_thick_orig := top_stem_thick_orig - 1;
+       fi;
 
        center = (xcenter, 0);
 
@@ -472,13 +696,22 @@ def draw_meta_flat (expr xcenter, w, crook_fatness) =
        y1 = vround (2 staff_space - clearing);
        x2l = hround (xcenter - .5 bottom_stem_thick);
        y2 = -.5 staff_space - .5 stafflinethickness;
+       % z16 and the `*_orig' variables are needed for arrowed accidentals
+       % because their inner part should be unchanged from plain ones but
+       % the points z3l, z3r, and z10 depend on values that are different
+       % for arrowed accidentals
+       x16l = hround (xcenter -.5 top_stem_thick_orig);
+       y16 = vround (2 staff_space - clearing_orig);
 
        penpos1 (top_stem_thick, 0);
+       penpos16 (top_stem_thick_orig, 0);
        penpos2 (bottom_stem_thick, 0);
 
        y3l = vfloor ((staff_space - stafflinethickness) / 2);
        z3l = whatever [z2r, z1r];
-       z3r = .3 [z2r, z1r] + (smaller_hole, 0);
+       z3r = .3 [z2r,
+                 (z16r shifted (0, clearing_orig - 1.7 stafflinethickness))]
+             + (smaller_hole, 0);
        x3r := hceiling x3r;
 
        % we insert z3l to get better conversion with mf2pt1
@@ -488,7 +721,7 @@ def draw_meta_flat (expr xcenter, w, crook_fatness) =
             -- z3l
             -- cycle;
 
-       z10 = whatever [z2r, z1r] + (smaller_hole, 0);
+       z10 = whatever [z2r, z16r] + (smaller_hole, 0);
        y10 = -1/10 staff_space;
        x10 := hceiling x10;
 
@@ -496,6 +729,9 @@ def draw_meta_flat (expr xcenter, w, crook_fatness) =
        y11 = -vround (.5 (staff_space + stafflinethickness)
                       + bottom_overshoot);
 
+       x2a = 0.2[x2r, x7];
+       y2a = 1.5[y2, y11];
+
        penpos4 (whatever, 53);
 
        y4l - y4r = top_crook_thinness;
@@ -524,25 +760,62 @@ def draw_meta_flat (expr xcenter, w, crook_fatness) =
               .. z10{z3r - z10}
               -- cycle;
 
-       fill z2l{down}
-            .. z11{right}
-            .. z8{bot_crook_dir}
-            .. z5l{up}
-            .. z4l{left}
-            .. z3l
-            -- cycle;
+       if arrowdown:
+               fill z2l{down}
+                    .. z2a{up}
+                    .. z8{bot_crook_dir}
+                    .. z5l{up}
+                    .. z4l{left}
+                    .. z3l
+                    -- cycle;
+       else:
+               fill z2l{down}
+                    .. z11{right}
+                    .. z8{bot_crook_dir}
+                    .. z5l{up}
+                    .. z4l{left}
+                    .. z3l
+                    -- cycle;
+       fi;
+
+       if arrowup:
+               draw_arrow (z1, top_stem_thick, z1l - z2l,
+                           0.5 stafflinethickness, false);
+       fi;
+       if arrowdown:
+               draw_arrow ((0.5 [x2l, x2a], y2), x2a - x2l, up,
+                           staff_space / 2, true);
+       fi;
 enddef;
 
 
+def draw_arrowed_meta_flat (expr xcenter, width, crook_fatness,
+                                arrowup, arrowdown) =
+       save depth, height, extendleft;
+
+       depth# = 0.6 staff_space#;
+       height# = 1.9 staff_space#;
+       extendleft# := 1.2 stafflinethickness#;
+       if arrowup:
+               extendleft# := 3.45 stafflinethickness#;
+               height# := height# + 0.8 staff_space#;
+       fi;
+       if arrowdown:
+               extendleft# := 3.45 stafflinethickness#;
+               depth# := depth# + 1.6 staff_space#;
+       fi;
+
+       set_char_box (extendleft#, width, depth#, height#);
+       draw_meta_flat(xcenter, w, crook_fatness, arrowup, arrowdown);
+enddef;
+
 %
 % unfortunately, 600dpi is not enough to show the brush of the stem.
 %
 
 fet_beginchar ("Flat", "flat");
-       set_char_box (1.2 stafflinethickness#, .8 staff_space#,
-                     0.6 staff_space#, 1.9 staff_space#);
-
-       draw_meta_flat (0, w, 0.31 staff_space);
+       draw_arrowed_meta_flat (0, 0.8 staff_space#, 0.31 staff_space,
+                               false, false);
        penlabels (range 0 thru 11);
 
        remember_pic := currentpicture;
@@ -554,11 +827,53 @@ fet_endchar;
 draw_shifted_too;
 
 
+fet_beginchar ("Arrowed Flat (arrow up)", "flat.arrowup");
+       draw_arrowed_meta_flat (0, 0.8 staff_space#, 0.31 staff_space,
+                               true, false);
+       penlabels (range 0 thru 23);
+
+       remember_pic := currentpicture;
+
+       draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("Arrowed Flat (arrow down)", "flat.arrowdown");
+       draw_arrowed_meta_flat (0, 0.8 staff_space#, 0.31 staff_space,
+                               false, true);
+       penlabels (range 0 thru 23);
+
+       remember_pic := currentpicture;
+
+       draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("Arrowed Flat (arrow up and down)", "flat.arrowboth");
+       draw_arrowed_meta_flat (0, 0.8 staff_space#, 0.31 staff_space,
+                               true, true);
+       penlabels (range 0 thru 23);
+
+       remember_pic := currentpicture;
+
+       draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
 fet_beginchar ("Flat (slashed)", "flat.slash");
        set_char_box (.4 staff_space#, .8 staff_space#,
                      0.6 staff_space#, 1.9 staff_space#);
 
-       draw_meta_flat (0, w, 0.31 staff_space);
+       draw_meta_flat (0, w, 0.31 staff_space, false, false);
 
        clearxy;
 
@@ -597,7 +912,7 @@ fet_beginchar ("Flat (slashed twice)", "flat.slashslash");
        set_char_box (.4 staff_space#, .8 staff_space#,
                      0.6 staff_space#, 1.9 staff_space#);
 
-       draw_meta_flat (0, w, 0.31 staff_space);
+       draw_meta_flat (0, w, 0.31 staff_space, false, false);
 
        clearxy;
 
@@ -776,7 +1091,7 @@ fet_beginchar ("Semi flat", "mirroredflat");
        set_char_box (1.2 stafflinethickness#, .8 staff_space#,
                      0.6 staff_space#, 1.9 staff_space#);
 
-       draw_meta_flat (0, w, 0.31 staff_space);
+       draw_meta_flat (0, w, 0.31 staff_space, false, false);
        currentpicture := currentpicture xscaled -1 shifted (w - b, 0);
 fet_endchar;
 
@@ -785,7 +1100,7 @@ fet_beginchar ("Semi flat", "mirroredflat.backslash");
        set_char_box (.4 staff_space#, .8 staff_space#,
                      0.6 staff_space#, 1.9 staff_space#);
 
-       draw_meta_flat (0, w, 0.31 staff_space);
+       draw_meta_flat (0, w, 0.31 staff_space, false, false);
 
        clearxy;
 
@@ -827,9 +1142,11 @@ fet_beginchar ("Double Flat", "flatflat");
        set_char_box (1.2 stafflinethickness#,
                      (left_wid + right_wid - overlap) * staff_space#,
                      .6 staff_space#, 1.9 staff_space#);
-       draw_meta_flat (0, left_wid * staff_space, 1/3 staff_space);
+       draw_meta_flat (0, left_wid * staff_space, 1/3 staff_space,
+                       false, false);
        draw_meta_flat (hround ((left_wid - overlap) * staff_space),
-                       right_wid * staff_space, 1/3 staff_space);
+                       right_wid * staff_space, 1/3 staff_space,
+                       false, false);
 fet_endchar;
 
 
@@ -843,9 +1160,11 @@ fet_beginchar ("3/4 Flat", "flatflat.slash");
        set_char_box (1.2 stafflinethickness#,
                      (left_wid + right_wid - overlap) * staff_space#,
                      .6 staff_space#, 1.9 staff_space#);
-       draw_meta_flat (0, left_wid * staff_space, 1/3 staff_space);
+       draw_meta_flat (0, left_wid * staff_space, 1/3 staff_space,
+                       false, false);
        draw_meta_flat (hround ((left_wid - overlap) * staff_space),
-                       right_wid * staff_space, 1/3 staff_space);
+                       right_wid * staff_space, 1/3 staff_space,
+                       false, false);
 
        %% maybe we should clip part of the stems?
        %% or make the 1st flat smaller?
index 2384699ceafb5c0c9b243d6f41362a361c8c4832..3eb3e6427774cc9855a3aa57e096b77c507ee36e 100644 (file)
@@ -2844,6 +2844,21 @@ def conv (str):
         str = re.sub ('InnerChoirStaff', 'ChoirStaff', str)
     return str
 
+def conv(str):
+    if re.search(r'\\addChordShape', str):
+        stderr_write ("\n")
+        stderr_write (NOT_SMART % _("stringTuning must be added to \
+        addChordShape call.\n"))
+        stderr_write (UPDATE_MANUALLY)
+        raise FatalConversionError ()
+    if re.search(r'\\chord-shape', str):
+        stderr_write ("\n")
+        stderr_write (NOT_SMART % _("stringTuning must be added to \
+        chord-shape call.\n"))
+        stderr_write (UPDATE_MANUALLY)
+        raise FatalConversionError ()
+    return str
+
 # Guidelines to write rules (please keep this at the end of this file)
 #
 # - keep at most one rule per version; if several conversions should be done,
index b1df9417f7531cfadcddf8bd72f9cd87d6852ccd..440fcbfb3f1c12c87957c79b2f204f95b2efcf0f 100644 (file)
@@ -892,10 +892,10 @@ class BarLine (Music):
         self.type = None
         
     def print_ly (self, printer):
-        bar_symbol = { 'regular': "|", 'dotted': ":", 'dashed': ":",
+        bar_symbol = { 'regular': "|", 'dotted': ":", 'dashed': "dashed",
                        'heavy': "|", 'light-light': "||", 'light-heavy': "|.",
                        'heavy-light': ".|", 'heavy-heavy': ".|.", 'tick': "'",
-                       'short': "'", 'none': "" }.get (self.type, None)
+                       'short': "'|", 'none': "" }.get (self.type, None)
         if bar_symbol <> None:
             printer.dump ('\\bar "%s"' % bar_symbol)
         else:
index ee4de99005758b11de20e9de53a1e0cdb0349a83..8e5fc8d447d8774b81857bb0d27781729bc99419 100644 (file)
@@ -33,6 +33,9 @@
 (define-public (number-or-string? x)
   (or (number? x) (string? x)))
 
+(define-public (string-or-pair? x)
+  (or (string? x) (pair? x)))
+
 (define-public (scheme? x) #t)
 
 
index b697af3b300136ab1487802c96fdb4e976a86dbd..9d902ad713a0e6bf261cade7c9ceccc208c2bdef 100644 (file)
@@ -256,6 +256,9 @@ include the following:
 Choices include @code{curved}, @code{straight}, and
 @code{none}.  Default @code{curved}.
 @item
+@code{capo-thickness} -- Thickness of capo indicator, in
+multiples of fret-space.  Default value 0.5.
+@item
 @code{dot-color} -- Color of dots.  Options include
 @code{black} and @code{white}.  Default @code{black}.
 @item
index acdc38108fcb4d4d84cad692f8f85a72b138d80c..ae671db8ba25d24221012fdb5532548b4e47d66c 100644 (file)
@@ -2,6 +2,10 @@
 ;;;;
 ;;;;  source file of the GNU LilyPOnd music typesetter
 ;;;;
+;;;;  This file implements different flag styles in Scheme / GUILE, most
+;;;;  notably the old-straight-flag and the modern-straight-flag styles.
+;;;;
+
 
 (define-public (no-flag stem-grob)
   "No flag: Simply return empty stencil"
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 
-;; ;; TODO
-;; (define-public (add-stroke-straight stencil dir stroke-style)
-;;   stencil
-;; )
-;;
-;; ;; Create a stencil for a straight flag
-;; ;; flag-thickness, -spacing are given in staff spaces
-;; ;; *flag-length are given in black notehead widths
-;; ;; TODO
-;; (define-public (straight-flag flag-thickness flag-spacing
-;;                        upflag-angle upflag-length
-;;                        downflag-angle downflag-length)
-;;   (lambda (stem-grob)
-;;     (let* ((log (ly:grob-property stem-grob 'duration-log))
-;;            (staff-space 1) ; TODO
-;;            (black-notehead-width 1) ; TODO
-;;            (stem-thickness 1) ; TODO: get rid of
-;;            (half-stem-thickness (/ stem-thickness 2))
-;;            (staff-space 1) ; TODO
-;;            (up-length (+ (* upflag-length black-notehead-width) half-stem-thickness))
-;;            (down-length (+ (* downflag-length black-notehead-width) half-stem-thickness))
-;;            (thickness (* flag-thickness staff-space))
-;;            (spacing (* flag-spacing staff-space)))
-;;       empty-stencil
-;;     )
-;;   )
-;; )
-;;
-;; ;; Modern straight flags: angles are not so large as with the old style
-;; (define-public (modern-straight-flag stem-grob)
-;;   ((straight-flag 0.55 0.9 -18 0.95 22 1.0) stem-grob))
-;;
-;; ;; Old-straight flags (Bach, etc.): quite large flag angles
-;; (define-public (old-straight-flag stem-grob)
-;;   ((straight-flag 0.55 0.9 -45 0.95 45 1.0) stem-grob))
+(define-public (add-stroke-straight stencil stem-grob dir log stroke-style offset length thickness stroke-thickness)
+  "Add the stroke for acciaccatura to the given flag stencil.
+  The stroke starts for up-flags at upper-end-of-flag+(0,length/2) and 
+  ends at (0, vertical-center-of-flag-end) - (flag-x-width/2, flag-x-width + flag-thickness).
+  Here length is the whole length, while flag-x-width is just the 
+  x-extent and thus depends on the angle! Other combinations don't look as 
+  good... For down-stems the y-coordinates are simply mirrored."
+  (let* ((start (offset-add offset (cons 0  (* (/ length 2) dir))))
+         (end (offset-add (cons 0 (cdr offset)) 
+                          (cons (- (/ (car offset) 2)) (* (- (+ thickness (car offset))) dir))))
+         (stroke (make-line-stencil stroke-thickness (car start) (cdr start) (car end) (cdr end))))
+  (ly:stencil-add stencil stroke)))
+
+(define PI-OVER-180  (/ (atan 1 1) 45))
+(define (degrees->radians angle-degrees)
+  "Convert the given angle from degrees to radians"
+  (* angle-degrees PI-OVER-180))
+
+(define (polar->rectangular radius angle-in-degrees)
+  "Convert polar coordinate @code{radius} and @code{angle-in-degrees}
+   to (x-length . y-length)"
+  (let* ((complex (make-polar
+                    radius
+                    (degrees->radians angle-in-degrees))))
+     (cons
+       (real-part complex)
+       (imag-part complex))))
+
+(define (buildflag flag-stencil remain curr-stencil spacing)
+  "Internal function to recursively create a stencil with @code{remain} flags
+   from the single-flag stencil curr-stencil, which is already translated to
+   the position of the previous flag position."
+  (if (> remain 0)
+      (let* ((translated-stencil (ly:stencil-translate-axis curr-stencil spacing Y))
+             (new-stencil (ly:stencil-add flag-stencil translated-stencil)))
+        (buildflag new-stencil (- remain 1) translated-stencil spacing))
+      flag-stencil))
+
+(define-public (straight-flag flag-thickness flag-spacing
+                       upflag-angle upflag-length
+                       downflag-angle downflag-length)
+    "Create a stencil for a straight flag.
+     flag-thickness, -spacing are given in staff spaces,
+     *flag-angle is given in degree, *flag-length is given in staff spaces. 
+     All lengths will be scaled according to the font size of the note."
+  (lambda (stem-grob)
+    (let* ((log (ly:grob-property stem-grob 'duration-log))
+           (dir (ly:grob-property stem-grob 'direction))
+           (stem-up (eqv? dir UP))
+           (layout (ly:grob-layout stem-grob))
+           ; scale with the note size (e.g. for grace notes)
+           (factor (magstep (ly:grob-property stem-grob 'font-size 0)))
+           (grob-stem-thickness (ly:grob-property stem-grob 'thickness))
+           (line-thickness (ly:output-def-lookup layout 'line-thickness))
+           (half-stem-thickness (/ (* grob-stem-thickness line-thickness) 2))
+           (raw-length (if stem-up upflag-length downflag-length))
+           (angle (if stem-up upflag-angle downflag-angle))
+           (flag-length (+ (* raw-length factor) half-stem-thickness))
+           (flag-end (polar->rectangular flag-length angle))
+           (thickness (* flag-thickness factor))
+           (thickness-offset (cons 0 (* -1 thickness dir)))
+           (spacing (* -1 flag-spacing factor dir ))
+           (start (cons (- half-stem-thickness) (* half-stem-thickness dir)))
+           ; The points of a round-filled-polygon need to be given in clockwise
+           ; order, otherwise the polygon will be enlarged by blot-size*2!
+           (points (if stem-up (list start flag-end
+                                     (offset-add flag-end thickness-offset)
+                                     (offset-add start thickness-offset))
+                               (list start
+                                     (offset-add start thickness-offset)
+                                     (offset-add flag-end thickness-offset)
+                                     flag-end)))
+           (stencil (ly:round-filled-polygon points half-stem-thickness))
+           ; Log for 1/8 is 3, so we need to subtract 3
+           (flag-stencil (buildflag stencil (- log 3) stencil spacing))
+           (stroke-style (ly:grob-property stem-grob 'stroke-style)))
+    (if (equal? stroke-style "grace")
+      (add-stroke-straight flag-stencil stem-grob
+                           dir log
+                           stroke-style
+                           flag-end flag-length
+                           thickness
+                           (* half-stem-thickness 2))
+      flag-stencil))))
+
+(define-public (modern-straight-flag stem-grob)
+  "Modern straight flag style (for composers like Stockhausen, Boulez, etc.).
+   The angles are 18 and 22 degrees and thus smaller than for the ancient style
+   of Bach etc."
+  ((straight-flag 0.55 1 -18 1.1 22 1.2) stem-grob))
+
+(define-public (old-straight-flag stem-grob)
+  "Old straight flag style (for composers like Bach). The angles of the flags
+   are both 45 degrees."
+  ((straight-flag 0.55 1 -45 1.2 45 1.4) stem-grob))
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
index 5e713e5d712258f89523db347471dda98e861d35..e4da9f08d4a17b1e32cb55ffa310d91be17bc416 100644 (file)
@@ -6,6 +6,7 @@
 
 (define (fret-parse-marking-list marking-list fret-count)
   (let* ((fret-range (list 1 fret-count))
+         (capo-fret 0)
          (barre-list '())
          (dot-list '())
          (xo-list '())
               (set! xo-list (cons* my-item xo-list)))
              ((eq? my-code 'barre)
               (set! barre-list (cons* (cdr my-item) barre-list)))
+             ((eq? my-code 'capo)
+               (set! capo-fret (cadr my-item)))
              ((eq? my-code 'place-fret)
               (set! dot-list (cons* (cdr my-item) dot-list))))
             (parse-item (cdr mylist)))))
     ;; calculate fret-range
-    (let ((maxfret 0) (minfret 99))
+    (let ((maxfret 0) 
+          (minfret (if (> capo-fret 0) capo-fret 99)))
       (let updatemax ((fret-list dot-list))
         (if (null? fret-list)
             '()
                 (list minfret
                       (let ((upfret (- (+ minfret fret-count) 1)))
                         (if (> maxfret upfret) maxfret upfret)))))
+      (set! capo-fret (1+ (- capo-fret minfret)))
       ; subtract fret from dots
       (set! dot-list (subtract-base-fret (- (car fret-range) 1) dot-list)))
     (acons 'fret-range fret-range
            (acons 'barre-list barre-list
                   (acons 'dot-list dot-list
-                         (acons 'xo-list xo-list '()))))))
+                         (acons 'xo-list xo-list 
+                                (acons 'capo-fret capo-fret '())))))))
 
 (define (subtract-base-fret base-fret dot-list)
   "Subtract @var{base-fret} from every fret in @var{dot-list}"
@@ -141,6 +147,26 @@ fret & string spacing by @var{size}. Orientation is given by @var{orientation}"
         (ly:make-stencil (list 'round-filled-box y1 y2 x1 x2 sth)
                          y-extent x-extent))))
 
+(define (draw-capo details string-count fret fret-count th size 
+                   dot-pos orientation)
+  "Draw a capo indicator across the full width of the fret-board
+   at fret capo-fret."
+  (let* ((sth (* th size))
+         (capo-thick
+           (* size (assoc-get 'capo-thickness details 0.5)))
+         (half-thick (* capo-thick 0.5))
+         (last-string-pos 0)
+         (first-string-pos (* size (- string-count 1)))
+         (fret-pos ( * size (if (eq? orientation 'normal)
+                                (+ 2 (- fret-count fret dot-pos))
+                                (1- (+ dot-pos fret))))))
+    (if (eq? orientation 'normal)
+        (make-line-stencil capo-thick 
+         last-string-pos fret-pos first-string-pos fret-pos)
+        (make-line-stencil capo-thick
+         fret-pos last-string-pos fret-pos first-string-pos))))
+
+
 (define (draw-frets fret-range string-count th size orientation)
   "Draw the fret lines for a fret diagram with
 @var{string-count} strings and frets as indicated in @var{fret-range}.
@@ -426,7 +452,7 @@ Line thickness is given by @var{th}, fret & string spacing by
         (* size (+ 1 label-vertical-offset)) X))))
 
 (define-builtin-markup-command (fret-diagram-verbose layout props marking-list)
-  (list?) ; argument type
+  (pair?) ; argument type (list, but use pair? for speed)
   instrument-specific-markup ; markup type
   ((align-dir -0.4) ; properties and defaults
    (size 1.0)
@@ -458,6 +484,11 @@ Place a small @q{o} at the top of string @var{string-number}.
 Place a barre indicator (much like a tie) from string @var{start-string}
 to string @var{end-string} at fret @var{fret-number}.
 
+@item (capo @var{fret-number})
+Place a capo indicator (a large solid bar) across the entire fretboard
+at fret location @var{fret-number}.  Also, set fret @var{fret-number}
+to be the lowest fret on the fret diagram.
+
 @item (place-fret @var{string-number} @var{fret-number} @var{finger-value})
 Place a fret playing indication on string @var{string-number} at fret
 @var{fret-number} with an optional fingering label @var{finger-value}.
@@ -519,6 +550,7 @@ indications per string.
          (label-space (* 0.25 size))
          (label-dir (assoc-get 'label-dir details RIGHT))
          (parameters (fret-parse-marking-list marking-list fret-count))
+         (capo-fret (assoc-get 'capo-fret parameters 0))
          (dot-list (cdr (assoc 'dot-list parameters)))
          (xo-list (cdr (assoc 'xo-list parameters)))
          (fret-range (cdr (assoc 'fret-range parameters)))
@@ -569,6 +601,12 @@ indications per string.
                   (draw-xo layout props string-count fret-range
                            size xo-list orientation)
                   xo-padding))))
+    (if (> capo-fret 0)
+        (set! fret-diagram-stencil
+              (ly:stencil-add
+                fret-diagram-stencil
+                (draw-capo details string-count capo-fret fret-count
+                           th size dot-position orientation))))
     (if (> (car fret-range) 1)
        (set! fret-diagram-stencil
              (if (eq? orientation 'normal)
index b93eddaa9ac3d00d089d6b0dbb4987fcd6a83ee0..9b813a55665a6507c855a89318290df1c0523597 100644 (file)
@@ -250,6 +250,7 @@ centered, X==1 is at the right, X == -1 is at the left."
     ("" . ("" . ""))
     (":" . (":" . ""))
     ("." . ("." . ()))
+    ("'" . ("'" . ()))
     ("empty" . (() . ()))
     ("brace" . (() . "brace"))
     ("bracket" . (() . "bracket")) 
index 7040add95ee10eb3d0258f30a23a0651f5cc29aa..c08aa07a8eba0c6a428770b6769b7387a0a774b7 100644 (file)
@@ -7,62 +7,40 @@
 
 (define-public (parse-terse-string terse-definition)
 "Parse a fret-diagram-terse definition string @code{terse-definition} and
-return a marking list, which can be used as with a fretboard grob."
+return a marking list, which can be used with a fretboard grob."
    (cdr (fret-parse-terse-definition-string (list '()) terse-definition)))
 
-(define-public (get-chord-shape shape-code base-chord-shapes)
-"Return the chord shape associated with key @code{shape-code} in
-the alist @code{base-chord-shapes}."
-   (assoc-get shape-code base-chord-shapes #f))
-
-(define-public (offset-fret fret-offset terse-string)
-"Add @code{fret-offset} to each fret indication in @code{terse-string}
-and return the resulting fret-diagram-terse definition string."
-
-   (define (split-fretstring fret-string)
-     (map (lambda (x) (split-item x))
-          (string-split fret-string #\sp )))
-
-   (define (split-item item-string)
-     (string-split item-string #\- ))
-
-   (define (split-terse-string terse-string)
-      (let ((long-list
-               (string-split terse-string #\;)))
-        (map (lambda (x) (split-fretstring x))
-           (list-head long-list (1- (length long-list))))))
-
-   (define (join-terse-string terse-string-list)
-     (string-join
-        (map (lambda (x) (join-fretstring x)) terse-string-list)
-        ";" 'suffix))
-
-   (define (join-item item-list)
-     (string-join item-list "-" ))
-
-   (define (join-fretstring fretstring-list)
-     (string-join
-       (map (lambda (x) (join-item x)) fretstring-list)
-       " " ))
-
-  (define (add-item-fret-offset fret-offset item-list)
-     (let ((fretval (string->number (car item-list))))
-       (if fretval
-           (cons (number->string (+ fretval fret-offset))
-                 (cdr item-list))
-           item-list)))
-
-  (define (add-fretstring-fret-offset fret-offset fretstring-list)
-    (map (lambda (x) (add-item-fret-offset fret-offset x))
-         fretstring-list))
-
-  (define (add-terse-fret-offset fret-offset terse-string-list)
-    (map (lambda (x) (add-fretstring-fret-offset fret-offset x))
-         terse-string-list))
-
-;; body
-  (join-terse-string
-    (add-terse-fret-offset
-      fret-offset
-      (split-terse-string terse-string))))
+(define-public (get-chord-shape shape-code tuning base-chord-shapes)
+"Return the chord shape associated with @code{shape-code} and
+@code{tuning} in the hash-table @code{base-chord-shapes}."
+  (let ((hash-handle (hash-get-handle base-chord-shapes
+                                       (cons shape-code tuning))))
+     (if hash-handle
+         (cdr hash-handle)
+         '())))
+
+(define-public (offset-fret fret-offset diagram-definition)
+"Add @code{fret-offset} to each fret indication in @code{diagram-definition}
+and return the resulting verbose fret-diagram-definition."
+   (let ((verbose-definition 
+           (if (string? diagram-definition)
+               (parse-terse-string diagram-definition)
+               diagram-definition)))
+     (map (lambda(item) 
+            (let ((code (car item)))
+              (cond
+                ((eq? code 'barre)
+                  (list-set! item 3
+                     (+ fret-offset (list-ref item 3)))
+                  item)
+                ((eq? code 'capo)
+                  (list-set! item 1
+                     (+ fret-offset (list-ref item 1)))
+                  item)
+                ((eq? code 'place-fret)
+                  (list-set! item 2
+                     (+ fret-offset (list-ref item 2)))
+                  item)
+                (else item))))
+            verbose-definition)))