]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge branch 'master' of git://git.sv.gnu.org/lilypond
authorMats Bengtsson <mats.bengtsson@s3.kth.se>
Thu, 3 May 2007 12:37:46 +0000 (14:37 +0200)
committerMats Bengtsson <mats.bengtsson@s3.kth.se>
Thu, 3 May 2007 12:37:46 +0000 (14:37 +0200)
84 files changed:
Documentation/de/user/tweaks.itely
Documentation/topdocs/INSTALL.texi
Documentation/user/advanced-notation.itely
VERSION
buildscripts/html-gettext.py
buildscripts/langdefs.py
input/lsr/GNUmakefile
input/lsr/ancient/ancient-fonts.ly [new file with mode: 0644]
input/lsr/ancient/mensural-ligatures.ly [new file with mode: 0644]
input/lsr/ancient/mensural-note-heads.ly [new file with mode: 0644]
input/lsr/connecting/altering-the-number-of-stems-in-a-beam.ly [new file with mode: 0644]
input/lsr/connecting/alternating-beam-directions.ly [new file with mode: 0644]
input/lsr/connecting/controlling-manually-beam-positions.ly [new file with mode: 0644]
input/lsr/connecting/overriding-the-automatic-beamer.ly [new file with mode: 0644]
input/lsr/expressive/setting-the-control-points-of-a-slur-manually.ly [new file with mode: 0644]
input/lsr/expressive/setting-the-minimum-length-of-a-slur-to-separate-notes.ly [new file with mode: 0644]
input/lsr/guitar/fret-diagrams.ly [new file with mode: 0644]
input/lsr/scheme/adding-extra-fingering-with-scheme.ly [new file with mode: 0644]
input/lsr/scheme/adding-staccato-dots.ly [new file with mode: 0644]
input/lsr/scheme/drawing-boxes-around-grobs.ly [new file with mode: 0644]
input/lsr/scheme/engraving-music-using-scheme-expressions.ly [new file with mode: 0644]
input/lsr/scheme/engraving-symmetric-or-palindromical-music.ly [new file with mode: 0644]
input/lsr/staff/AAA-intro-advanced.ly
input/lsr/staff/adding-an-extra-staff.ly [new file with mode: 0644]
input/lsr/staff/changing-the-number-of-lines-in-a-staff.ly [new file with mode: 0644]
input/lsr/staff/displaying-bar-numbers-on-all-measures.ly [new file with mode: 0644]
input/lsr/staff/inserting-bar-lines-everywhere.ly [new file with mode: 0644]
input/lsr/staff/making-bar-numbers-appear-at-regular-intervals.ly [new file with mode: 0644]
input/lsr/staff/naming-a-whole-grandstaff.ly [new file with mode: 0644]
input/lsr/staff/removing-the-key-signature-at-the-end-of-a-line.ly [new file with mode: 0644]
input/lsr/staff/staff-line-positions.ly
input/lsr/text/embedding-postscript.ly [new file with mode: 0644]
input/lsr/vocal/displaying-bar-lines-on-lyrics.ly [new file with mode: 0644]
input/regression/break-alignment-anchor-alignment.ly
input/regression/break-alignment-anchors.ly
input/regression/rehearsal-mark-align-priority.ly [new file with mode: 0644]
input/regression/rehearsal-mark-align.ly
input/test/add-staccato.ly [deleted file]
input/test/add-text-script.ly [deleted file]
input/test/ambitus-mixed.ly [deleted file]
input/test/ancient-font.ly [deleted file]
input/test/ancient-time.ly [deleted file]
input/test/bar-always.ly [deleted file]
input/test/bar-lines-lyric-only.ly [deleted file]
input/test/bar-number-every-five-reset.ly [deleted file]
input/test/bar-number-show-all.ly [deleted file]
input/test/beam-alternate.ly [deleted file]
input/test/beam-auto-4-8.ly [deleted file]
input/test/beam-auto-override.ly [deleted file]
input/test/beam-control.ly [deleted file]
input/test/beam-count.ly [deleted file]
input/test/boxed-stencil.ly [deleted file]
input/test/extra-staff.ly [deleted file]
input/test/fret-diagram.ly [deleted file]
input/test/instrument-name-grandstaff.ly [deleted file]
input/test/mensural-ligatures.ly [deleted file]
input/test/mensural-note-heads.ly [deleted file]
input/test/no-key-at-end-of-line.ly [deleted file]
input/test/reverse-music.ly [deleted file]
input/test/slur-manual.ly [deleted file]
input/test/slur-minimum-length.ly [deleted file]
input/test/staff-lines.ly [deleted file]
input/tolsr/GNUmakefile
input/tolsr/expressive/GNUmakefile [new file with mode: 0644]
input/tolsr/parts/GNUmakefile [new file with mode: 0644]
input/tolsr/text/GNUmakefile [new file with mode: 0644]
lily/break-alignment-interface.cc
lily/include/break-align-interface.hh
lily/include/item.hh
lily/item.cc
lily/ttf.cc
mf/parmesan-accidentals.mf
mf/parmesan-clefs.mf
mf/parmesan-custodes.mf
mf/parmesan-flags.mf
mf/parmesan-generic.mf
mf/parmesan-heads.mf
mf/parmesan-scripts.mf
mf/parmesan-timesig.mf
po/lilypond.pot
python/convertrules.py
scm/define-grob-properties.scm
scm/define-grobs.scm
scm/output-lib.scm

index cdb443b845f81ef882fb3c5d4f18b6c98243b1b1..d45c1da16bcce0360e3b488cb36653d76db219b9 100644 (file)
@@ -482,7 +482,7 @@ Scheme genommen werden. Eine vollständige Erklärung findet sich in der
  @ref{Scheme tutorial} und den
 @ref{Interfaces for programmers}.
 
-Scheme kann benutzt werden, um einfach nur Befehle zu \qq{überschreiben} 
+Scheme kann benutzt werden, um einfach nur Befehle zu @qq{überschreiben} 
 (@code{\override}):
 
 @lilypond[quote,verbatim,ragged-right]
index ed45e4c79b925fb0fc50aa03ad54407472a3ff4e..0b6873ad7ad8da718286caee4e388f9a90400518 100644 (file)
@@ -54,6 +54,7 @@ Check out @uref{http://lilypond.org/web/install/} for up to date
 information on binary packages for your platform.
 
 
+
 @section Requirements
 
 @subsection Compilation
@@ -121,8 +122,13 @@ software
 @item @uref{http://www.python.org,Python} (version 2.4 or newer).
 @item @uref{http://www.ghostscript.com,Ghostscript} (version 8.15 or
 newer. 8.50 recommended)
+@item Dejaview.  (This is normally installed by default)
 @end itemize
 
+International fonts are required to create music with international text
+or lyrics.
+
+
 @subsection Building documentation
 
 You can view the documentation online at
@@ -357,7 +363,50 @@ or
 @end example
 @end quotation
 
+@item FreeBSD
+
+To use system fonts, dejaview must be installed.  With the default
+port, the fonts are installed in @file{usr/X11R6/lib/X11/fonts/dejavu}.
+
+Open the file @file{$LILYPONDBASE/usr/etc/fonts/local.conf} and add the
+following line just after the @code{<fontconfig>} line.  (Adjust as necessary
+for your hierarchy.)
+
+@example
+<dir>/usr/X11R6/lib/X11/fonts</dir>
+@end example
+
 @end itemize
 
+
+@section International fonts
+
+On MacOs X, all fonts are installed by default.  However, finding all
+system fonts requires a bit of configuration; see
+@uref{http://lists.gnu.org/archive/html/lilypond-user/2007-03/msg00472.html,
+this post} on the @code{lilypond-user} mailing list.
+
+On Linux, international fonts are installed by different means on
+every distribution.  We cannot list the exact commands or packages
+that are necessary, as each distribution is different, and the exact
+package names within each distribution changes.  Here are some
+hints, though:
+
+@verbatim
+Red Hat Fedora
+
+    taipeifonts fonts-xorg-truetype ttfonts-ja fonts-arabic \
+         ttfonts-zh_CN fonts-ja fonts-hebrew 
+
+Debian GNU/Linux
+
+   apt-get install emacs-intl-fonts xfonts-intl-.* \
+        ttf-kochi-gothic ttf-kochi-mincho \
+        xfonts-bolkhov-75dpi xfonts-cronyx-100dpi xfonts-cronyx-75dpi 
+@end verbatim
+
+
+
+
 @bye
 
index ea29be155571f6b6f24e7d84411d7a04a963a170..4e832b51e068cf217dd14e41bcf591fada7032b7 100644 (file)
@@ -1050,7 +1050,7 @@ definition of @code{format-mark-numbers} and
 @code{format-mark-letters}.  They can be used as inspiration for other
 formatting functions.
 
-Examples: @lsr{preparing,rehearsal-mark-numbers.ly}
+Examples: @lsr{parts,rehearsal-mark-numbers.ly}
 
 
 @node Bar numbers
@@ -1393,7 +1393,7 @@ a piece of music with multiple @code{\tag} entries,
 
 @seealso
 
-Examples: @lsr{preparing,tag@/-filter@/.ly}
+Examples: @lsr{parts,tag@/-filter@/.ly}
 
 
 @refbugs
@@ -2581,9 +2581,44 @@ This only functions inside chords, even for single notes
 @node Grid lines
 @subsection Grid lines
 
-@c FIXME: get an example for grid lines.  -gp
 Vertical lines can be drawn between staves synchronized with
 the notes.
 
+@lilypond[ragged-right,quote,verbatim]
+\layout {
+  \context {
+    \Staff
+    \consists "Grid_point_engraver" %% sets of grid
+    gridInterval = #(ly:make-moment 1 4)
+  }
+}
+
+\new Score \with {
+  \consists "Grid_line_span_engraver"
+  %% centers grid lines  horizontally below noteheads
+  \override NoteColumn #'X-offset = #-0.5
+}
+
+\new ChoirStaff <<
+  \new Staff {
+    \stemUp
+    \relative {
+      c'4. d8 e8 f g4
+    }
+  }
+  \new Staff {
+    %% centers grid lines  vertically
+    \override Score.GridLine #'extra-offset = #'( 0.0 . 1.0 )
+    \stemDown
+    \clef bass
+    \relative c {
+      c4  g'  f  e
+    }
+  }
+>>
+@end lilypond
+
 Examples: @inputfileref{input/@/regression,grid@/-lines@/.ly}.
 
+
+
diff --git a/VERSION b/VERSION
index ff50c35689289a183adbd9f6757efebeb99da4d5..4e5d522af7c8415fdca00b23bab352955d258a3b 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,6 +1,6 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=2
 MINOR_VERSION=11
-PATCH_LEVEL=22
+PATCH_LEVEL=23
 MY_PATCH_LEVEL=
 
index 7ac33dccc3984f95967ac268e2eb32b23e76f426..1aebf6ca34eba02f92f837a2df039afb96bfa594 100644 (file)
@@ -91,6 +91,7 @@ for filename in args[3:]:
        page = re.sub (r'<a href="../music-glossary/(.+?)">(.+?)</a>', rglos_gettext, page)
        for w in ('Next:', 'Previous:', 'Up:'):
                page = re.sub (w, _(w), page)
+       page = langdefs.LANGDICT[lang].html_filter (page)
        f = open (os.path.join (outdir, filename), 'w')
        f.write (page)
        f.close ()
index 915d5087ed5ebc39750353f007fce978e849f469..6886a60347d1ce88b9004ed9eead390336d112e0 100644 (file)
@@ -4,6 +4,8 @@
 Documentation i18n module
 """
 
+import re
+
 def _ (s):
     return s
 
@@ -13,7 +15,7 @@ def lang_file_name (p, langext, ext):
     return p + ext
 
 class LanguageDef:
-    def __init__ (self, code, name, webext=None, double_punct_char_sep=''):
+    def __init__ (self, code, name, webext=None, double_punct_char_sep='', html_filter=lambda s: s):
         self.code = code
         self.name = name
         self.enabled = True
@@ -22,6 +24,7 @@ class LanguageDef:
         else:
             self.webext = webext
         self.double_punct_char_sep = double_punct_char_sep
+        self.html_filter = html_filter
     
     def file_name (self, prefix, ext):
         return lang_file_name (prefix, self.webext, ext)
@@ -32,7 +35,20 @@ class LanguageDef:
 # translated in 'ab', there should be an entry in LANGUAGES.
 
 site = LanguageDef ('en', _('English'), webext='')
-fr = LanguageDef ('fr', _('French'), double_punct_char_sep='&nbsp;')
+
+html_page_body = re.compile ('</?body>', re.M | re.I)
+french_html_typo_rules = ((' :', '&nbsp;:'),
+                          (' ;', '&nbsp;;'),
+                          (' ?', '&thinsp;?'),
+                          (' !', '&thinsp;!'))
+
+def french_html_filter (page):
+    parts = html_page_body.split (page)
+    for r in french_html_typo_rules:
+        parts[1] = parts[1].replace (r[0], r[1])
+    return parts[0] + '<body>' + parts[1] + '</body>' + parts[2]
+
+fr = LanguageDef ('fr', _('French'), double_punct_char_sep='&nbsp;', html_filter = french_html_filter)
 es = LanguageDef ('es', _('Spanish') )
 de = LanguageDef ('de', _('German') )
 #nl = LanguageDef ('nl', 'Nederlands')
index 02403e059ac56ad9c49bdbac1ef2cdf28f800206..3b0f6f1b933fc86a6bb3f6013cfe9322d8bf61db 100644 (file)
@@ -1,6 +1,6 @@
 depth = ../../
 
-SUBDIRS = ancient chords connecting contemporary guitar parts repeats spacing staff text vocal expressive
+SUBDIRS = ancient chords connecting contemporary guitar parts repeats spacing staff text vocal expressive scheme
 
 STEPMAKE_TEMPLATES=documentation texinfo tex
 LOCALSTEPMAKE_TEMPLATES=lilypond ly lysdoc
diff --git a/input/lsr/ancient/ancient-fonts.ly b/input/lsr/ancient/ancient-fonts.ly
new file mode 100644 (file)
index 0000000..5347e73
--- /dev/null
@@ -0,0 +1,295 @@
+%%  Do not edit this file; it is auto-generated from LSR!
+\version "2.10.12"
+
+\header { texidoc = "
+Here are shown many (all?) of the symbols that are included in
+LilyPond's support of ancient notation.
+
+
+" }
+
+upperStaff = \context GregorianStaff = "upperStaff" <<
+  \context GregorianVoice <<
+    \set Score.timing = ##f
+%   \set Score.forceAccidental = ##t %%%%%%%% FIXME: what happened to this property?
+
+    \override Staff.StaffSymbol  #'line-count = #4
+
+     \transpose c c {
+       \override Staff.KeySignature  #'style = #'vaticana
+       \override Staff.Accidental  #'style = #'vaticana
+       \override NoteHead  #'style = #'vaticana.punctum
+       \key es \major
+       \clef "vaticana-fa2"
+       c!1 des! e! f! ges!
+
+       \override NoteHead  #'style = #'vaticana.inclinatum
+       a! b! ces'
+       \override Staff.BarLine  #'bar-size = #3.0 \bar "|"
+%      \break % 1 (8*1)
+
+       \override NoteHead  #'style = #'vaticana.quilisma
+       b! des'! ges! fes!
+       \breathe
+       \clef "vaticana-fa1"
+       \override NoteHead  #'style = #'vaticana.plica
+       es d
+       \override NoteHead  #'style = #'vaticana.reverse-plica
+       c d
+       \override Staff.BarLine  #'bar-size = #3.0 \bar "|"
+%      \break %2 (8*1)
+
+       \override NoteHead  #'style = #'vaticana.punctum-cavum
+       es f
+       \override NoteHead  #'style = #'vaticana.lpes
+       g as
+       \override NoteHead  #'style = #'vaticana.upes
+       bes as
+       \override NoteHead  #'style = #'vaticana.vupes
+       g f
+       \override NoteHead  #'style = #'vaticana.linea-punctum
+       \override Staff.BarLine  #'bar-size = #2.0 \bar "|"
+%      \break % 3 (8*1)
+
+       es d
+       \override NoteHead  #'style = #'vaticana.epiphonus
+       c d
+       \override NoteHead  #'style = #'vaticana.cephalicus
+       es f
+
+       \override Staff.KeySignature  #'style = #'medicaea
+       \override Staff.Accidental  #'style = #'medicaea
+       \override Staff.Custos  #'style = #'medicaea
+       \override NoteHead  #'style = #'medicaea.punctum
+       \clef "medicaea-fa2"
+       ces! des!
+       \override Staff.BarLine  #'bar-size = #3.0 \bar "|"
+%      \break % 4 (8*1)
+
+       e! f! ges!
+       \clef "medicaea-do2"
+       \override NoteHead  #'style = #'medicaea.inclinatum
+       a! b! ces'!
+       \override NoteHead  #'style = #'medicaea.virga
+       b! a!
+       \override Staff.BarLine  #'bar-size = #3.0 \bar "|"
+%      \break % 5 (8*1)
+
+       ges! fes!
+       \clef "medicaea-fa1"
+       \override NoteHead  #'style = #'medicaea.rvirga
+       e! des! ces!
+
+       \override Staff.KeySignature  #'style = #'hufnagel
+       \override Staff.Accidental  #'style = #'hufnagel
+       \override Staff.Custos  #'style = #'hufnagel
+       \override NoteHead  #'style = #'hufnagel.punctum
+       \clef "hufnagel-fa2"
+       ces! des! es!
+       \override Staff.BarLine  #'bar-size = #3.0 \bar "|"
+%      \break % 6 (8*1)
+
+       fes! ges!
+       \clef "hufnagel-do2"
+       \override NoteHead  #'style = #'hufnagel.lpes
+       as! bes! ces'!
+       \override NoteHead  #'style = #'hufnagel.virga
+       bes! as!
+       \override Staff.BarLine  #'bar-size = #3.0 \bar "|"
+%      \break % 7 (8*1)
+
+       ges! fes!
+       \clef "hufnagel-do-fa"
+       \override NoteHead  #'style = #'hufnagel.punctum
+       es! des! ces! des! es! fes!
+       \bar "||"
+%      \break % 8 (8*1)
+
+       s32*1
+%      \break % 12 (32*1)
+    }
+  >>
+>>
+
+lowerStaff = \context MensuralStaff = "lowerStaff" <<
+  \context MensuralVoice <<
+    
+    % this is broken until further notice -- see refman
+    % \override Staff.StaffSymbol  #'line-count = #5
+    \applyOutput #'Staff #(outputproperty-compatibility (make-type-checker 'staff-symbol-interface) 'line-count 5)
+
+     \transpose c c {
+       \set autoBeaming = ##f
+       \override NoteHead  #'style = #'neomensural
+       \override Rest  #'style = #'neomensural
+       \key a \major
+
+% FIXME: lily crashes on some (invalid?) ligatures with:
+%   ERROR: In procedure gh_scm2int:
+%   ERROR: Wrong type argument in position 1: ()
+
+% FIXME: lily emits "Programming error: Infinity or NaN encountered"
+% on many ligatures such as BB.
+
+       cis'1 d'\breve gis'\breve e'\breve \[ e'\longa fis'\longa \]
+       \set Staff.forceClef = ##t
+       \clef "neomensural-c2"
+       cis1
+       \bar "|"
+%      \break % 2 (16*1)
+
+       \[ g\breve dis''\longa \]
+       b\breve \[ a\longa d\longa \]
+       \clef "petrucci-c2"
+%      \break % 4 (16*1)
+
+       fis1 ces1
+       \clef "petrucci-c2"
+       r\longa
+       \set Staff.forceClef = ##t
+       \clef "mensural-c2"
+       r\breve
+       \bar "|"
+%      \break % 5 (8*1)
+
+       r2
+       \clef "mensural-g"
+       r4 r8 r16 r16
+       \override NoteHead  #'style = #'mensural
+       \override Stem  #'flag-style = #'mensural
+       \override Stem  #'thickness = #1.0
+       \override Rest  #'style = #'mensural
+       \clef "petrucci-f"
+       c8 b, c16 b, c32 b, c64 b, c64 b,
+       d8 e  d16 e  d32 e  d64 e  d64 e
+       r\longa
+       \set Staff.forceClef = ##t
+       \clef "petrucci-f"
+       r\breve
+       \bar "|"
+%      \break % 6 (8*1)
+
+       r\breve 
+       \clef "mensural-f"
+       % FIXME: must set Stem flag-style to #'neomensural to avoid
+       % segmentation fault on r8/r16/r32.  (Strange: what has
+       % Stem flag-style to do with mensural rests?)
+       \override Stem  #'flag-style = #'neomensural
+       % FIXME: produces warnings about "flag `neomensurald4' (or 3) not found".
+       r2 r4 r8 r16 r16
+       \override Stem  #'flag-style = #'mensural
+       \set Staff.forceClef = ##t
+       \clef "mensural-f"
+       e\breve f g a1
+       \clef "mensural-g"
+%      \break % 7 (8*1)
+
+       \[ bes'!\longa a'!\longa c''!\longa \]
+       e'1 d' c' d' \bar "|"
+       \bar "|"
+%      \break % 9 (16*1)
+
+       bes'!\longa fis'!1 as'!1 ges'!\longa % lig
+       \set Staff.forceClef = ##t
+       \clef "mensural-g"
+       e'2 d' c' \bar "|"
+%      \break % 11 (16*1)
+
+       \set Staff.forceClef = ##t
+       \clef "petrucci-g"
+       c'2 d' e' f'
+       \clef "petrucci-g"
+       g' as'! bes'! cis''!
+       bes'! as'! gis'! fis'!
+       \set Staff.forceClef = ##t
+       \clef "mensural-g"
+       es'! des'! cis'!1 \bar "||"
+%      \break % 12 (8*1)
+    }
+  >>
+>>
+
+\paper {
+       line-thickness = #(/ staff-space 5.0)
+}
+
+\score {
+    \context Score <<
+       \upperStaff
+       \lowerStaff
+    >>
+    \layout {
+% do we want to keep these settings? -gp
+       line-width = 17.25\cm
+       textheight = 26.0\cm
+       indent = 0.0
+       \context {
+           \Score
+           \accepts MensuralStaff
+           \accepts GregorianStaff
+%          timing = ##f %%%%%%%% FIXME: this has no effect
+       }
+       \context {
+           \Voice
+           \name MensuralVoice
+           \alias Voice
+           \remove Ligature_bracket_engraver
+           \consists Mensural_ligature_engraver
+           \override NoteHead #'style = #'mensural
+%          \override Stem #'flag-style = #'mensural %%%%%%%% FIXME: this core dumps
+           \override Stem #'thickness = #1.0
+           \override Rest #'style = #'mensural
+           autoBeaming = ##f
+       }
+       \context {
+           \Voice
+           \name GregorianVoice
+           \alias Voice
+           \remove Ligature_bracket_engraver
+%          \consists Gregorian_ligature_engraver %%%%%%%% TODO: not yet implemented
+           \override NoteHead #'style = #'vaticana.punctum
+           autoBeaming = ##f
+       }
+       \context {
+           \Staff
+           \name MensuralStaff
+           \alias Staff
+           \accepts MensuralVoice
+           \consists Custos_engraver
+           \override TimeSignature #'style = #'mensural
+           \override KeySignature #'style = #'mensural
+           \override Accidental #'style = #'mensural
+           \override Custos #'style = #'mensural
+           \override Custos #'neutral-position = #3
+           \override Custos #'neutral-direction = #-1
+           clefGlyph = #"clefs.petrucci-c2"
+           clefPosition = #-2
+           clefOctavation = #0 
+       }
+       \context {
+           \Staff
+           \name GregorianStaff
+           \alias Staff
+           \accepts GregorianVoice
+           \consists Custos_engraver
+           \remove Time_signature_engraver
+           \override StaffSymbol #'thickness = #2.0
+           \override StaffSymbol #'line-count = #4
+           \override KeySignature #'style = #'vaticana
+           \override Accidental #'style = #'vaticana
+           \override Custos #'style = #'vaticana
+           \override Custos #'neutral-position = #4
+           \override Custos #'neutral-direction = #-1
+           clefGlyph = #"clefs.vaticana-do"
+           clefPosition = #1
+           clefOctavation = #0 
+       }
+       \context {
+           \RemoveEmptyStaffContext
+           \accepts MensuralVoice
+           \accepts GregorianVoice
+        }
+    }
+}
+
+
diff --git a/input/lsr/ancient/mensural-ligatures.ly b/input/lsr/ancient/mensural-ligatures.ly
new file mode 100644 (file)
index 0000000..6b8d634
--- /dev/null
@@ -0,0 +1,85 @@
+%%  Do not edit this file; it is auto-generated from LSR!
+\version "2.10.12"
+
+\header { texidoc = "
+In mensural ligatures, notes with ancient durations are printed in a
+tight manner. 
+" }
+
+% Note that the horizontal alignment of the fermatas is related to the
+% graphical width of the ligatures rather than the musical moment in time.
+% This is intended behaviour.
+
+voice =  \transpose c c' {
+  \set Score.timing = ##f
+  \set Score.defaultBarType = "empty"
+  g\longa c\breve a\breve f\breve d'\longa^\fermata
+  \bar "|"
+  \[
+    g\longa c\breve a\breve f\breve d'\longa^\fermata
+  \]
+  \bar "|"
+  e1 f1 a\breve g\longa^\fermata
+  \bar "|"
+  \[
+    e1 f1 a\breve g\longa^\fermata
+  \]
+  \bar "|"
+  e1 f1 a\breve g\longa^\fermata
+  \bar "||"
+}
+
+\paper {
+    line-thickness = \staff-space / 5.0
+}
+\score {
+    \context ChoirStaff <<
+       \new MensuralStaff <<
+           \context MensuralVoice <<
+               \voice
+           >>
+       >>
+       \new Staff <<
+           \context Voice <<
+               \voice
+           >>
+       >>
+    >>
+    \layout {
+       \context {
+           \Voice
+           \name MensuralVoice
+           \alias Voice
+           \remove Ligature_bracket_engraver
+           \consists Mensural_ligature_engraver
+           \override NoteHead #'style = #'mensural
+       }
+       \context {
+           \Staff
+           \name MensuralStaff
+           \alias Staff
+           \accepts MensuralVoice
+           \consists Custos_engraver
+           \override TimeSignature #'style = #'mensural
+           \override KeySignature #'style = #'mensural
+           \override Accidental #'style = #'mensural
+           \override Custos #'style = #'mensural
+           \override Custos #'neutral-position = #3
+           \override Custos #'neutral-direction = #-1
+           clefGlyph = #"clefs.petrucci-g"
+           clefPosition = #-2
+           clefOctavation = #-0
+       }
+       \context {
+           \RemoveEmptyStaffContext
+           \accepts MensuralVoice
+        }
+       \context {
+           \Score
+           \accepts MensuralStaff
+       }
+    }
+}
+
+
+
diff --git a/input/lsr/ancient/mensural-note-heads.ly b/input/lsr/ancient/mensural-note-heads.ly
new file mode 100644 (file)
index 0000000..03403fa
--- /dev/null
@@ -0,0 +1,18 @@
+%%  Do not edit this file; it is auto-generated from LSR!
+\version "2.10.12"
+
+\header { texidoc = "
+Mensural notes may also have note heads.  
+" }
+
+\score {
+        {
+       \relative c'' {
+               \override NoteHead  #'style = #'mensural
+               c\maxima*1/8
+               c\longa*1/4 c\breve*1/2 c1 c2 c4 c8 
+               }
+       }
+}
+
+
diff --git a/input/lsr/connecting/altering-the-number-of-stems-in-a-beam.ly b/input/lsr/connecting/altering-the-number-of-stems-in-a-beam.ly
new file mode 100644 (file)
index 0000000..f50e78a
--- /dev/null
@@ -0,0 +1,21 @@
+%%  Do not edit this file; it is auto-generated from LSR!
+\version "2.10.12"
+
+\header { texidoc = "
+You can alter the number of stems in a beam.  In this example, two sets
+of four 32nds are joined, as if they were 8th notes.
+
+
+
+" }
+
+\relative {
+  #(override-auto-beam-setting '(end * * * *)  1 4)
+  f32 g a b b a g f
+
+  f32 g a 
+  \set stemRightBeamCount = #1  b
+  \set stemLeftBeamCount = #1 b
+  a g f
+}
+
diff --git a/input/lsr/connecting/alternating-beam-directions.ly b/input/lsr/connecting/alternating-beam-directions.ly
new file mode 100644 (file)
index 0000000..be6c4dc
--- /dev/null
@@ -0,0 +1,32 @@
+%%  Do not edit this file; it is auto-generated from LSR!
+\version "2.10.12"
+
+\header { texidoc = "
+The eighth notes may be seemingly attached to different
+    beams, and the corresponding notes connected by ties. 
+    Such a situation may occur, for example, in the cello suites. 
+" }
+
+wipeNote = {
+    \once \override NoteHead #'transparent = ##t
+    \once \override Stem #'transparent = ##t 
+}
+\layout { raggedright = ##t }
+
+
+\relative c''<< {
+    c8[~
+       \wipeNote
+       c8
+       c8~
+       \wipeNote
+       c
+       c]~
+    \wipeNote
+    c\noBeam
+}\\
+   { s8 c8 [ s c s c] }
+
+   
+>>
+
diff --git a/input/lsr/connecting/controlling-manually-beam-positions.ly b/input/lsr/connecting/controlling-manually-beam-positions.ly
new file mode 100644 (file)
index 0000000..39bae6c
--- /dev/null
@@ -0,0 +1,25 @@
+%%  Do not edit this file; it is auto-generated from LSR!
+\version "2.10.12"
+
+\header { texidoc = "
+Beam positions may be controlled manually, by overriding the
+@code{positions} setting of the @code{Beam} grob.
+
+
+
+" }
+
+\score { 
+    \context Voice \relative c {
+       %% from upper staffline (position 4) to centre (position 0)
+       \override Beam  #'positions = #'(2 . 0)
+        c'8[ c] 
+       
+       %% from center to one above centre (position 2)
+       \override Beam  #'positions = #'(0 . 1)
+        c[ c]
+  }
+
+}
+
+
diff --git a/input/lsr/connecting/overriding-the-automatic-beamer.ly b/input/lsr/connecting/overriding-the-automatic-beamer.ly
new file mode 100644 (file)
index 0000000..3b8ab79
--- /dev/null
@@ -0,0 +1,47 @@
+%%  Do not edit this file; it is auto-generated from LSR!
+\version "2.10.12"
+
+\header { texidoc = "
+The auto-beamer, which can be overridden, will only engrave beams  that
+end before encountering of 
+
+
+* a rest,
+
+* another, manually entered beam, or
+
+* a bar line. 
+
+
+
+The @code{autoBeaming} can also be turned off.
+
+
+
+" }
+
+\score{
+     \relative c''{
+        #(override-auto-beam-setting '(end * * * *)  1 2)
+       \time 2/4
+       % one beam per measure
+       c8 c c c
+       c16 c c c c c c c
+       % from here on consider ending beam every 1/4 note
+       #(override-auto-beam-setting '(end * * * *) 1 4)
+
+       c8 c c c
+       % manually override autobeam with weird beaming
+       c8  c[ c] c
+       c8 c c r
+       c8 c c4
+       r8 c c c
+       % no autobeaming
+       \set autoBeaming = ##f
+       c8 c c c
+    }
+}
+
+
+
diff --git a/input/lsr/expressive/setting-the-control-points-of-a-slur-manually.ly b/input/lsr/expressive/setting-the-control-points-of-a-slur-manually.ly
new file mode 100644 (file)
index 0000000..677f392
--- /dev/null
@@ -0,0 +1,44 @@
+%%  Do not edit this file; it is auto-generated from LSR!
+\version "2.10.12"
+
+\header { texidoc = "
+In extreme cases, you can resort to setting the 
+    @code{control-points} of a slur manually, althout it involves 
+    a lot of trial and error. Be sure to force line breaks at both sides,
+since
+    different horizontal spacing will require rearrangement of the
+    slur. 
+" }
+
+\score {
+     \new PianoStaff
+    <<
+       \context Staff = "up" {
+           \clef bass
+           s1 * 4
+       } 
+       \context Staff = "down" \relative c <<
+           s1*4
+           {
+           \clef bass
+           r4 r8
+           \once\override Slur  #'extra-offset = #'(0 . 6)
+           \once\override Slur  #'control-points =
+           #'((0 . -4) (2 . 0) (60 . 0) (63 . 4))
+           c8( as' f c' as
+
+           % line breaks will mess up this example  
+           \noBreak
+           f c as' f
+           \change Staff = up
+           \clef treble
+           c' as f' c
+           \noBreak
+           as' f c' as
+           f' c as' f c'4)
+       }>>
+    >>
+    \layout {  }
+}
+
+
diff --git a/input/lsr/expressive/setting-the-minimum-length-of-a-slur-to-separate-notes.ly b/input/lsr/expressive/setting-the-minimum-length-of-a-slur-to-separate-notes.ly
new file mode 100644 (file)
index 0000000..55469b8
--- /dev/null
@@ -0,0 +1,17 @@
+%%  Do not edit this file; it is auto-generated from LSR!
+\version "2.10.12"
+
+\header { texidoc = "
+By setting the minimum length of a slur, notes are more separated.  
+" }
+
+\score{
+       \relative c''{
+               \time 2/4
+               \override Slur  #'minimum-length = #40
+               c(c)
+               c~c\break
+               }
+}
+
+
diff --git a/input/lsr/guitar/fret-diagrams.ly b/input/lsr/guitar/fret-diagrams.ly
new file mode 100644 (file)
index 0000000..63cdd24
--- /dev/null
@@ -0,0 +1,54 @@
+%%  Do not edit this file; it is auto-generated from LSR!
+\version "2.10.12"
+
+\header { texidoc = "
+Frets are supported as markup commands. 
+" }
+
+\score {
+    <<
+       \chords {d2 d d s fis fis fis s c c c}
+
+     
+     \context Voice = "mel" {
+% simple D chord
+
+    d'2 ^\markup \fret-diagram-verbose #'((mute 6) (mute 5) (open 4) (place-fret 3 2) (place-fret 2 3) (place-fret 1 2))
+    d' ^\markup \fret-diagram #"6-x;5-x;4-o;3-2;2-3;1-2;"
+    d' ^\markup \fret-diagram-terse #"x;x;o;2;3;2;"
+    r 
+% fis major chord, 3/4 size, fingering labeled below string
+    
+    fis' ^\markup \override #'(size . 0.75) {\override #'(finger-code . below-string){\fret-diagram-verbose #'((place-fret 6 2 1) (barre 6 1 2) (place-fret 5 4 3) (place-fret 4 4 4) (place-fret 3 3 2) (place-fret 2 2 1) (place-fret 1 2 1))}}
+    fis' ^\markup \override #'(finger-code . below-string) {\fret-diagram #"s:0.75;c:6-1-2;6-2-1;5-4-3;4-4-4;3-3-2;2-2-1;1-2-1;"}
+    fis' ^\markup \override #'(size . 0.75) {\override #'(finger-code . below-string){\fret-diagram-terse #"2-1-(;4-3;4-4;3-2;2-1;2-1-);"}}
+    r 
+
+% c major barre chord, fingering labeled on frets
+   c' ^\markup \override #'(dot-color . white) {
+                \override #'(finger-code . in-dot) 
+                \fret-diagram-verbose #'((mute 6) (place-fret 5 3 1) (place-fret 4 5 2) (place-fret 3 5 3) (place-fret 2 5 4) (place-fret 1 3 1) (barre 5 1 3)) }
+   c' ^\markup \override #'(barre-type . straight) \fret-diagram #"f:1;c:5-1-3;6-x;5-3-1;4-5-2;3-5-3;2-5-4;1-3-1;"
+   c' ^\markup  \override #'(dot-radius . 0.35) {
+                \override #'(finger-code . in-dot) {
+                \override #'(dot-color . white) {
+                \fret-diagram-terse #"x;3-1-(;5-2;5-3;5-4;3-1-);"}}}
+   r  
+   
+% c major scale using open strings
+  c' ^\markup \fret-diagram-verbose #'((mute 6) (place-fret 5 3) (open 4) (place-fret 4 2) (place-fret 4 3) (open 3) (place-fret 3 2)  (open 2) (place-fret 2 1) (mute 1))
+  c' ^\markup \fret-diagram #'"6-x;5-3;4-o;4-2;4-3;3-o;3-2;2-o;2-1;1-x;"
+  c' ^\markup \fret-diagram-terse #'"x;3;2 3;o 2;o 1;x;"
+
+% c major scale using no open strings
+  c' ^\markup \fret-diagram-verbose #'((mute 6) (place-fret 5 3) (place-fret 5 5) (place-fret 4 2) (place-fret 4 3) (place-fret 4 5) (place-fret 3 2)  (place-fret 3 4) (place-fret 3 5) (mute 2) (mute 1))
+  c' ^\markup \fret-diagram #'"6-x;5-3;5-5;4-2;4-3;4-5;3-2;3-4;3-5;2-x;1-x;"
+  c' ^\markup \fret-diagram-terse #'"x;3 5;2 3 5;2 4 5;x;x;"
+  
+% g major scale, no open strings, two octaves on six strings, white dots
+  g' ^\markup \override #'(dot-color . white) {\fret-diagram-terse #'"3 5;2 3 5;2 4 5;2 4 5;3 5;2 3;" }
+  r r r}
+    >>
+}
diff --git a/input/lsr/scheme/adding-extra-fingering-with-scheme.ly b/input/lsr/scheme/adding-extra-fingering-with-scheme.ly
new file mode 100644 (file)
index 0000000..f091efc
--- /dev/null
@@ -0,0 +1,42 @@
+%%  Do not edit this file; it is auto-generated from LSR!
+\version "2.10.12"
+
+\header { texidoc = "
+You can add various stuff to notes using @code{make-music}. In this
+example, an extra fingering is attached to a note. 
+
+
+In general, first do a @code{display} of the music you want to create,
+then write a function that will structure the music for you.
+
+
+" }
+
+#(define (make-text-script x) 
+   (make-music 'TextScriptEvent
+               'direction DOWN
+               'text (make-simple-markup x)))
+
+#(define (add-text-script m x)
+   (if (equal? (ly:music-property m 'name) 'EventChord)
+       (set! (ly:music-property m 'elements)
+             (cons (make-text-script x)
+                  (ly:music-property m 'elements)))       
+       (let ((es (ly:music-property m 'elements))
+            (e (ly:music-property m 'element)))
+        (map (lambda (y) (add-text-script y x)) es)
+        (if (ly:music? e)
+            (add-text-script e x))))
+   m)
+
+addScript =
+#(define-music-function (parser location script music )
+                                       ( string? ly:music? )
+               (add-text-script music script))
+
+\score {
+  {
+    \addScript "6" { c'4-3 }
+  }
+}
+
diff --git a/input/lsr/scheme/adding-staccato-dots.ly b/input/lsr/scheme/adding-staccato-dots.ly
new file mode 100644 (file)
index 0000000..cd67102
--- /dev/null
@@ -0,0 +1,38 @@
+%%  Do not edit this file; it is auto-generated from LSR!
+\version "2.10.12"
+
+\header { texidoc = "
+Using @code{make-music}, you can add various stuff to notes. In this
+example staccato dots are added to the notes.  For this simple case, it
+is not necessary to use scm constructs.
+
+
+" }
+
+#(define (make-script x)
+   (make-music 'ArticulationEvent
+               'articulation-type x))
+
+#(define (add-script m x)
+   (if
+     (equal? (ly:music-property m 'name) 'EventChord)
+     (set! (ly:music-property m 'elements)
+           (cons (make-script x)
+                 (ly:music-property m 'elements))))
+   m)
+
+#(define (add-staccato m)
+   (add-script m "staccato"))
+
+addStacc =
+#(define-music-function (parser location music) 
+                                       (ly:music?)
+               (music-map add-staccato music))    
+
+\score {
+  \relative c'' {
+    a b \addStacc { c c } 
+  }
+  \layout{ ragged-right = ##t }
+}
+
diff --git a/input/lsr/scheme/drawing-boxes-around-grobs.ly b/input/lsr/scheme/drawing-boxes-around-grobs.ly
new file mode 100644 (file)
index 0000000..ebd73c5
--- /dev/null
@@ -0,0 +1,28 @@
+%%  Do not edit this file; it is auto-generated from LSR!
+\version "2.10.12"
+
+\header { texidoc = "
+The @code{print-function} can be overridden to draw a box around an
+arbitrary  grob.  
+" }
+
+\relative c''  {
+
+  \override TextScript  #'stencil =
+  #(make-stencil-boxer 0.1 0.3 ly:text-interface::print)
+
+  c'4^"foo"
+
+  \override Stem  #'stencil =
+  #(make-stencil-boxer 0.05 0.25 ly:stem::print)
+
+  \override Score.RehearsalMark  #'stencil =
+  #(make-stencil-boxer 0.15 0.3 ly:text-interface::print)
+  b8
+  \revert Stem #'stencil
+
+
+  c4. c4 \mark "F" c1
+}
+
+
diff --git a/input/lsr/scheme/engraving-music-using-scheme-expressions.ly b/input/lsr/scheme/engraving-music-using-scheme-expressions.ly
new file mode 100644 (file)
index 0000000..1350220
--- /dev/null
@@ -0,0 +1,30 @@
+%%  Do not edit this file; it is auto-generated from LSR!
+\version "2.10.12"
+
+\header { texidoc = "
+You can engrave music using just Scheme expressions. Although those 
+expressions reflect the inner mechanism of LilyPond, they are rather 
+clumsy to use, so avoid them, if possible.  
+" }
+
+#(define (make-note-req p d)
+   (make-music 'NoteEvent
+    'duration d
+    'pitch p))
+
+#(define (make-note elts)
+   (make-music 'EventChord
+    'elements elts))
+
+#(define (seq-music-list elts)
+   (make-music 'SequentialMusic
+    'elements elts))
+
+fooMusic = #(seq-music-list
+             (list (make-note (list (make-note-req (ly:make-pitch 1 0 0) (ly:make-duration 2 0))))
+                   (make-note (list (make-note-req (ly:make-pitch 1 1 0) (ly:make-duration 2 0))))))
+     
+\score { \fooMusic 
+}
+
+
diff --git a/input/lsr/scheme/engraving-symmetric-or-palindromical-music.ly b/input/lsr/scheme/engraving-symmetric-or-palindromical-music.ly
new file mode 100644 (file)
index 0000000..bec3fa7
--- /dev/null
@@ -0,0 +1,47 @@
+%%  Do not edit this file; it is auto-generated from LSR!
+\version "2.10.12"
+
+\header { texidoc = "
+Symmetric, or palindromical music can be produced, first, by printing
+some music, and second, by printing the same music applying a Scheme
+function to reverse the syntax.
+
+
+" }
+
+#(define (reverse-music music)
+  (let* ((elements (ly:music-property music 'elements))
+         (reversed (reverse elements))
+         (e (ly:music-property music 'element))
+         (span-dir (ly:music-property music 'span-direction)))
+
+    (ly:music-set-property! music 'elements reversed)
+
+    (if (ly:music? e)
+        (ly:music-set-property!
+         music 'element
+         (reverse-music e)))
+
+    (if (ly:dir? span-dir)
+        (ly:music-set-property! music 'span-direction (- span-dir)))
+
+    (map reverse-music reversed)
+
+    music))
+
+reverseMusic =
+#(define-music-function (parser location m) (ly:music?)
+               (reverse-music m)
+       )       
+
+music =  \relative c'' { c4 d4( e4 f4 }
+
+\score {
+\context Voice {
+    \music
+    \reverseMusic \music
+  }
+  \layout { ragged-right = ##t}
+}
+
+
index b907dd0d52873ec0f6bdc0b44916dc7137829959..48fe478494090bfda444381a331c5e538a5111d9 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.10.0"
+\version "2.11.15"
 %% +.ly: Be the first .ly file for lys-to-tely.py.
 %% Better to make lys-to-tely.py include "introduction.texi" or
 %% other .texi documents too?
diff --git a/input/lsr/staff/adding-an-extra-staff.ly b/input/lsr/staff/adding-an-extra-staff.ly
new file mode 100644 (file)
index 0000000..2cc8caa
--- /dev/null
@@ -0,0 +1,31 @@
+%%  Do not edit this file; it is auto-generated from LSR!
+\version "2.11.15"
+
+\header { texidoc = "
+You can add (possibly temporarily) an extra staff after the beginning
+of  a piece.  
+" }
+
+\score {
+       <<
+               \new Staff \relative c''{ c1 c c c c }
+               \new StaffGroup \relative c''{ 
+                       \new Staff 
+                       c1 c
+                       << c1 \new Staff { c1 } >>
+                       c
+               }
+       >>
+       \layout {
+               
+               \context{
+                       \Score
+
+               }
+       }
+}
+
+
+
+
+
diff --git a/input/lsr/staff/changing-the-number-of-lines-in-a-staff.ly b/input/lsr/staff/changing-the-number-of-lines-in-a-staff.ly
new file mode 100644 (file)
index 0000000..f4149b4
--- /dev/null
@@ -0,0 +1,32 @@
+%%  Do not edit this file; it is auto-generated from LSR!
+\version "2.11.15"
+
+\header { texidoc = "
+The number of lines in a staff may changed by overriding
+@code{line-count} in the properties of @code{StaffSymbol}.
+
+
+" }
+
+upper = \relative c'' {
+  c1 d e f
+}
+
+lower = \relative c {
+  c1 b a g
+}
+
+\score {
+  \context PianoStaff <<
+    \new Staff <<
+      \upper
+    >>  
+    \new Staff  {
+       \override Staff.StaffSymbol  #'line-count = #4 
+        \clef bass
+        \lower
+    }
+  >>
+
+}
+
diff --git a/input/lsr/staff/displaying-bar-numbers-on-all-measures.ly b/input/lsr/staff/displaying-bar-numbers-on-all-measures.ly
new file mode 100644 (file)
index 0000000..226ebb3
--- /dev/null
@@ -0,0 +1,24 @@
+%%  Do not edit this file; it is auto-generated from LSR!
+\version "2.11.15"
+
+\header { texidoc = "
+By default, bar numbers are printed only in the first measure.  This 
+setting can be overridden, so that bar numbers appear on start of every
+measure.
+
+
+" }
+
+\score{
+    \relative c'{
+       c1 c c
+       \override Score.BarNumber 
+           #'break-visibility = #end-of-line-invisible
+       \break
+       c c c
+    }
+       \layout{ raggedright = ##t }
+}
+
+
+
diff --git a/input/lsr/staff/inserting-bar-lines-everywhere.ly b/input/lsr/staff/inserting-bar-lines-everywhere.ly
new file mode 100644 (file)
index 0000000..7148fb5
--- /dev/null
@@ -0,0 +1,17 @@
+%%  Do not edit this file; it is auto-generated from LSR!
+\version "2.11.15"
+
+\header { texidoc = "
+By setting @code{barAlways} and @code{defaultBarType}, barlines may be
+inserted automatically everywhere. 
+" }
+
+\score {
+        \relative c''{
+               \set Score.barAlways = ##t
+               \set Score.defaultBarType = ":|:"
+               c4 c4 c4 c4 }
+       \layout{raggedright = ##t}
+}
+
+
diff --git a/input/lsr/staff/making-bar-numbers-appear-at-regular-intervals.ly b/input/lsr/staff/making-bar-numbers-appear-at-regular-intervals.ly
new file mode 100644 (file)
index 0000000..1084a0b
--- /dev/null
@@ -0,0 +1,31 @@
+%%  Do not edit this file; it is auto-generated from LSR!
+\version "2.11.15"
+
+\header { texidoc = "
+If you would like the bar numbers to appear at regular intervals, but
+not starting from measure zero, you can use a context function,
+@code{set-bar-number-visibility}, to set automatically
+@code{barNumberVisibility}, so that the bar numbers appear at regular
+intervals, starting from the measure in which 
+@code{set-bar-number-visibility} is set using @code{\applycontext}.
+
+
+" }
+
+resetBarnum = \context Score \applyContext
+  #(set-bar-number-visibility 4)
+\score {
+    <<
+         \transpose c c'' {
+           \override Score.BarNumber  #'break-visibility =#end-of-line-invisible
+           \override Score.RehearsalMark  #'padding = #2.5
+           \mark "A" \resetBarnum
+           \repeat unfold 10 c1
+           \mark \default \resetBarnum
+           \repeat unfold 8 c
+            \bar "|."
+        }
+    >>
+\layout{ragged-right = ##t}
+}
+
diff --git a/input/lsr/staff/naming-a-whole-grandstaff.ly b/input/lsr/staff/naming-a-whole-grandstaff.ly
new file mode 100644 (file)
index 0000000..355878e
--- /dev/null
@@ -0,0 +1,22 @@
+%%  Do not edit this file; it is auto-generated from LSR!
+\version "2.11.15"
+
+\header { texidoc = "
+You can have a name for the whole @code{GrandStaff} in addition to 
+individual @code{Staff}s.  
+" }
+
+\score {
+  
+   \context GrandStaff <<
+    \context Staff = "treble"    {
+      \set GrandStaff.instrumentName = "Violini  "
+      \set Staff.instrumentName = " vn I" { c''4 }}
+    \context Staff = "bass" { \set Staff.instrumentName = " vn II" c''4 }>>
+
+
+\layout {
+\context { \GrandStaff \consists "Instrument_name_engraver" }
+}}
+
+
diff --git a/input/lsr/staff/removing-the-key-signature-at-the-end-of-a-line.ly b/input/lsr/staff/removing-the-key-signature-at-the-end-of-a-line.ly
new file mode 100644 (file)
index 0000000..88abead
--- /dev/null
@@ -0,0 +1,21 @@
+%%  Do not edit this file; it is auto-generated from LSR!
+\version "2.11.15"
+
+\header { texidoc = "
+According to normal typesetting conventions, LilyPond typesets key
+changes at the end of the line, when the change appears at a line
+break. This example shows how to change this default to only print the
+new key signature at the beginning of the next line.
+
+
+" }
+
+\score {
+   \relative c' {
+    \set Staff.explicitKeySignatureVisibility = #end-of-line-invisible
+    c d e f | g a b c | \break
+    \key d \major
+    d cis b a | g fis e d |
+  }
+}
+
index a33e356662b96e1b225616ec9bf0201c4ddb083c..5e1b486d31196af16c06c2b37742efe668478cab 100644 (file)
@@ -1,5 +1,5 @@
 %%  Do not edit this file; it is auto-generated from LSR!
-\version "2.10.12"
+\version "2.11.15"
 
 \header { texidoc = "
 The vertical positions of staff lines may be specified individually, by
diff --git a/input/lsr/text/embedding-postscript.ly b/input/lsr/text/embedding-postscript.ly
new file mode 100644 (file)
index 0000000..7afcecc
--- /dev/null
@@ -0,0 +1,24 @@
+%%  Do not edit this file; it is auto-generated from LSR!
+\version "2.10.12"
+
+\header { texidoc = "
+By inserting the markup command @code{\postscript}, you can insert
+PostScript directly into the output.
+
+  
+
+" }
+
+\score {
+   \relative c'' {
+    a-\markup { \postscript #"3 4 moveto 5 3 rlineto stroke" }
+     -\markup { \postscript #"[ 0 1 ] 0 setdash 3 5 moveto 5 -3 rlineto stroke " }
+    
+    b-\markup { \postscript #"3 4 moveto 0 0 1 2 8 4 20 3.5 rcurveto stroke" }
+    s2
+    a'1
+  }
+  \layout { linewidth = 70 * 5 \pt }
+}
+
+
diff --git a/input/lsr/vocal/displaying-bar-lines-on-lyrics.ly b/input/lsr/vocal/displaying-bar-lines-on-lyrics.ly
new file mode 100644 (file)
index 0000000..ee92618
--- /dev/null
@@ -0,0 +1,41 @@
+%%  Do not edit this file; it is auto-generated from LSR!
+\version "2.10.12"
+
+\header { texidoc = "
+You can move @code{Bar_engraver} and @code{Span_bar_engraver} to  a
+different engraving context, if you want, for example, bar lines  on
+lyrics. 
+" }
+
+\score {
+    \relative c' \context ChoirStaff <<
+       \new Staff { c1 c1 c1}
+       \lyricmode <<
+           \new Lyrics  { bla1 die bla }
+       >>
+       \new Staff { c1 c1 c1} 
+    >>
+
+
+    \layout  {
+       raggedright = ##t
+       \context {
+           \Lyrics
+           \consists Bar_engraver
+
+
+           %% need procedure, since lyrics doesn't have a staff_sym engraver.
+           \override BarLine #'bar-size-procedure = #(lambda (x) 3.0)
+       }
+       \context{
+           \ChoirStaff
+           \remove "Span_bar_engraver"
+       }
+       \context {
+           \Staff
+           \remove "Bar_engraver"
+       }
+    }
+}
+
+
index b0925541c7f2038c14b908d8930a251b1873e951..980a1b46228faf326b6fc4ab0399b81caab111bf 100644 (file)
@@ -7,7 +7,7 @@ the anchor to the extent of the break-aligned grob."
 }
 
 {
-  \override Score.RehearsalMark #'break-align-symbol = #'key-signature
+  \override Score.RehearsalMark #'break-align-symbols = #'(key-signature)
   c1
   \key cis \major
   \once \override Staff.KeySignature #'break-align-anchor-alignment = #LEFT
index ced785dc15cd14fe60a7b7dc2fb1691c0e5aa881..ae62412baa2a189cc506e3ea64e88196b33cee96 100644 (file)
@@ -6,7 +6,7 @@ the horizontal offset at which other grobs should attach."
 }
 
 {
-  \override Score.RehearsalMark #'break-align-symbol = #'staff-bar
+  \override Score.RehearsalMark #'break-align-symbols = #'(staff-bar)
   c'1
   \once \override Staff.BarLine #'break-align-anchor = #-5
   \mark \default
diff --git a/input/regression/rehearsal-mark-align-priority.ly b/input/regression/rehearsal-mark-align-priority.ly
new file mode 100644 (file)
index 0000000..6b85f86
--- /dev/null
@@ -0,0 +1,32 @@
+
+\header {
+  texidoc = "When the break-align-symbols property is given as a list,
+  the alignment depends on which symbols are visible."
+}
+
+\version "2.11.22"
+  
+\relative {
+  \override Score.RehearsalMark #'break-align-symbols = #'(clef key-signature staff-bar)
+  c1
+  \clef "bass"
+  \mark "clef"
+  \noBreak
+
+  c1
+  \clef "treble"
+  \key g \major
+  \mark "clef"
+  \noBreak
+
+  c1
+  \key f \major
+  \mark "key"
+  \noBreak
+
+  c1
+  \mark "bar"
+  \noBreak
+
+  c1
+}
index 5238a3889efccb88457f9306e3ec1fe341d80195..d69e8385ece016adb52bb3b3cd6931ddff70bc37 100644 (file)
@@ -2,7 +2,7 @@
 \header {
 
   texidoc = "The rehearsal mark is put on top a breakable symbol,
-  according to the value of @code{break-align-symbol} value of the
+  according to the value of @code{break-align-symbols} value of the
   @code{RehearsalMark}. The same holds for @code{BarNumber} grobs."
 
 }
   c1
   \key cis \major
   \clef alto
-  \override Score.RehearsalMark #'break-align-symbol = #'key-signature
+  \override Score.RehearsalMark #'break-align-symbols = #'(key-signature)
   \mark "on-key"
   cis
   \key ces \major
-  \override Score.RehearsalMark #'break-align-symbol = #'clef
+  \override Score.RehearsalMark #'break-align-symbols = #'(clef)
   \clef treble
   \mark "on clef"
   ces
diff --git a/input/test/add-staccato.ly b/input/test/add-staccato.ly
deleted file mode 100644 (file)
index aee8985..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-\version "2.10.0"
-\sourcefilename "add-staccato.ly"
-
-\header {
-texidoc= "@cindex Add Stacato
-Using @code{make-music}, you can add various stuff to notes. In this
-example staccato dots are added to the notes."
-} 
-
-#(define (make-script x)
-   (make-music 'ArticulationEvent
-               'articulation-type x))
-
-#(define (add-script m x)
-   (if
-     (equal? (ly:music-property m 'name) 'EventChord)
-     (set! (ly:music-property m 'elements)
-           (cons (make-script x)
-                 (ly:music-property m 'elements))))
-   m)
-
-#(define (add-staccato m)
-   (add-script m "staccato"))
-
-addStacc =
-#(define-music-function (parser location music) 
-                                       (ly:music?)
-               (music-map add-staccato music))    
-
-\score {
-  \relative c'' {
-    a b \addStacc { c c } 
-  }
-  \layout{ ragged-right = ##t }
-}
-
diff --git a/input/test/add-text-script.ly b/input/test/add-text-script.ly
deleted file mode 100644 (file)
index c0ce18b..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-\version "2.10.0"
-\sourcefilename "add-text-script.ly"
-
-\header {
-texidoc= "@cindex make-music Fingering
-You can add various stuff to notes using @code{make-music}.
-In this example, an extra fingering is attached to a note. 
-"
-} 
-
-#(define (make-text-script x) 
-   (make-music 'TextScriptEvent
-               'direction DOWN
-               'text (make-simple-markup x)))
-
-#(define (add-text-script m x)
-   (if (equal? (ly:music-property m 'name) 'EventChord)
-       (set! (ly:music-property m 'elements)
-             (cons (make-text-script x)
-                  (ly:music-property m 'elements)))       
-       (let ((es (ly:music-property m 'elements))
-            (e (ly:music-property m 'element)))
-        (map (lambda (y) (add-text-script y x)) es)
-        (if (ly:music? e)
-            (add-text-script e x))))
-   m)
-
-addScript =
-#(define-music-function (parser location script music )
-                                       ( string? ly:music? )
-               (add-text-script music script))
-
-\score {
-  {
-    \addScript "6" { c'4-3 }
-  }
-}
-
diff --git a/input/test/ambitus-mixed.ly b/input/test/ambitus-mixed.ly
deleted file mode 100644 (file)
index c30b8cb..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-
-\header {
-
-    texidoc = "Ambits can be added per voice. In that case, the
-ambitus must be moved manually to prevent collisions."
-
-}
-
-\version "2.10.0"
-
-\layout {
-    ragged-right = ##t
-}
-
-\new Staff <<
-    \new Voice \with {
-       \consists "Ambitus_engraver"
-    } \relative c'' {
-       \override Ambitus #'X-offset = #-1.0
-       \voiceOne
-       c4 a d e f2
-    }
-    \new Voice \with {
-       \consists "Ambitus_engraver"
-    } \relative c' {
-       \voiceTwo
-       es4 f g as b2
-    }
->>
diff --git a/input/test/ancient-font.ly b/input/test/ancient-font.ly
deleted file mode 100644 (file)
index 6ac4481..0000000
+++ /dev/null
@@ -1,295 +0,0 @@
-\version "2.11.6"
-% TODO: split ancient-font into seperate files; possibly in
-% different locations.
-\header {
-texidoc = "@cindex Ancient Font
-Here are shown many (all?) of the symbols that are
-included in LilyPond's support of ancient notation.
-"
-}
-
-
-upperStaff = \new GregorianStaff =  "upperStaff" <<
-  \context GregorianVoice <<
-    \set Score.timing = ##f
-%   \set Score.forceAccidental = ##t %%%%%%%% FIXME: what happened to this property?
-
-    \override Staff.StaffSymbol  #'line-count = #4
-
-     \transpose c c {
-       \override Staff.KeySignature #'glyph-name-alist = #alteration-vaticana-glyph-name-alist
-       \override Staff.Accidental #'glyph-name-alist = #alteration-vaticana-glyph-name-alist
-       \override NoteHead  #'style = #'vaticana.punctum
-       \key es \major
-       \clef "vaticana-fa2"
-       c!1 des! e! f! ges!
-
-       \override NoteHead  #'style = #'vaticana.inclinatum
-       a! b! ces'
-       \override Staff.BarLine  #'bar-size = #3.0 \bar "|"
-%      \break % 1 (8*1)
-
-       \override NoteHead  #'style = #'vaticana.quilisma
-       b! des'! ges! fes!
-       \breathe
-       \clef "vaticana-fa1"
-       \override NoteHead  #'style = #'vaticana.plica
-       es d
-       \override NoteHead  #'style = #'vaticana.reverse.plica
-       c d
-       \override Staff.BarLine  #'bar-size = #3.0 \bar "|"
-%      \break %2 (8*1)
-
-       \override NoteHead  #'style = #'vaticana.punctum.cavum
-       es f
-       \override NoteHead  #'style = #'vaticana.lpes
-       g as
-       \override NoteHead  #'style = #'vaticana.upes
-       bes as
-       \override NoteHead  #'style = #'vaticana.vupes
-       g f
-       \override NoteHead  #'style = #'vaticana.linea.punctum
-       \override Staff.BarLine  #'bar-size = #2.0 \bar "|"
-%      \break % 3 (8*1)
-
-       es d
-       \override NoteHead  #'style = #'vaticana.epiphonus
-       c d
-       \override NoteHead  #'style = #'vaticana.cephalicus
-       es f
-
-       \override Staff.KeySignature #'glyph-name-alist = #alteration-medicaea-glyph-name-alist
-       \override Staff.Accidental #'glyph-name-alist = #alteration-medicaea-glyph-name-alist
-       \override Staff.Custos  #'style = #'medicaea
-       \override NoteHead  #'style = #'medicaea.punctum
-       \clef "medicaea-fa2"
-       ces! des!
-       \override Staff.BarLine  #'bar-size = #3.0 \bar "|"
-%      \break % 4 (8*1)
-
-       e! f! ges!
-       \clef "medicaea-do2"
-       \override NoteHead  #'style = #'medicaea.inclinatum
-       a! b! ces'!
-       \override NoteHead  #'style = #'medicaea.virga
-       b! a!
-       \override Staff.BarLine  #'bar-size = #3.0 \bar "|"
-%      \break % 5 (8*1)
-
-       ges! fes!
-       \clef "medicaea-fa1"
-       \override NoteHead  #'style = #'medicaea.rvirga
-       e! des! ces!
-
-       \override Staff.KeySignature #'glyph-name-alist = #alteration-hufnagel-glyph-name-alist
-       \override Staff.Accidental #'glyph-name-alist = #alteration-hufnagel-glyph-name-alist
-       \override Staff.Custos  #'style = #'hufnagel
-       \override NoteHead  #'style = #'hufnagel.punctum
-       \clef "hufnagel-fa2"
-       ces! des! es!
-       \override Staff.BarLine  #'bar-size = #3.0 \bar "|"
-%      \break % 6 (8*1)
-
-       fes! ges!
-       \clef "hufnagel-do2"
-       \override NoteHead  #'style = #'hufnagel.lpes
-       as! bes! ces'!
-       \override NoteHead  #'style = #'hufnagel.virga
-       bes! as!
-       \override Staff.BarLine  #'bar-size = #3.0 \bar "|"
-%      \break % 7 (8*1)
-
-       ges! fes!
-       \clef "hufnagel-do-fa"
-       \override NoteHead  #'style = #'hufnagel.punctum
-       es! des! ces! des! es! fes!
-       \bar "||"
-%      \break % 8 (8*1)
-
-       s32*1
-%      \break % 12 (32*1)
-    }
-  >>
->>
-
-lowerStaff = \new MensuralStaff =  "lowerStaff" <<
-  \context MensuralVoice <<
-    
-    % this is broken until further notice -- see refman
-    % \override Staff.StaffSymbol  #'line-count = #5
-    \applyOutput #'Staff #(outputproperty-compatibility (make-type-checker 'staff-symbol-interface) 'line-count 5)
-
-     \transpose c c {
-       \set autoBeaming = ##f
-       \override NoteHead  #'style = #'neomensural
-       \override Rest  #'style = #'neomensural
-       \key a \major
-
-% FIXME: lily crashes on some (invalid?) ligatures with:
-%   ERROR: In procedure gh_scm2int:
-%   ERROR: Wrong type argument in position 1: ()
-
-% FIXME: lily emits "Programming error: Infinity or NaN encountered"
-% on many ligatures such as BB.
-
-       cis'1 d'\breve gis'\breve e'\breve \[ e'\longa fis'\longa \]
-       \set Staff.forceClef = ##t
-       \clef "neomensural-c2"
-       cis1
-       \bar "|"
-%      \break % 2 (16*1)
-
-       \[ g\breve dis''\longa \]
-       b\breve \[ a\longa d\longa \]
-       \clef "petrucci-c2"
-%      \break % 4 (16*1)
-
-       fis1 ces1
-       \clef "petrucci-c2"
-       r\longa
-       \set Staff.forceClef = ##t
-       \clef "mensural-c2"
-       r\breve
-       \bar "|"
-%      \break % 5 (8*1)
-
-       r2
-       \clef "mensural-g"
-       r4 r8 r16 r16
-       \override NoteHead  #'style = #'mensural
-       \override Stem  #'flag-style = #'mensural
-       \override Stem  #'thickness = #1.0
-       \override Rest  #'style = #'mensural
-       \clef "petrucci-f"
-       c8 b, c16 b, c32 b, c64 b, c64 b,
-       d8 e  d16 e  d32 e  d64 e  d64 e
-       r\longa
-       \set Staff.forceClef = ##t
-       \clef "petrucci-f"
-       r\breve
-       \bar "|"
-%      \break % 6 (8*1)
-
-       r\breve 
-       \clef "mensural-f"
-       % FIXME: must set Stem flag-style to #'neomensural to avoid
-       % segmentation fault on r8/r16/r32.  (Strange: what has
-       % Stem flag-style to do with mensural rests?)
-       \override Stem  #'flag-style = #'neomensural
-       % FIXME: produces warnings about "flag `neomensurald4' (or 3) not found".
-       r2 r4 r8 r16 r16
-       \override Stem  #'flag-style = #'mensural
-       \set Staff.forceClef = ##t
-       \clef "mensural-f"
-       e\breve f g a1
-       \clef "mensural-g"
-%      \break % 7 (8*1)
-
-       \[ bes'!\longa a'!\longa c''!\longa \]
-       e'1 d' c' d' \bar "|"
-       \bar "|"
-%      \break % 9 (16*1)
-
-       bes'!\longa fis'!1 as'!1 ges'!\longa % lig
-       \set Staff.forceClef = ##t
-       \clef "mensural-g"
-       e'2 d' c' \bar "|"
-%      \break % 11 (16*1)
-
-       \set Staff.forceClef = ##t
-       \clef "petrucci-g"
-       c'2 d' e' f'
-       \clef "petrucci-g"
-       g' as'! bes'! cis''!
-       bes'! as'! gis'! fis'!
-       \set Staff.forceClef = ##t
-       \clef "mensural-g"
-       es'! des'! cis'!1 \bar "||"
-%      \break % 12 (8*1)
-    }
-  >>
->>
-
-\paper {
-       line-thickness = #(/ staff-space 5.0)
-}
-
-\score {
-    \context Score <<
-       \upperStaff
-       \lowerStaff
-    >>
-    \layout {
-% do we want to keep these settings? -gp
-       line-width = 17.25\cm
-       textheight = 26.0\cm
-       indent = 0.0
-       \context {
-           \Score
-           \accepts MensuralStaff
-           \accepts GregorianStaff
-%          timing = ##f %%%%%%%% FIXME: this has no effect
-       }
-       \context {
-           \Voice
-           \name MensuralVoice
-           \alias Voice
-           \remove Ligature_bracket_engraver
-           \consists Mensural_ligature_engraver
-           \override NoteHead #'style = #'mensural
-%          \override Stem #'flag-style = #'mensural %%%%%%%% FIXME: this core dumps
-           \override Stem #'thickness = #1.0
-           \override Rest #'style = #'mensural
-           autoBeaming = ##f
-       }
-       \context {
-           \Voice
-           \name GregorianVoice
-           \alias Voice
-           \remove Ligature_bracket_engraver
-%          \consists Gregorian_ligature_engraver %%%%%%%% TODO: not yet implemented
-           \override NoteHead #'style = #'vaticana.punctum
-           autoBeaming = ##f
-       }
-       \context {
-           \Staff
-           \name MensuralStaff
-           \alias Staff
-           \accepts MensuralVoice
-           \consists Custos_engraver
-           \override TimeSignature #'style = #'mensural
-           \override KeySignature #'glyph-name-alist = #alteration-mensural-glyph-name-alist
-           \override Accidental #'glyph-name-alist = #alteration-mensural-glyph-name-alist
-           \override Custos #'style = #'mensural
-           \override Custos #'neutral-position = #3
-           \override Custos #'neutral-direction = #down
-           clefGlyph = #"clefs.petrucci.c2"
-           clefPosition = #-2
-           clefOctavation = #0 
-       }
-       \context {
-           \Staff
-           \name GregorianStaff
-           \alias Staff
-           \accepts GregorianVoice
-           \consists Custos_engraver
-           \remove Time_signature_engraver
-           \override StaffSymbol #'thickness = #2.0
-           \override StaffSymbol #'line-count = #4
-           \override KeySignature #'glyph-name-alist = #alteration-vaticana-glyph-name-alist
-           \override Accidental #'glyph-name-alist = #alteration-vaticana-glyph-name-alist
-           \override Custos #'style = #'vaticana
-           \override Custos #'neutral-position = #4
-           \override Custos #'neutral-direction = #down
-           clefGlyph = #"clefs.vaticana.do"
-           clefPosition = #1
-           clefOctavation = #0 
-       }
-       \context {
-           \RemoveEmptyStaffContext
-           \accepts MensuralVoice
-           \accepts GregorianVoice
-        }
-    }
-}
-
diff --git a/input/test/ancient-time.ly b/input/test/ancient-time.ly
deleted file mode 100644 (file)
index 31eae53..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-\version "2.10.0"
-% TODO: move stuff from ancient-font into here?  See comment
-% for ancient-font.ly
-\header {
-texidoc="@cindex Ancient Time Signatures
-Time signatures may also be engraved in an old style.
-"
-}
-
-\score {
-   { 
-    \override Staff.TimeSignature  #'style = #'neomensural
-    s1 
-  }
-       \layout {ragged-right = ##t}
-}
-
diff --git a/input/test/bar-always.ly b/input/test/bar-always.ly
deleted file mode 100644 (file)
index c1c58ef..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-
-\version "2.10.0"
-\header {
-
-    texidoc = "@cindex Bars Always
-
-By setting @code{barAlways} and @code{defaultBarType}, barlines may be inserted automatically everywhere."
-
-}
-
-
-\score {
-        \relative c''{
-               \set Score.barAlways = ##t
-               \set Score.defaultBarType = ":|:"
-               c4 c4 c4 c4 }
-       \layout{ragged-right = ##t}
-}
-
diff --git a/input/test/bar-lines-lyric-only.ly b/input/test/bar-lines-lyric-only.ly
deleted file mode 100644 (file)
index 13fa76e..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-\version "2.10.0"
-\header { texidoc = "@cindex Bar line lyric only
-You can move @code{Bar_engraver} and @code{Span_bar_engraver} to 
-a different engraving context, if you want, for example, bar lines 
-on lyrics. "
-}
-
-\score {
-    \relative c' \context ChoirStaff <<
-       \new Staff { c1 c1 c1}
-       \lyricmode <<
-           \new Lyrics  { bla1 die bla }
-       >>
-       \new Staff { c1 c1 c1} 
-    >>
-
-
-    \layout  {
-       ragged-right = ##t
-       \context {
-           \Lyrics
-           \consists Bar_engraver
-
-
-           %% need procedure, since lyrics doesn't have a staff_sym engraver.
-           \override BarLine #'bar-size = #3.0
-       }
-       \context{
-           \ChoirStaff
-           \remove "Span_bar_engraver"
-       }
-       \context {
-           \Staff
-           \remove "Bar_engraver"
-       }
-    }
-}
-
diff --git a/input/test/bar-number-every-five-reset.ly b/input/test/bar-number-every-five-reset.ly
deleted file mode 100644 (file)
index fe08b08..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-\version "2.10.0"
-
-\header {
-    texidoc = "@cindex Bar Number Every Fifth Reset
-If you would like the bar numbers to appear at regular intervals, but
-not starting from measure zero, you can use a context function,
-@code{set-bar-number-visibility}, to set automatically
-@code{barNumberVisibility}, so that the bar numbers appear at regular
-intervals, starting from the measure in which 
-@code{set-bar-number-visibility} is set using @code{\applyContext}.
-"
-
-}
-
-resetBarnum = \context Score \applyContext
-  #(set-bar-number-visibility 4)
-\score {
-    <<
-         \transpose c c'' {
-           \override Score.BarNumber  #'break-visibility =#end-of-line-invisible
-           \override Score.RehearsalMark  #'padding = #2.5
-           \mark "A" \resetBarnum
-           \repeat unfold 10 c1
-           \mark \default \resetBarnum
-           \repeat unfold 8 c
-            \bar "|."
-        }
-    >>
-\layout{ragged-right = ##t}
-}
diff --git a/input/test/bar-number-show-all.ly b/input/test/bar-number-show-all.ly
deleted file mode 100644 (file)
index f6a1afc..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-
-\version "2.10.0"
-\header{
-    texidoc="@cindex Bar Number Show All
-By default, bar numbers are printed only in the first measure.  This 
-setting can be overridden, so that bar numbers on start of every measure.
-" }
-
-\score{
-    \relative c'{
-       c1 c c
-       \override Score.BarNumber 
-           #'break-visibility = #end-of-line-invisible
-       \break
-       c c c
-    }
-       \layout{ ragged-right = ##t }
-}
-
-
diff --git a/input/test/beam-alternate.ly b/input/test/beam-alternate.ly
deleted file mode 100644 (file)
index 9d599d9..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-
-\header {
-
-    texidoc = "The eighth notes may be seemingly attached to different
-    beams, and the corresponding notes connected by ties (see also
-    @file{tie-cross-voice.ly}). 
-    Such a situation may occur, for example, in the cello suites."
-
-}
-
-\version "2.10.0"
-
-wipeNote = {
-    \once \override NoteHead #'transparent = ##t
-    \once \override Stem #'transparent = ##t 
-}
-\layout { ragged-right = ##t }
-
-
-\relative c''<< {
-    c8[~
-       \wipeNote
-       c8
-       c8~
-       \wipeNote
-       c
-       c]~
-    \wipeNote
-    c\noBeam
-}\\
-   { s8 c8 [ s c s c] }
-
-   
->>
diff --git a/input/test/beam-auto-4-8.ly b/input/test/beam-auto-4-8.ly
deleted file mode 100644 (file)
index 4a8c426..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-
-%% \version "2.10.0"
-
-%% keep for now, although merging into beam-auto-override is a possibility.
-\header {
-       texidoc = "@cindex Auto Beaming 4/8
-You can override the automatic beaming settings.
-"
-}
-
-\layout{ragged-right = ##t}
-
-\relative c''{
-  \time 4/8
-
-%{
-    the default for 4/8 (see scm/auto-beam.scm)
-     ----  --------
-     |  |  |   |--|
-    x| x| x|  x| x|
-%}
-  c8 c c c16 c
-
-%{
-    user override
-     --------------
-     |  |  |   |--|
-    x| x| x|  x| x|
-%}
-  %% This has now (2.5.21) changed, (end * * * *) no longer
-  %% masks the default config entry ('(end * * 4 8) 1 4))
-  %% rather than masking by override:
-  %% #(override-auto-beam-setting '(end * * * *) 2 4)
-  %% revert the config file setting.
-  #(revert-auto-beam-setting '(end * * 4 8) 1 4)
-  c8 c c c16 c
-}
-    
-
diff --git a/input/test/beam-auto-override.ly b/input/test/beam-auto-override.ly
deleted file mode 100644 (file)
index ef8f544..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-
-%% ugh
-%% \version "2.10.0"
-
-\header {
-
-    texidoc = "@cindex Auto Beaming Override
-
-The auto-beamer, which can be overridden, will only engrave beams 
-that end before encountering of 
-@itemize @bullet
-@item a rest,
-@item
- an other, manually entered beam, or
-@item
- a bar line. 
-@end itemize
-
-The @code{autoBeaming} can also be turned off.
-
-"
-
-}
-
-%% TODO: check doc string. -hw
-
-\layout{ragged-right = ##t}
-\relative c''{
-  %% This has now (2.5.21) changed, (end * * * *) no longer
-  %% masks the default config entry ('(end * * 2 4) 1 4))
-  %% rather than masking by override:
-  %% #(override-auto-beam-setting '(end * * * *) 1 2)
-  %% revert the config file setting.
-  #(revert-auto-beam-setting '(end * * 2 4) 1 4)
-  \time 2/4
-  
-  %% one beam per measure
-  c8 c c c
-  c16 c c c c c c c
-  
-  %% from here on consider ending beam every 1/4 note
-  #(override-auto-beam-setting '(end * * * *) 1 4)
-
-  c8 c c c
-  %% manually override autobeam with weird beaming
-  c8  c[ c] c
-  c8 c c r
-  c8 c c4
-  r8 c c c
-  %% no autobeaming
-  \set autoBeaming = ##f
-  c8 c c c
-}
-
-
diff --git a/input/test/beam-control.ly b/input/test/beam-control.ly
deleted file mode 100644 (file)
index f9b7b6d..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-
-\version "2.10.0"
-\header{
-    texidoc="@cindex Beam Position Control
-
-Beam positions may be controlled manually, by overriding the @code{positions} setting of the @code{Beam} grob.
-
-" }
-\score { 
-    \context Voice \relative c {
-       %% from upper staffline (position 4) to centre (position 0)
-       \override Beam  #'positions = #'(2 . 0)
-        c'8[ c] 
-       
-       %% from center to one above centre (position 2)
-       \override Beam  #'positions = #'(0 . 1)
-        c[ c]
-  }
-\layout{ragged-right = ##t}
-}
-
diff --git a/input/test/beam-count.ly b/input/test/beam-count.ly
deleted file mode 100644 (file)
index 9ceb691..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-
-%%\version "2.10.0"
-\header{
-       texidoc="@cindex Beam Count
-
-You can alter the number of stems in a beam.  In this example,
-two sets of four 32nds are joined, as if they were 8th notes.
-
-" }
-
-\layout { ragged-right = ##t}  
-
-\relative {
-  %% This has now (2.5.21) changed, (end * * * *) no longer
-  %% masks the default config entry ('(end * * 2 4) 1 4))
-  %% rather than masking by override:
-  %% #(override-auto-beam-setting '(end * * * *) 1 4)
-  %% revert the config file settings.
-  #(revert-auto-beam-setting '(end 1 32 4 4) 1 8)
-  #(revert-auto-beam-setting '(end 1 32 4 4) 3 8)
-  f32 g a b b a g f
-
-  f32 g a 
-  \set stemRightBeamCount = #1  b
-  \set stemLeftBeamCount = #1 b
-  a g f
-}
diff --git a/input/test/boxed-stencil.ly b/input/test/boxed-stencil.ly
deleted file mode 100644 (file)
index c94f272..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-
-\version "2.10.0"
-\header {
-  texidoc = "@cindex Boxed Stencil
-
-The @code{print-function} can be overridden to draw a box around an arbitrary 
-grob. " }
-
-
-\layout{ragged-right = ##t}
-\relative c''  {
-
-  \override TextScript  #'stencil =
-  #(make-stencil-boxer 0.1 0.3 ly:text-interface::print)
-
-  c'4^"foo"
-
-  \override Stem  #'stencil =
-  #(make-stencil-boxer 0.05 0.25 ly:stem::print)
-
-  \override Score.RehearsalMark  #'stencil =
-  #(make-stencil-boxer 0.15 0.3 ly:text-interface::print)
-  b8
-  \revert Stem #'stencil
-
-
-  c4. c4 \mark "F" c1 
-}
-
diff --git a/input/test/extra-staff.ly b/input/test/extra-staff.ly
deleted file mode 100644 (file)
index 4ea1438..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-
-\version "2.10.0"
-
-% definitely wil be renamed to something.
-%{
-(Message vers:9)
-To: Adrian Mariano <adrian@camcornelledu>.
-cc: gnu-music-discuss@gnu.org
-Subject: Re: Switching from one staff to two staves 
-Reply-To: janneke@gnu.org
-In-reply-to: Your message of "Tue, 19 Jan 1999 12:27:10 EST."
-             <199901191727.MAA29757@avalanchecamcornelledu>. 
-Date: Wed, 20 Jan 1999 09:39:22 +0100
-From: Jan Nieuwenhuizen <jan@beavis-nt>
-
-On Tuesday, 19 January 1999, Adrian Mariano writes:
-
->> I want to typeset something which starts out with just one staff and then
->> harmony comes in and there are two staves.  I can't figure out how to do
->> this.  I get an extra blank staff during the second section (using
->> Lily 1.1.15):
-
-There used to be an example called 'multi.ly'...
-Try this (we'll include it in pl23/24):
-
-extra-staff.ly:
-%}
-
-
-\header{ texidoc="@cindex Staff Extra
-@cindex Staff Ossia
-You can add (possibly temporarily) an extra staff after the beginning of 
-a piece. "
-}
-
-\score {
-       <<
-               \new Staff \relative c''{ c1 c c c c }
-               \new StaffGroup \relative c''{ 
-                       \new Staff 
-                       c1 c
-                       << c1 \new Staff { c1 } >>
-                       c
-               }
-       >>
-       \layout {
-               ragged-right = ##t
-               \context{
-                       \Score
-
-               }
-       }
-}
-
-
-
-
diff --git a/input/test/fret-diagram.ly b/input/test/fret-diagram.ly
deleted file mode 100644 (file)
index 6935693..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-\header
-{
-  texidoc = "Frets are supported as markup commands."
-}
-
-\version "2.10.0"
-
-\score {
-    <<
-       \chords {d2 d d s fis fis fis s c c c}
-       
-     \new Voice = "mel" {
-% simple D chord
-
-    d'2 ^\markup \fret-diagram-verbose #'((mute 6) (mute 5) (open 4) (place-fret 3 2) (place-fret 2 3) (place-fret 1 2))
-    d' ^\markup \fret-diagram #"6-x;5-x;4-o;3-2;2-3;1-2;"
-    d' ^\markup \fret-diagram-terse #"x;x;o;2;3;2;"
-    r \break
-% fis major chord, 3/4 size, fingering labeled below string
-    
-    fis' ^\markup \override #'(size . 0.75) {\override #'(finger-code . below-string){\fret-diagram-verbose #'((place-fret 6 2 1) (barre 6 1 2) (place-fret 5 4 3) (place-fret 4 4 4) (place-fret 3 3 2) (place-fret 2 2 1) (place-fret 1 2 1))}}
-    fis' ^\markup \override #'(finger-code . below-string) {\fret-diagram #"s:0.75;c:6-1-2;6-2-1;5-4-3;4-4-4;3-3-2;2-2-1;1-2-1;"}
-    fis' ^\markup \override #'(size . 0.75) {\override #'(finger-code . below-string){\fret-diagram-terse #"2-1-(;4-3;4-4;3-2;2-1;2-1-);"}}
-    r \break
-
-% c major barre chord, fingering labeled on frets
-   c' ^\markup \override #'(dot-color . white) {
-                \override #'(finger-code . in-dot) 
-                \fret-diagram-verbose #'((mute 6) (place-fret 5 3 1) (place-fret 4 5 2) (place-fret 3 5 3) (place-fret 2 5 4) (place-fret 1 3 1) (barre 5 1 3)) }
-   c' ^\markup \override #'(barre-type . straight) \fret-diagram #"f:1;c:5-1-3;6-x;5-3-1;4-5-2;3-5-3;2-5-4;1-3-1;"
-   c' ^\markup  \override #'(dot-radius . 0.35) {
-                \override #'(finger-code . in-dot) {
-                \override #'(dot-color . white) {
-                \fret-diagram-terse #"x;3-1-(;5-2;5-3;5-4;3-1-);"}}}
-   r  \break
-   
-% c major scale using open strings
-  c' ^\markup \fret-diagram-verbose #'((mute 6) (place-fret 5 3) (open 4) (place-fret 4 2) (place-fret 4 3) (open 3) (place-fret 3 2)  (open 2) (place-fret 2 1) (mute 1))
-  c' ^\markup \fret-diagram #'"6-x;5-3;4-o;4-2;4-3;3-o;3-2;2-o;2-1;1-x;"
-  c' ^\markup \fret-diagram-terse #'"x;3;2 3;o 2;o 1;x;"
-
-% c major scale using no open strings
-  c' ^\markup \fret-diagram-verbose #'((mute 6) (place-fret 5 3) (place-fret 5 5) (place-fret 4 2) (place-fret 4 3) (place-fret 4 5) (place-fret 3 2)  (place-fret 3 4) (place-fret 3 5) (mute 2) (mute 1))
-  c' ^\markup \fret-diagram #'"6-x;5-3;5-5;4-2;4-3;4-5;3-2;3-4;3-5;2-x;1-x;"
-  c' ^\markup \fret-diagram-terse #'"x;3 5;2 3 5;2 4 5;x;x;"
-  \break
-  
-% g major scale, no open strings, two octaves on six strings, white dots
-  g' ^\markup \override #'(dot-color . white) {\fret-diagram-terse #'"3 5;2 3 5;2 4 5;2 4 5;3 5;2 3;" }
-  r r r}
-    >>
-  \layout{ ragged-right = ##f }
-}
diff --git a/input/test/instrument-name-grandstaff.ly b/input/test/instrument-name-grandstaff.ly
deleted file mode 100644 (file)
index ee6d86b..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-\version "2.10.0"
-\header { texidoc = "@cindex Instrument Name Grandstaff
-You can have a name for the whole @code{GrandStaff} in addition to 
-individual @code{Staff}s. " }
-
-\score {
-  
-   \new GrandStaff <<
-    \new Staff =  "treble"    {
-      \set GrandStaff.instrumentName = "Violini  "
-      \set Staff.instrumentName = " vn I" { c''4 }}
-    \new Staff =  "bass" { \set Staff.instrumentName = " vn II" c''4 }>>
-
-
-\layout {
-ragged-right = ##t
-\context { \GrandStaff \consists "Instrument_name_engraver" }
-}}
-
diff --git a/input/test/mensural-ligatures.ly b/input/test/mensural-ligatures.ly
deleted file mode 100644 (file)
index 5b52f3e..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-\version "2.10.0"
-% TODO:
-% check with ancient- stuff.  rename, merge, something.  -gp
-
-\header { texidoc = "@cindex Ancient Mensural Ligatures
-In mensural ligatures, notes with ancient durations are printed
-in a tight manner."
-}
-
-
-
-% Note that the horizontal alignment of the fermatas obeys to the
-% graphical width of the ligatures rather to the musical moment in time.
-% This is intended behaviour.
-
-voice =  \transpose c c' {
-  \set Score.timing = ##f
-  \set Score.defaultBarType = "empty"
-  g\longa c\breve a\breve f\breve d'\longa^\fermata
-  \bar "|"
-  \[
-    g\longa c\breve a\breve f\breve d'\longa^\fermata
-  \]
-  \bar "|"
-  e1 f1 a\breve g\longa^\fermata
-  \bar "|"
-  \[
-    e1 f1 a\breve g\longa^\fermata
-  \]
-  \bar "|"
-  e1 f1 a\breve g\longa^\fermata
-  \bar "||"
-}
-
-\paper {
-    line-thickness = \staff-space / 5.0
-}
-\score {
-    \context ChoirStaff <<
-       \new MensuralStaff <<
-           \context MensuralVoice <<
-               \voice
-           >>
-       >>
-       \new Staff <<
-           \context Voice <<
-               \voice
-           >>
-       >>
-    >>
-    \layout {
-       \context {
-           \Voice
-           \name MensuralVoice
-           \alias Voice
-           \remove Ligature_bracket_engraver
-           \consists Mensural_ligature_engraver
-           \override NoteHead #'style = #'mensural
-       }
-       \context {
-           \Staff
-           \name MensuralStaff
-           \alias Staff
-           \accepts MensuralVoice
-           \consists Custos_engraver
-           \override TimeSignature #'style = #'mensural
-           \override KeySignature #'style = #'mensural
-           \override Accidental #'style = #'mensural
-           \override Custos #'style = #'mensural
-           \override Custos #'neutral-position = #3
-           \override Custos #'neutral-direction = #down
-           clefGlyph = #"clefs.petrucci.g"
-           clefPosition = #-2
-           clefOctavation = #-0
-       }
-       \context {
-           \RemoveEmptyStaffContext
-           \accepts MensuralVoice
-        }
-       \context {
-           \Score
-           \accepts MensuralStaff
-       }
-    }
-}
-
diff --git a/input/test/mensural-note-heads.ly b/input/test/mensural-note-heads.ly
deleted file mode 100644 (file)
index 4097392..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-
-\version "2.10.0"
-
-\header {
-    texidoc ="@cindex Ancient Mensural Note Heads
-Mensural notes may also have note heads. "
-}
-
-\score {
-        {
-       \relative c'' {
-               \override NoteHead  #'style = #'mensural
-               c\maxima*1/8
-               c\longa*1/4 c\breve*1/2 c1 c2 c4 c8 
-               }
-       }
-       \layout{ragged-right=##t}
-}
-
diff --git a/input/test/no-key-at-end-of-line.ly b/input/test/no-key-at-end-of-line.ly
deleted file mode 100644 (file)
index 4f478c5..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-\version "2.10.0"
-\header {
-
-    texidoc = "@cindex Key Signature End of Line
-According to normal typesetting conventions, LilyPond typesets key
-changes at the end of the line, when the change appears at a line break.
-This example shows how to change this default to only print the
-new key signature at the beginning of the next line.
-" }
-
-\score {
-   \relative c' {
-    \set Staff.explicitKeySignatureVisibility = #end-of-line-invisible
-    c d e f | g a b c | \break
-    \key d \major
-    d cis b a | g fis e d |
-  }
-}
diff --git a/input/test/reverse-music.ly b/input/test/reverse-music.ly
deleted file mode 100644 (file)
index 2d94910..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-\version "2.10.0"
-\sourcefilename "reverse-music.ly"
-
-% possible rename to scheme-something.
-\header { texidoc="@cindex Scheme Reverse Music
-Symmetric, or palindromical music can be produced, first, by printing
-some music, and second, by printing the same music applying a Scheme
-function to reverse the syntax.
-"
-}
-
-#(define (reverse-music music)
-  (let* ((elements (ly:music-property music 'elements))
-         (reversed (reverse elements))
-         (e (ly:music-property music 'element))
-         (span-dir (ly:music-property music 'span-direction)))
-
-    (ly:music-set-property! music 'elements reversed)
-
-    (if (ly:music? e)
-        (ly:music-set-property!
-         music 'element
-         (reverse-music e)))
-
-    (if (ly:dir? span-dir)
-        (ly:music-set-property! music 'span-direction (- span-dir)))
-
-    (map reverse-music reversed)
-
-    music))
-
-reverseMusic =
-#(define-music-function (parser location m) (ly:music?)
-               (reverse-music m)
-       )       
-
-music =  \relative c'' { c4 d4( e4 f4 }
-
-\score {
-\context Voice {
-    \music
-    \reverseMusic \music
-  }
-  \layout { ragged-right = ##t}
-}
-
diff --git a/input/test/slur-manual.ly b/input/test/slur-manual.ly
deleted file mode 100644 (file)
index db6b8c9..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-\version "2.10.0"
-\header {
-
-
-    texidoc = "In extreme cases, you can resort to setting the 
-    @code{control-points} of a slur manually, althout it involves 
-    a lot of trial and error. Be sure to force line breaks at both sides, since
-    different horizontal spacing will require rearrangement of the
-    slur."
-    }
-
-\score {
-     \new PianoStaff
-    <<
-       \new Staff =  "up" {
-           \clef bass
-           s1 * 4
-       } 
-       \new Staff =  "down" \relative c <<
-           s1*4
-           {
-           \clef bass
-           r4 r8
-           \once\override Slur  #'extra-offset = #'(0 . 6)
-           \once\override Slur  #'control-points =
-           #'((0 . -4) (2 . 0) (60 . 0) (63 . 4))
-           c8( as' f c' as
-
-           % line breaks will mess up this example  
-           \noBreak
-           f c as' f
-           \change Staff = up
-           \clef treble
-           c' as f' c
-           \noBreak
-           as' f c' as
-           f' c as' f c'4)
-       }>>
-    >>
-    \layout {  }
-}
-
diff --git a/input/test/slur-minimum-length.ly b/input/test/slur-minimum-length.ly
deleted file mode 100644 (file)
index 96a50d7..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-
-\version "2.10.0"
-
-\header { texidoc = "@cindex Slur Minimum Length
-By setting the minimum length of a slur, notes are more separated. " 
-}
-
-\score{
-       \relative c''{
-               \time 2/4
-               \override Slur  #'minimum-length = #40
-               c(c)
-               c~c\break
-               }
-}
-
diff --git a/input/test/staff-lines.ly b/input/test/staff-lines.ly
deleted file mode 100644 (file)
index 8a04b83..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-
-\version "2.10.0"
-
-\header {
-
-    texidoc="@cindex Staff Lines 
-The number of lines in a staff may changed by overriding @code{line-count}
-in the properties of @code{StaffSymbol}.
-"
-         
-}
-
-
-upper = \relative c'' {
-  c1 d e f
-}
-
-lower = \relative c {
-  c1 b a g
-}
-
-\score {
-  \context PianoStaff <<
-    \new Staff <<
-      \upper
-    >>  
-    \new Staff  {
-       \override Staff.StaffSymbol  #'line-count = #4 
-        \clef bass
-        \lower
-    }
-  >>
-  \layout { ragged-right=##t}  
-}
index 32f8da8c4576280d564cb079f75d85da639b392c..c68fb22e235d205233f8268bcad809b7afb8bf30 100644 (file)
@@ -4,7 +4,7 @@ STEPMAKE_TEMPLATES=documentation texinfo tex
 LOCALSTEPMAKE_TEMPLATES=lilypond ly lysdoc
 EXTRA_DIST_FILES=README
 
-EXTRA_DIST_FILES+=expressive parts text
+SUBDIRS+=expressive parts text
 
 include $(depth)/make/stepmake.make
 
diff --git a/input/tolsr/expressive/GNUmakefile b/input/tolsr/expressive/GNUmakefile
new file mode 100644 (file)
index 0000000..43325ab
--- /dev/null
@@ -0,0 +1,16 @@
+
+depth = ../../../
+
+STEPMAKE_TEMPLATES=documentation texinfo tex
+LOCALSTEPMAKE_TEMPLATES=lilypond ly lysdoc
+
+## Hmm, would this work?  No -- if we really want examples, move
+## to other dir (input/) comes to mind.
+## examples = font20 ancient-font
+## LOCALSTEPMAKE_TEMPLATES += ly mutopia
+
+EXTRA_DIST_FILES= 
+
+include $(depth)/make/stepmake.make
+
+TITLE=Advanced snippets
diff --git a/input/tolsr/parts/GNUmakefile b/input/tolsr/parts/GNUmakefile
new file mode 100644 (file)
index 0000000..43325ab
--- /dev/null
@@ -0,0 +1,16 @@
+
+depth = ../../../
+
+STEPMAKE_TEMPLATES=documentation texinfo tex
+LOCALSTEPMAKE_TEMPLATES=lilypond ly lysdoc
+
+## Hmm, would this work?  No -- if we really want examples, move
+## to other dir (input/) comes to mind.
+## examples = font20 ancient-font
+## LOCALSTEPMAKE_TEMPLATES += ly mutopia
+
+EXTRA_DIST_FILES= 
+
+include $(depth)/make/stepmake.make
+
+TITLE=Advanced snippets
diff --git a/input/tolsr/text/GNUmakefile b/input/tolsr/text/GNUmakefile
new file mode 100644 (file)
index 0000000..43325ab
--- /dev/null
@@ -0,0 +1,16 @@
+
+depth = ../../../
+
+STEPMAKE_TEMPLATES=documentation texinfo tex
+LOCALSTEPMAKE_TEMPLATES=lilypond ly lysdoc
+
+## Hmm, would this work?  No -- if we really want examples, move
+## to other dir (input/) comes to mind.
+## examples = font20 ancient-font
+## LOCALSTEPMAKE_TEMPLATES += ly mutopia
+
+EXTRA_DIST_FILES= 
+
+include $(depth)/make/stepmake.make
+
+TITLE=Advanced snippets
index 1487252716cf1057b40b8c322a45baab5c7be524..c40219b8d23e72fbe5fbfc573da49b231f71bdd6 100644 (file)
@@ -268,29 +268,35 @@ Break_alignable_interface::self_align_callback (SCM grob)
   if (!Break_alignment_interface::has_interface (alignment))
     return scm_from_int (0);
 
-  SCM my_align = me->get_property ("break-align-symbol");
-  SCM order = Break_alignment_interface::break_align_order (alignment);
-
+  SCM symbol_list = me->get_property ("break-align-symbols");
   vector<Grob*> elements = Break_alignment_interface::ordered_elements (alignment);
   if (elements.size () == 0)
     return scm_from_int (0);
   
-  int last_idx_found = -1;
-  vsize i = 0;
-  for (SCM s = order; scm_is_pair (s); s = scm_cdr (s))  
+  int break_aligned_grob = -1;
+  for (; scm_is_pair (symbol_list); symbol_list = scm_cdr (symbol_list))
     {
-      if (i < elements.size ()
-         && elements[i]->get_property ("break-align-symbol") == scm_car (s))
+      SCM sym = scm_car (symbol_list);
+      for (vsize i = 0; i < elements.size (); i++)
        {
-         last_idx_found = i;
-         i ++;
+         if (elements[i]->get_property ("break-align-symbol") == sym)
+           {
+             if (Item::break_visible (elements[i]))
+               {
+                 break_aligned_grob = i;
+                 goto found_break_aligned_grob; /* ugh. need to break out of 2 loops */
+               }
+             else if (break_aligned_grob == -1)
+               break_aligned_grob = i;
+           }
        }
+    }
 
-      if (scm_car (s) == my_align)
-       break ;
-    }  
+found_break_aligned_grob:
+  if (break_aligned_grob == -1)
+    return scm_from_int (0);
 
-  Grob *alignment_parent = elements[last_idx_found];
+  Grob *alignment_parent = elements[break_aligned_grob];
   Grob *common = me->common_refpoint (alignment_parent, X_AXIS);
   Real anchor = robust_scm2double (alignment_parent->get_property ("break-align-anchor"), 0);
 
@@ -332,11 +338,33 @@ Break_aligned_interface::calc_extent_aligned_anchor (SCM smob)
   return scm_from_double (me->extent (me, X_AXIS).linear_combination (alignment));
 }
 
+MAKE_SCHEME_CALLBACK (Break_aligned_interface, calc_break_visibility, 1)
+SCM
+Break_aligned_interface::calc_break_visibility (SCM smob)
+{
+  /* a BreakAlignGroup is break-visible iff it has one element that is break-visible */
+  Grob *me = unsmob_grob (smob);
+  SCM ret = scm_c_make_vector (3, SCM_EOL);
+  extract_grob_set (me, "elements", elts);
+  for (int dir = 0; dir <= 2; dir++)
+    {
+      bool visible = false;
+      for (vsize i = 0; i < elts.size (); i++)
+       {
+         SCM vis = elts[i]->get_property ("break-visibility");
+         if (scm_is_vector (vis) && to_boolean (scm_c_vector_ref (vis, dir)))
+           visible = true;
+       }
+      scm_c_vector_set_x (ret, dir, scm_from_bool (visible));
+    }
+  return ret;
+}
+
 ADD_INTERFACE (Break_alignable_interface,
               "Object that is aligned on a break aligment. ",
 
               /* properties */
-              "break-align-symbol "
+              "break-align-symbols "
               )
 
 
index f3633c2bad962b6637beeca6ed967f49dcfc202a..9ac29c7ae015bcfbff7c3a2f11c2c404d03cd9e8 100644 (file)
@@ -27,6 +27,7 @@ struct Break_aligned_interface
 {
   DECLARE_SCHEME_CALLBACK (calc_average_anchor, (SCM));
   DECLARE_SCHEME_CALLBACK (calc_extent_aligned_anchor, (SCM));
+  DECLARE_SCHEME_CALLBACK (calc_break_visibility, (SCM));
   DECLARE_GROB_INTERFACE();
 };
 
index f1f094a7b413978cc23726223499088cc0d534fc..0838c00a49be7e85659245b3b1b392aa9f478729 100644 (file)
@@ -28,6 +28,7 @@ public:
   virtual Grob *clone () const;
 
   static bool is_non_musical (Grob *);
+  static bool break_visible(Grob *);
   bool is_broken () const;
   bool pure_is_visible (int start, int end) const;
 
index f7e832b30b866b13b4ad5333f4aba2ac564fdce0..33e5e2027edf86e72395da4e590112b99741bca3 100644 (file)
@@ -149,14 +149,18 @@ Item::handle_prebroken_dependencies ()
     Can't do this earlier, because try_visibility_lambda () might set
     the elt property transparent, which would then be copied.
   */
-  SCM vis = get_property ("break-visibility");
-  if (scm_is_vector (vis))
-    {
-      bool visible = to_boolean (scm_c_vector_ref (vis, break_status_dir () + 1));
+  if (!Item::break_visible (this))
+    suicide ();
+}
 
-      if (!visible)
-       suicide ();
-    }
+bool
+Item::break_visible (Grob *g)
+{
+  Item *it = dynamic_cast<Item*> (g);
+  SCM vis = g->get_property ("break-visibility");
+  if (scm_is_vector (vis))
+    return to_boolean (scm_c_vector_ref (vis, it->break_status_dir () + 1));
+  return true;
 }
 
 bool
index 869cdbaed19898d49517d5656c3c78dbf3f99073..095de80ab1ff0710db1147ae08345902e0ab75b5 100644 (file)
@@ -144,6 +144,52 @@ print_body (void *out, string name)
   fclose (fd);
 }
 
+#if 0
+static
+void t42_write_sting (void *out, unsigned char const * buffer, size_t s)
+{
+  lily_cookie_fprintf (out, "\n<");
+  int l = 0;
+  static char xdigits[] = "0123456789ABCDEF";
+  for (size_t j = 0; j < s; j++)
+    {
+      if (j != 0 && j % 36 == 0)
+       lily_cookie_putc ('\n', out);
+
+      if (l ++ >= CHUNKSIZE)
+       lily_cookie_fprintf (out, "00>\n<");
+
+      /* lily_cookie_fprintf (out,"%02X",(int)buffer[j]) is too slow */
+      lily_cookie_putc (xdigits[ (buffer[j] & 0xF0) >> 4], out);
+      lily_cookie_putc (xdigits[buffer[j] & 0x0F], out);
+    }
+  lily_cookie_fprintf (out, "00>");    /* Adobe bug? */
+}
+
+
+static void
+new_print_body (void *out,  FT_Face face)
+{
+  FT_UInt idx = 0;
+
+  FT_ULong tag, length;
+  
+  lily_cookie_fprintf (out, "/sfnts [");
+  while (FT_Sfnt_Table_Info(face, idx, &tag, &length)!=
+        FT_Err_Table_Missing)
+    {
+      unsigned char *buf = new unsigned char[length];
+      FT_Error error = FT_Load_Sfnt_Table(face, tag, 0, buf, NULL); 
+
+      t42_write_sting (out, buf, length);
+
+      delete[] buf;
+      idx ++;
+    }
+  lily_cookie_fprintf (out, "\n] def\n");
+}
+#endif
+
 static void
 print_trailer (void *out,
               FT_Face face)
@@ -212,6 +258,7 @@ create_type42_font (void *out, string name)
   FT_Face face = open_ft_face (name);
 
   print_header (out, face);
+  // new_print_body (out, face);
   print_body (out, name);
   print_trailer (out, face);
 
index c09ae5ae5f6c31b6ff235f2f0ee37baa075334a9..57f94a96fcec26b89a187841b85484235385eb3f 100644 (file)
@@ -6,7 +6,7 @@
 % (c) 2001--2006 Juergen Reuter <reuter@ipd.uka.de>
 % 
 
-fet_begingroup ("accidentals")
+fet_begingroup ("accidentals");
 
 
 %%%%%%%%
@@ -17,36 +17,67 @@ fet_begingroup ("accidentals")
 %
 %
 %
-fet_beginchar("Ed. Med. Flat" , "medicaea-1");
-       set_char_box(0.1 staff_space#, 0.6 staff_space#,
-                    0.6 staff_space#, 1.0 staff_space#);
+fet_beginchar ("Ed. Med. Flat" , "medicaea-1");
+       set_char_box (0.1 staff_space#, 0.6 staff_space#,
+                     0.6 staff_space#, 1.0 staff_space#);
 
-       pickup pencircle
-               xscaled 0.50 linethickness
-               yscaled 0.22 staff_space;
+       save ellipse, pat, outline;
+       path ellipse, pat, outline;
 
-       save za, zb;
-       pair za, zb;
+       pickup pencircle xscaled 0.50 linethickness
+                        yscaled 0.22 staff_space;
 
-       za = (0.00 staff_space, +0.90 staff_space);
-       zb = (0.00 staff_space, -0.50 staff_space);
-       draw za -- zb;
+       ellipse := fullcircle xscaled 0.5 linethickness
+                                     yscaled 0.22 staff_space;
 
-       pickup pencircle
-               xscaled 0.50 linethickness
-               yscaled 0.22 staff_space
-               rotated -63;
+       x1 = x2 = 0;
+       top y1 = h;
+       bot y2 = -d;
 
-       save zc, zd, ze;
-       pair zc, zd, ze;
+       fill get_subpath (ellipse, up, down, z1)
+            -- get_subpath (ellipse, down, up, z2)
+            -- cycle;
 
-       zc = (0.10 staff_space, -0.50 staff_space);
-       zd = (0.40 staff_space, +0.40 staff_space);
-       ze = (0.10 staff_space, +0.40 staff_space);
+       pickup pencircle xscaled 0.50 linethickness
+                        yscaled 0.22 staff_space
+                        rotated -63;
 
-       draw zc{(1,2)} .. zd .. ze{(-1,-1)};
+       ellipse := fullcircle xscaled 0.50 linethickness
+                             yscaled 0.22 staff_space
+                             rotated -63;
+
+       z3 = (0.10 staff_space, -0.50 staff_space);
+       z4 = (0.40 staff_space, +0.40 staff_space);
+       z5 = (0.10 staff_space, +0.40 staff_space);
+
+       pat := z3{(1, 2)}
+              .. z4
+              .. z5{(-1, -1)};
+
+       % the original envelope curve created with `draw' contains
+       % cusps which we avoid
+       outline := get_subpath (ellipse, -direction 0 of pat,
+                               direction 0 of pat, z3)
+                  .. get_subpoint (ellipse, direction 1 of pat, z4)
+                  .. get_subpath (ellipse, direction 2 of pat,
+                                  -direction 1.8 of pat, z5)
+                  .. get_subpoint (ellipse, -direction 1 of pat, z4)
+                       {-direction 1 of pat}
+                  .. cycle;
+
+       save shift;
+       pair shift;
+
+       % make the outline touch the bounding box
+       shift = find_tangent_shift (((w, -d) -- (w, h)), outline,
+                                   (b, 0), (-b, 0));
+       outline := outline shifted shift;
+
+       fill outline;
+
+       labels (1, 2, 3, 4, 5);
+fet_endchar;
 
-       fet_endchar;
 
 %%%%%%%%
 %
@@ -56,52 +87,97 @@ fet_beginchar("Ed. Med. Flat" , "medicaea-1");
 %
 %
 %
-fet_beginchar("Ed. Vat. Flat" , "vaticana-1");
-        save za, zb, zc, zd, ze, zf, zg;
-        pair za, zb, zc, zd, ze, zf, zg;
-        za = (0.00 staff_space, +0.80 staff_space);
-        zb = (0.00 staff_space, -0.03 staff_space);
-        zc = (0.25 staff_space, -0.23 staff_space);
-        zd = (0.50 staff_space, -0.23 staff_space);
-        ze = (0.50 staff_space, +0.00 staff_space);
-        zf = (0.25 staff_space, +0.20 staff_space);
-        zg = (0.15 staff_space, +0.26 staff_space);
-
-        pickup pencircle
-                xscaled 0.50 linethickness
-                yscaled 0.22 staff_space;
-        draw za{down} .. {down}zb .. zc .. zd{up} .. {up}ze .. zf .. zg;
-
-        set_char_box(0.00 staff_space# + 0.25 linethickness#,
-                    0.50 staff_space# + 0.25 linethickness#,
-                    0.23 staff_space# + 0.11 staff_space#,
-                    0.80 staff_space# + 0.11 staff_space#);
-        fet_endchar;
-
-fet_beginchar("Ed. Vat. Natural" , "vaticana0");
-       save za, zb, zc, zd;
-       pair za, zb, zc, zd;
-       pickup pencircle
-               xscaled 0.80 linethickness
-               yscaled 0.22 staff_space;
-       za = (0.00 staff_space, +0.65 staff_space);
-       zb = (0.00 staff_space, -0.35 staff_space);
-       zc = (0.00 staff_space, -0.30 staff_space);
-       zd = (0.40 staff_space, -0.08 staff_space);
-       draw za -- zb;
-       draw zc -- zd;
+fet_beginchar ("Ed. Vat. Flat" , "vaticana-1");
+       z1 = (0.00 staff_space, +0.80 staff_space);
+       z2 = (0.00 staff_space, -0.08 staff_space);
+       z3 = (0.25 staff_space, -0.23 staff_space);
+       z4 = (0.50 staff_space, -0.24 staff_space);
+       z5 = (0.50 staff_space, +0.03 staff_space);
+       z6 = (0.25 staff_space, +0.20 staff_space);
+       z7 = (0.15 staff_space, +0.26 staff_space);
+
+       save pat, ellipse;
+       path pat, ellipse;
+
+       pickup pencircle xscaled 0.50 linethickness
+                        yscaled 0.22 staff_space;
+
+       ellipse := fullcircle xscaled 0.50 linethickness
+                             yscaled 0.22 staff_space;
+
+       pat := z1
+              -- z2{down}
+              ... z3
+              ... {up}z4
+              -- z5{up}
+              .. z6
+              .. z7;
+
+       % the original envelope curve created with `draw' contains
+       % cusps which we avoid
+       fill get_subpath (ellipse, up, down, z1)
+            -- get_subpath (ellipse, down, direction 1.1 of pat, z2)
+            ... bot z3
+            ... get_subpath (ellipse, direction 2.9 of pat, up, z4)
+            -- get_subpath (ellipse, up, direction 4.1 of pat, z5)
+            .. top z6
+            .. get_subpath (ellipse,
+                            direction 6 of pat, -direction 6 of pat, z7)
+            .. bot z6
+            .. {down}bot lft z5
+            -- top lft z4{down}
+            ... top z3
+            ... top rt z2{up}
+            -- cycle;
+
+       set_char_box (0.00 staff_space# + 0.25 linethickness#,
+                     0.50 staff_space# + 0.25 linethickness#,
+                     0.23 staff_space# + 0.11 staff_space#,
+                     0.80 staff_space# + 0.11 staff_space#);
+
+       labels (1, 2, 3, 4, 5, 6, 7);
+fet_endchar;
+
+
+fet_beginchar ("Ed. Vat. Natural" , "vaticana0");
+       save ellipse;
+       path ellipse;
+
+       pickup pencircle xscaled 0.80 linethickness
+                        yscaled 0.22 staff_space;
+
+       ellipse := fullcircle xscaled 0.8 linethickness
+                             yscaled 0.22 staff_space;
+
+       z1 = (0.00 staff_space, +0.65 staff_space);
+       z2 = (0.00 staff_space, -0.35 staff_space);
+
+       fill get_subpath (ellipse, up, down, z1)
+            -- get_subpath (ellipse, down, up, z2)
+            -- cycle;
+
+       pickup penrazor scaled 0.22 staff_space
+                       rotated 90;
+
+       z3 = (0.00 staff_space, -0.30 staff_space);
+       z4 = (0.40 staff_space, -0.08 staff_space);
+
+       draw z3
+            -- z4;
 
        addto currentpicture also currentpicture
-               xscaled -1
-               yscaled -1
-               shifted (0.40 staff_space, 0.0 staff_space);
+         xscaled -1
+         yscaled -1
+         shifted (0.40 staff_space, 0.0 staff_space);
+
+       set_char_box (0.00 staff_space# + 0.40 linethickness#,
+                     0.40 staff_space# + 0.40 linethickness#,
+                     0.65 staff_space# + 0.11 staff_space#,
+                     0.65 staff_space# + 0.11 staff_space#);
 
-       set_char_box(0.00 staff_space# + 0.40 linethickness#,
-                    0.40 staff_space# + 0.40 linethickness#,
-                    0.65 staff_space# + 0.11 staff_space#,
-                    0.65 staff_space# + 0.11 staff_space#);
+       labels (1, 2, 3, 4);
+fet_endchar;
 
-       fet_endchar;
 
 %%%%%%%%
 %
@@ -111,79 +187,202 @@ fet_beginchar("Ed. Vat. Natural" , "vaticana0");
 %
 %
 %
-fet_beginchar("Mensural Sharp" , "mensural1");
+fet_beginchar ("Mensural Sharp" , "mensural1");
        save stemthick;
+
        define_pixels (stemthick);
+
        stemthick# = linethickness#;
 
-       save za, zb;
-       pair za, zb;
+       save circle, pat;
+       path circle, pat;
+
        pickup pencircle scaled 0.8 stemthick;
-       za = 0.4 * staff_space * (0.8, 1);
-       za = -zb;
-       draw za .. zb;
 
-       addto currentpicture also currentpicture xscaled -1;
-       addto currentpicture also currentpicture shifted (0.20 staff_space, 0);
+       circle := fullcircle scaled 0.8 stemthick;
 
-       set_char_box(0.8 * 0.4 staff_space# + 0.4 stemthick#,
-                    (0.8 * 0.4 + 0.2) * staff_space# + 0.4 stemthick#,
-                    0.4 staff_space# + 0.4 stemthick#, 
-                    0.4 staff_space# + 0.4 stemthick#);
+       z1 = 0.4 staff_space * (0.8, 1);
+       z1 = -z2;
 
-       fet_endchar;
+       pat := get_subpath (circle, z1 - z2, z2 - z1, z1)
+              -- get_subpath (circle, z2 - z1, z1 - z2, z2)
+              -- cycle;
 
-fet_beginchar("Mensural Flat" , "mensural-1");
-       save stemthick;
-       define_pixels (stemthick);
-       stemthick# = linethickness#;
+       fill pat;
+       fill pat xscaled -1;
+       fill pat shifted (0.20 staff_space, 0);
+       fill pat xscaled -1 shifted (0.20 staff_space, 0);
+
+       set_char_box (0.8 * 0.4 staff_space# + 0.4 stemthick#,
+                     (0.8 * 0.4 + 0.2) * staff_space# + 0.4 stemthick#,
+                     0.4 staff_space# + 0.4 stemthick#, 
+                     0.4 staff_space# + 0.4 stemthick#);
+
+       labels (1, 2);
+fet_endchar;
 
-       save za, zb, zc, zd, ze;
-       pair za, zb, zc, zd, ze;
-       pickup pencircle
-               xscaled 1.4 stemthick
-               yscaled 0.6 stemthick
-               rotated 45;
 
-       za = (0.00 staff_space, +1.80 staff_space);
-       zb = (0.00 staff_space, -0.25 staff_space);
-       zc = (0.35 staff_space, -0.25 staff_space);
-       zd = (0.35 staff_space, +0.25 staff_space);
-       ze = (0.00 staff_space, +0.25 staff_space);
-       draw za -- zb .. zc .. zd .. ze;
+fet_beginchar ("Mensural Flat" , "mensural-1");
+       save stemthick;
 
-       set_char_box(0.00 staff_space# + 0.75 stemthick#,
-                    0.40 staff_space# + 0.75 stemthick#,
-                    0.25 staff_space# + 0.75 stemthick#,
-                    1.80 staff_space# + 0.75 stemthick#);
+       define_pixels (stemthick);
 
-       fet_endchar;
+       stemthick# = linethickness#;
 
-fet_beginchar("Hufnagel Flat" , "hufnagel-1");
+       save ellipse, pat, outline;
+       path ellipse, pat, outline;
+
+       pickup pencircle xscaled 1.4 stemthick
+                        yscaled 0.6 stemthick
+                        rotated 45;
+
+       ellipse := fullcircle xscaled 1.4 stemthick
+                             yscaled 0.6 stemthick
+                             rotated 45;
+
+       z1 = (0.00 staff_space, +1.80 staff_space);
+       z2 = (0.00 staff_space, -0.25 staff_space);
+       z3 = (0.35 staff_space, -0.25 staff_space);
+       z4 = (0.35 staff_space, +0.25 staff_space);
+       z5 = (0.00 staff_space, +0.25 staff_space);
+
+       pat := z2
+              .. z3
+              .. z4
+              .. z5;
+
+       save dirs, s;
+       pair dirs[];
+
+       s := 1/4;
+
+       % we approximate `draw pat'
+       for i = 2 step s until (length pat + 2):
+               dirs[i] := direction (i - 2) of pat;
+       endfor;
+
+       outline := get_subpath (ellipse, up, down, z1)
+                  -- get_subpath (ellipse, down, dirs2, z2)
+                  for i = (2 + s) step s until (length pat + 2 - s):
+                          .. get_subpoint (ellipse, dirs[i],
+                                             point (i - 2) of pat)
+                  endfor
+                  .. top z5
+                  -- bot z5
+                  for i = (length pat + 2 - s) step -s until 2:
+                          .. get_subpoint (ellipse, -dirs[i],
+                                           point (i - 2) of pat)
+                  endfor
+                  -- get_subpoint (ellipse, up, z2)
+                  -- cycle;
+
+       fill outline;
+
+       set_char_box (0.00 staff_space# + 0.75 stemthick#,
+                     0.40 staff_space# + 0.75 stemthick#,
+                     0.25 staff_space# + 0.75 stemthick#,
+                     1.80 staff_space# + 0.75 stemthick#);
+
+       labels (1, 2, 3, 4, 5);
+fet_endchar;
+
+
+fet_beginchar ("Hufnagel Flat" , "hufnagel-1");
        save stemthick;
+
        define_pixels (stemthick);
+
        stemthick# = linethickness#;
 
-       save za, zb, zc, zd, ze, zf;
-       pair za, zb, zc, zd, ze, zf;
-       pickup pencircle
-               xscaled 2.4 stemthick
-               yscaled 0.4 stemthick
-               rotated 45;
-
-       za = (0.00 staff_space, +1.80 staff_space);
-       zb = (0.00 staff_space, -0.15 staff_space);
-       zc = (0.25 staff_space, -0.30 staff_space);
-       zd = (0.50 staff_space, +0.00 staff_space);
-       ze = (0.30 staff_space, +0.30 staff_space);
-       zf = (0.00 staff_space, +0.15 staff_space);
-       draw za -- zb -- zc .. zd .. ze -- zf;
-
-       set_char_box(0.00 staff_space# + 1.0 stemthick#,
-                    0.50 staff_space# + 1.0 stemthick#,
-                    0.30 staff_space# + 0.5 stemthick#, 
-                    1.80 staff_space# + 0.5 stemthick#);
-
-       fet_endchar;
-
-fet_endgroup ("accidentals")
+       save ellipse, pat;
+       path ellipse, pat;
+
+       pickup pencircle xscaled 2.4 stemthick
+                        yscaled 0.4 stemthick
+                        rotated 45;
+
+       ellipse := fullcircle xscaled 2.4 stemthick
+                             yscaled 0.4 stemthick
+                             rotated 45;
+
+       z1 = (0.00 staff_space, +1.80 staff_space);
+       z2 = (0.00 staff_space, -0.15 staff_space);
+       z3 = (0.25 staff_space, -0.30 staff_space);
+       z4 = (0.50 staff_space, +0.00 staff_space);
+       z5 = (0.30 staff_space, +0.30 staff_space);
+       z6 = (0.00 staff_space, +0.15 staff_space);
+
+       pat := z3
+              .. z4
+              .. z5;
+
+       save t;
+       numeric t[];
+
+       % we have to find the envelope intersections (if any)
+       t1 = find_envelope_cusp (reverse ellipse, pat, 1/256) + 3;
+       if t1 < 3:
+               t1 := 3;
+       fi;
+       t2 = find_envelope_cusp (ellipse, reverse pat, 1/256);
+       if t2 < 0:
+               t2 := 3;
+       else:
+               t2 := length pat - t2 + 3;
+       fi;
+
+       save dirs, s;
+       pair dirs[];
+
+       s := 1/8;
+
+       % we approximate `draw pat'
+       for i = 3 step s until 5:
+               dirs[i] := direction (i - 3) of pat;
+       endfor;
+
+       fill get_subpath (ellipse, up, down, z1)
+            -- get_subpath (ellipse, down, z3 - z2, z2)
+            -- get_subpoint (ellipse, z3 - z2, z3)
+            for i = 3 step s until 5:
+                    .. get_subpoint (ellipse, dirs[i],
+                                     point (i - 3) of pat)
+            endfor
+            .. get_subpoint (ellipse, z6 - z5, z5)
+            -- get_subpoint (ellipse, z6 - z5, z6)
+            -- get_subpoint (ellipse, z5 - z6, z6)
+            -- get_subpoint (ellipse, z5 - z6, z5)
+            -- get_subpoint (ellipse, -dirs[5], z5)
+            for i = (5 - s) step -s until t2:
+                    .. get_subpoint (ellipse, -dirs[i],
+                                     point (i - 3) of pat)
+            endfor
+            .. get_subpoint (ellipse, -direction (t2 - 3) of pat,
+                             point (t2 - 3) of pat)
+            -- get_subpoint (ellipse, -direction (t1 - 3) of pat,
+                             point (t1 - 3) of pat)
+            for i = (floor ((t1 - 3) / s) * s + 3) step -s until (3 + s):
+                    .. get_subpoint (ellipse, -dirs[i],
+                                     point (i - 3) of pat)
+            endfor
+            .. get_subpoint (ellipse, -dirs[3], z3)
+            -- get_subpoint (ellipse, z2 - z3, z3)
+            -- get_subpoint (ellipse, z2 - z3, z2)
+            -- get_subpoint (ellipse, up, z2)
+            -- cycle;
+
+%      draw z1
+%           -- z2
+%           -- pat
+%           -- z6;
+
+       set_char_box (0.00 staff_space# + 1.0 stemthick#,
+                     0.50 staff_space# + 1.0 stemthick#,
+                     0.30 staff_space# + 0.5 stemthick#, 
+                     1.80 staff_space# + 0.5 stemthick#);
+
+       labels (1, 2, 3, 4, 5, 6);
+fet_endchar;
+
+
+fet_endgroup ("accidentals");
index 34ddbb88121e5844f4e1441f4d1e1633876e73c7..3181eaa935a16c1e5467d46f717ec7fe785038d0 100644 (file)
@@ -6,20 +6,20 @@
 % (c) 2001--2006 Juergen Reuter <reuter@ipd.uka.de>
 %
 
-fet_begingroup ("clefs")
+fet_begingroup ("clefs");
 
 %
 % character aligment:
 %
 %   Each clef is associated with a particular pitch: the treble clef
-%   with the 'g', the alto clef with the 'c', the bass clef with the
-%   'f', etc.  The shape of each clef character defines a vertical
+%   with the `g', the alto clef with the `c', the bass clef with the
+%   `f', etc.  The shape of each clef character defines a vertical
 %   position that is assumed to represent this pitch.  For the treble
 %   clef, it is the vertical position of the center of the spiral
-%   ending that represents the 'g' pitch.  For the bass clef, it is
+%   ending that represents the `g' pitch.  For the bass clef, it is
 %   the center between the two fat dots that define the vertical
-%   position of the 'f' pitch.  For the alto clef, it is the vertical
-%   center of the clef that is aligned with the 'c' pitch.  For each
+%   position of the `f' pitch.  For the alto clef, it is the vertical
+%   center of the clef that is aligned with the `c' pitch.  For each
 %   clef character, this center should be vertically aligned with the
 %   point (0, 0).  The horizontal alignment of each clef character
 %   should be such that the vertical line through the point (0, 0)
@@ -31,12 +31,12 @@ fet_begingroup ("clefs")
 %
 % * breapth: Ignored (as far as I know).  Should be set to 0.
 %
-% * width: Should match the head's width.
+% * width: Should match the clef's width.
 %
-% * depth: Should match the bottom edge of the head.  Affects vertical
+% * depth: Should match the bottom edge of the clef.  Affects vertical
 %   collision handling.
 %
-% * height: Should match the top edge of the head.  Affects vertical
+% * height: Should match the top edge of the clef.  Affects vertical
 %   collision handling.
 %
 
@@ -49,96 +49,153 @@ fet_begingroup ("clefs")
 %
 %
 %
-def draw_vaticana_do_clef(expr exact_center, reduction) = 
+def draw_vaticana_do_clef (expr exact_center, reduction) = 
        save reduced_il;
 
        reduced_il# = staff_space# * reduction;
-       set_char_box(0 - xpart exact_center,
-                    0.5reduced_il# + xpart exact_center,
-                    0.8reduced_il# - ypart exact_center,
-                    0.8reduced_il# + ypart exact_center);
 
-       define_pixels(reduced_il);
+       set_char_box (0 - xpart exact_center,
+                     0.5 reduced_il# + xpart exact_center,
+                     0.8 reduced_il# - ypart exact_center,
+                     0.8 reduced_il# + ypart exact_center);
 
-       pickup pencircle xscaled 0.6linethickness yscaled 0.6 reduced_il;
+       define_pixels (reduced_il);
 
-       save za, zb, zc, zd, ze, zf;
-       pair za, zb, zc, zd, ze, zf;
+       save pat, ellipse, clef;
+       path pat, ellipse, clef;
+
+       pickup pencircle xscaled 0.6 linethickness
+                        yscaled 0.6 reduced_il;
+
+       ellipse := reverse fullcircle xscaled 0.6 linethickness
+                                     yscaled 0.6 reduced_il;
 
        save xoffs, yoffs;
+
        xoffs# = xpart exact_center;
        yoffs# = ypart exact_center;
-       define_pixels(xoffs, yoffs);
-
-       rt  za = (xoffs + 0.50reduced_il, yoffs - .45reduced_il);
-           zb = (xoffs + 0.25reduced_il, yoffs - .50reduced_il);
-       lft zc = (xoffs + 0.00reduced_il, yoffs - .25reduced_il);
-       lft zd = (xoffs + 0.00reduced_il, yoffs + .25reduced_il);
-           ze = (xoffs + 0.25reduced_il, yoffs + .50reduced_il);
-       rt  zf = (xoffs + 0.50reduced_il, yoffs + .45reduced_il);
-       draw za .. zb .. zc --  % lower punctum
-            zd .. ze .. zf;    % upper punctum
+
+       define_pixels (xoffs, yoffs);
+
+       rt z11 = (xoffs + 0.50 reduced_il, yoffs - .45 reduced_il);
+       z12 = (xoffs + 0.25 reduced_il, yoffs - .50 reduced_il);
+       lft z13 = (xoffs + 0.00 reduced_il, yoffs - .28 reduced_il);
+       lft z14 = (xoffs, yoffs);
+
+       pat := z11
+              .. z12
+              .. z13
+              -- z14;
+
+       save shift;
+       pair shift;
+
+       % adjust vertically to fit into bounding box
+       shift = find_tangent_shift (((0, -d + 0.3 reduced_il)
+                                    -- (w, -d + 0.3 reduced_il)), pat,
+                                   (0, -d / 2), (0, d / 2));
+       pat := pat shifted shift;
+
+       clef := rt z14{down}
+               .. top (point 1 of pat)
+               .. get_subpath (ellipse,
+                               -direction 0 of pat, direction 0 of pat,
+                               point 0 of pat)
+               .. bot (point 1 of pat)
+               .. get_subpath (ellipse,
+                               direction 2 of pat, up,
+                               point 2 of pat);
+
+       fill clef
+            -- reverse clef yscaled -1
+            -- cycle;
+
+       labels (11, 12, 13, 14);
 enddef;
 
 
-fet_beginchar("Ed. Vat. do clef", "vaticana.do")
+fet_beginchar ("Ed. Vat. do clef", "vaticana.do");
        if test = 1:
-               draw_staff(-1,3, 0.0);
+               draw_staff (-1, 3, 0.0);
        fi;
-       draw_vaticana_do_clef((0,0), 1.0);
-fet_endchar;
-fet_beginchar("Ed. Vat. do clef", "vaticana.do_change")
-       draw_vaticana_do_clef((0,0), 1.0); % no reduction
+       draw_vaticana_do_clef ((0, 0), 1.0);
 fet_endchar;
 
 
-def draw_vaticana_fa_clef(expr exact_center, reduction) = 
+fet_beginchar ("Ed. Vat. do clef", "vaticana.do_change");
+       draw_vaticana_do_clef ((0, 0), 1.0); % no reduction
+fet_endchar;
 
-       save reduced_il, z;
-       reduced_il# = staff_space# * reduction;
-       define_pixels(reduced_il);
 
-       save za, zb, zc, zd, ze;
-       pair za, zb, zc, zd, ze;
+def draw_vaticana_fa_clef (expr exact_center, reduction) = 
+       save reduced_il, xoffs, yoffs;
 
-       save xoffs, yoffs;
+       reduced_il# = staff_space# * reduction;
        xoffs# = xpart exact_center;
        yoffs# = ypart exact_center;
-       define_pixels(xoffs, yoffs);
-
-       %left-handed punctum
-       pickup pencircle xscaled 0.6linethickness yscaled 0.5reduced_il;
-       lft za = (xoffs + 0.00reduced_il, xoffs + 0.00reduced_il);
-           zb = (xoffs + 0.25reduced_il, xoffs + 0.05reduced_il);
-       rt  zc = (xoffs + 0.50reduced_il, xoffs - 0.05reduced_il);
-       draw za .. zb .. zc;
-
-       %stem
-       pickup pencircle scaled 0.6linethickness;
-       xpart zc = xpart zd = xpart ze;
-       ypart zd = yoffs = bot ypart ze + 1.5reduced_il;
-       draw zd -- ze;
-
-       %right-handed puncta as in do clef
-       draw_vaticana_do_clef(exact_center + (0.55reduced_il#, 0), reduction);
-
-       set_char_box(0 - xpart exact_center,
-                    1.05reduced_il# + xpart exact_center,
-                    1.5reduced_il# - ypart exact_center,
-                    0.8reduced_il# + ypart exact_center);
+
+       define_pixels (reduced_il, xoffs, yoffs);
+
+       % left-handed punctum
+       pickup pencircle xscaled 0.6 linethickness
+                        yscaled 0.5 reduced_il;
+
+       save ellipse, pat;
+       path ellipse, pat;
+
+       ellipse := reverse fullcircle xscaled 0.6 linethickness
+                                     yscaled 0.5 reduced_il;
+
+       lft z21 = (xoffs + 0.00 reduced_il, yoffs + 0.00 reduced_il);
+       z22 = (xoffs + 0.25 reduced_il, yoffs + 0.05 reduced_il);
+       rt z23 = (xoffs + 0.50 reduced_il, yoffs - 0.05 reduced_il);
+
+       pat := z21
+              .. z22
+              .. z23;  
+
+       fill get_subpath (ellipse,
+                         -direction 0 of pat, direction 0 of pat, z21)
+            .. top z22
+            .. get_subpath (ellipse,
+                            direction 2 of pat, -direction 2 of pat, z23)
+            .. bot z22
+            .. cycle;
+
+       % stem
+       pickup pencircle scaled 0.6 linethickness;
+
+       x23 = x24;
+       yoffs = bot y24 + 1.5 reduced_il;
+
+       draw_rounded_block (bot lft z24, top rt z23, 0.6 linethickness);
+
+       labels (21, 22, 23, 24);
+
+       % right-handed puncta as in do clef
+       draw_vaticana_do_clef (exact_center + (0.55 reduced_il#, 0),
+                              reduction);
+
+       set_char_box (0 - xpart exact_center,
+                     1.05 reduced_il# + xpart exact_center,
+                     1.5 reduced_il# - ypart exact_center,
+                     0.8 reduced_il# + ypart exact_center);
 enddef;
 
 
-fet_beginchar("Ed. Vat. fa clef", "vaticana.fa")
+fet_beginchar ("Ed. Vat. fa clef", "vaticana.fa");
        if test = 1:
-               draw_staff(-1,3, 0.0);
+               draw_staff (-1, 3, 0.0);
        fi;
-       draw_vaticana_fa_clef((0,0), 1.0);
+       draw_vaticana_fa_clef ((0, 0), 1.0);
 fet_endchar;
-fet_beginchar("Ed. Vat. fa clef", "vaticana.fa_change")
-       draw_vaticana_fa_clef((0,0), 1.0); % no reduction
+
+
+fet_beginchar ("Ed. Vat. fa clef", "vaticana.fa_change");
+       draw_vaticana_fa_clef ((0, 0), 1.0); % no reduction
 fet_endchar;
 
+
 %%%%%%%%
 %
 %
@@ -147,114 +204,154 @@ fet_endchar;
 %
 %
 %
-def draw_medicaea_do_clef(expr exact_center, reduction) = 
+def draw_medicaea_do_clef (expr exact_center, reduction) = 
        save reduced_il, reduced_slt;
+
        reduced_il# = staff_space# * reduction;
        reduced_slt# = linethickness# * reduction;
-       define_pixels(reduced_il);
-       define_pixels(reduced_slt);
+
+       define_pixels (reduced_il);
+       define_pixels (reduced_slt);
+
+       set_char_box (0 - xpart exact_center,
+                     1.0 reduced_il# + xpart exact_center,
+                     1.5 reduced_il# - ypart exact_center,
+                     1.5 reduced_il# + ypart exact_center);
 
        save flag_height;
+
        flag_height# = 0.5 reduced_il#;
-       define_pixels(flag_height);
+
+       define_pixels (flag_height);
 
        save xoffs, yoffs;
+
        xoffs# = xpart exact_center;
        yoffs# = ypart exact_center;
-       define_pixels(xoffs, yoffs);
-
-       %upper flag
-       save za, zb;
-       pair za, zb;
-       pickup pencircle xscaled reduced_slt yscaled flag_height;
-       xoffs = lft xpart za = rt xpart zb - reduced_il;
-       ypart za = yoffs + 0.5 (reduced_il - flag_height - staff_space);
-       ypart zb = ypart za - reduced_il + flag_height;
-       draw za -- zb;
-
-       %lower flag
-       save za, zb;
-       pair za, zb;
-       pickup pencircle xscaled reduced_slt yscaled flag_height;
-       xoffs = lft xpart za = rt xpart zb - reduced_il;
-       ypart za = yoffs + 0.5 (reduced_il - flag_height + staff_space);
-       ypart zb = ypart za - reduced_il + flag_height;
-       draw za -- zb;
-
-       %stem
-       save za, zb;
-       pair za, zb;
+
+       define_pixels (xoffs, yoffs);
+
+       % flags
+       pickup pencircle xscaled reduced_slt
+                        yscaled flag_height;
+
+       save ellipse;
+       path ellipse;
+
+       ellipse := reverse fullcircle xscaled reduced_slt
+                                     yscaled flag_height;
+
+       xoffs = lft x1 = rt x2 - reduced_il;
+       y1 = yoffs + 0.5 (reduced_il - flag_height - staff_space);
+       y2 = y1 - reduced_il + flag_height;
+
+       fill top z1
+            -- get_subpath (ellipse, z2 - z1, z1 - z2, z2)
+            -- bot z1
+            -- cycle;
+
+       xoffs = lft x3 = rt x4 - reduced_il;
+       y3 = yoffs + 0.5 (reduced_il - flag_height + staff_space);
+       y4 = y3 - reduced_il + flag_height;
+
+       fill top z3
+            -- get_subpath (ellipse, z4 - z3, z3 - z4, z4)
+            -- bot z3
+            -- cycle;
+
+       % stem
        pickup pencircle scaled reduced_slt;
-       lft xpart za = lft xpart zb = xoffs;
-       yoffs = top ypart zb - 1.5 reduced_il = bot ypart za + 1.5 reduced_il;
-       draw za -- zb;
-
-       set_char_box(0 - xpart exact_center,
-                    1.0reduced_il# + xpart exact_center,
-                    1.5reduced_il# - ypart exact_center,
-                    1.5reduced_il# + ypart exact_center);
+
+       lft x5 = lft x6 = xoffs;
+       yoffs = top y6 - 1.5 reduced_il = bot y5 + 1.5 reduced_il;
+
+       draw_rounded_block (bot lft z5, top rt z6, reduced_slt);
+
+       labels (1, 2, 3, 4, 5, 6);
 enddef;
 
 
-fet_beginchar("Ed. Med. do clef", "medicaea.do")
+fet_beginchar ("Ed. Med. do clef", "medicaea.do");
        if test = 1:
-               draw_staff(-1,3, 0.0);
+               draw_staff (-1, 3, 0.0);
        fi;
-       draw_medicaea_do_clef((0,0), 1.0);
+       draw_medicaea_do_clef ((0, 0), 1.0);
 fet_endchar;
-fet_beginchar("Ed. Med. do clef", "medicaea.do_change")
-       draw_medicaea_do_clef((0,0), .8);
+
+
+fet_beginchar ("Ed. Med. do clef", "medicaea.do_change");
+       draw_medicaea_do_clef ((0, 0), .8);
 fet_endchar;
 
 
-def draw_medicaea_fa_clef(expr exact_center, reduction) = 
+def draw_medicaea_fa_clef (expr exact_center, reduction) = 
        % inspired by Regensburger Edition of Medicaea (1885/86), in:
        % MGG, volume 2, col. 1327 ("Choralreform"), fig. 2.
 
        save reduced_il, reduced_slt;
+
        reduced_il# = staff_space# * reduction;
        reduced_slt# = linethickness# * reduction;
-       define_pixels(reduced_il);
-       define_pixels(reduced_slt);
 
-       save za, zb, zc, zd, ze;
-       pair za, zb, zc, zd, ze;
+       define_pixels (reduced_il);
+       define_pixels (reduced_slt);
 
        save xoffs, yoffs;
+
        xoffs# = xpart exact_center;
        yoffs# = ypart exact_center;
-       define_pixels(xoffs, yoffs);
 
-       %stem
+       define_pixels (xoffs, yoffs);
+
+       % stem
        pickup pencircle scaled linethickness;
-       xpart za = xpart zb = xoffs + 0.4reduced_il;
-       ypart za = yoffs = bot ypart zb + 1.5reduced_il;
-       draw za -- zb;
-
-       %left-handed punctum
-       pickup pencircle xscaled reduced_slt yscaled reduced_il;
-       lft zc = (xoffs, yoffs);
-       zd = lft zc + (0.4reduced_il, 0);
-       draw zc -- zd;
-
-       %right-handed puncta as in do clef
-       draw_medicaea_do_clef(exact_center + (0.7reduced_il#, 0), reduction);
-
-       set_char_box(0 - xpart exact_center,
-                    1.7reduced_il# + xpart exact_center,
-                    1.5reduced_il# - ypart exact_center,
-                    1.5reduced_il# + ypart exact_center);
+
+       x11 = x12 = xoffs + 0.4 reduced_il;
+       y11 = yoffs = bot y12 + 1.5 reduced_il;
+
+       draw_rounded_block (bot lft z12, top rt z11, linethickness);
+
+       % left-handed punctum
+
+       pickup pencircle xscaled reduced_slt
+                        yscaled reduced_il;
+
+       save ellipse;
+       path ellipse;
+
+       ellipse := reverse fullcircle xscaled reduced_slt
+                                     yscaled reduced_il;
+
+       lft z13 = (xoffs, yoffs);
+       rt z14 = z11 + (linethickness / 2, 0);
+
+       fill get_subpath (ellipse, left, right, z13)
+            -- get_subpath (ellipse, right, left, z14)
+            -- cycle;
+
+       labels (11, 12, 13, 14);
+
+       % right-handed puncta as in do clef
+       draw_medicaea_do_clef (exact_center + (0.7 reduced_il#, 0),
+                              reduction);
+
+       set_char_box (0 - xpart exact_center,
+                     1.7 reduced_il# + xpart exact_center,
+                     1.5 reduced_il# - ypart exact_center,
+                     1.5 reduced_il# + ypart exact_center);
 enddef;
 
 
-fet_beginchar("Ed. Med. fa clef", "medicaea.fa")
+fet_beginchar ("Ed. Med. fa clef", "medicaea.fa");
        if test = 1:
-               draw_staff(-1,3, 0.0);
+               draw_staff (-1, 3, 0.0);
        fi;
-       draw_medicaea_fa_clef((0,0), 1.0);
+       draw_medicaea_fa_clef ((0, 0), 1.0);
 fet_endchar;
-fet_beginchar("Ed. Med. fa clef", "medicaea.fa_change")
-       draw_medicaea_fa_clef((0,0), .8);
+
+
+fet_beginchar ("Ed. Med. fa clef", "medicaea.fa_change");
+       draw_medicaea_fa_clef ((0, 0), .8);
 fet_endchar;
 
 
@@ -273,361 +370,743 @@ fet_endchar;
 % exact_center: the coordinates of the vertical center point of the
 %               left edge.
 %
-def draw_brevis(expr exact_center, bwidth, bheight, blinethickness) =
+def draw_brevis (expr exact_center, bwidth, bheight, blinethickness) =
+       save brevis_width, brevis_height, linethickness;
+
+       brevis_width# = bwidth;
+       brevis_height# = bheight;
+       linethickness# = blinethickness;
+
+       save beam_width, beam_height;
+       save serif_size, serif_protrude, hole_height;
+
+       beam_width# = 1.4 linethickness#;
+       hole_height# = 3 linethickness#;
+       2 beam_height# + hole_height# = brevis_height#;
+       serif_size# = (hole_height# - linethickness#) / 2;
+       serif_protrude# = 1.5 serif_size#;
 
+       save xoffs, yoffs;
+
+       xoffs# = xpart exact_center;
+       yoffs# = ypart exact_center;
+
+       define_pixels (xoffs, yoffs);
+       define_pixels (brevis_width, brevis_height, linethickness);
+       define_pixels (beam_width, beam_height, serif_size, serif_protrude);
+
+       z1l = (xoffs, yoffs - linethickness);
+       z2r = z1r + serif_size * (1, -1);
+       z3l = z2l + (-serif_size, -serif_protrude);
+
+       penpos1 (beam_width, 0);
+       penpos2 (beam_height, 90);
+       penpos3 (beam_width, 180);
+
+       save pat_in, pat_out;
+       path pat_in, pat_out;
+
+       pat_out := z3r{down}
+                  .. z3l{up}
+                  .. z2l{right};
+       pat_out := pat_out
+                  -- reverse pat_out xscaled -1
+                                     shifted (2 xoffs + brevis_width, 0);
+       pat_out := pat_out
+                  -- reverse pat_out yscaled -1
+                                     shifted (0, 2 yoffs)
+                  -- cycle;
+
+       pat_in := z1r{down}
+                 .. z2r{right};
+       pat_in := pat_in
+                 -- reverse pat_in xscaled -1
+                                   shifted (2 xoffs + brevis_width, 0);
+       pat_in := pat_in
+                 -- reverse pat_in yscaled -1
+                                   shifted (0, 2 yoffs)
+                 -- cycle;
+
+       fill pat_out;
+       unfill pat_in;
+
+       penlabels (1, 2, 3);
+enddef;
+
+%
+% Draw two brevis notes; the second one shifted down by `shift'.
+% The other parameters are the same as with `draw_brevis'.
+%
+def draw_double_brevis (expr exact_center, bwidth, bheight,
+                            blinethickness, shift) =
        save brevis_width, brevis_height, linethickness;
-       brevis_width# = bwidth; brevis_height# = bheight;
+
+       brevis_width# = bwidth;
+       brevis_height# = bheight;
        linethickness# = blinethickness;
 
-       save beam_width, beam_height, serif_size, serif_protrude, hole_height;
+       save beam_width, beam_height;
+       save serif_size, serif_protrude, hole_height;
+
        beam_width# = 1.4 linethickness#;
        hole_height# = 3 linethickness#;
        2 beam_height# + hole_height# = brevis_height#;
-       serif_size# = (hole_height# - linethickness#)/2;
+       serif_size# = (hole_height# - linethickness#) / 2;
        serif_protrude# = 1.5 serif_size#;
 
        save xoffs, yoffs;
+
        xoffs# = xpart exact_center;
        yoffs# = ypart exact_center;
-       define_pixels(xoffs, yoffs);
-
-       define_pixels(brevis_width, brevis_height, linethickness);
-       define_pixels(beam_width, beam_height, serif_size, serif_protrude);
-
-       penpos1(beam_width, 0);
-       penpos2(beam_width, 0);
-       penpos3(beam_height, 90);
-       penpos4(beam_height, 90);
-       penpos5(beam_width, 180);
-       z1l = (xoffs, yoffs);
-       z2l = z1l + (0, -linethickness);
-       z3r = z2r + serif_size*(1,-1);
-       y4r = y3r;
-       x4l = x1l + brevis_width/2;
-       z5l = z3l + (-serif_size, -serif_protrude);
-       fill z1r -- z1l -- z5r{down} .. z5l{up} .. z3l{right}
-               -- z4l -- z4r -- z3r{left} .. z2r{up} -- cycle;
-
-       addto currentpicture also currentpicture
-               yscaled -1 shifted (0, 2*yoffs);
 
-       pickup pencircle scaled linethickness;
-       top y6 = yoffs + brevis_height/2;
-       bot y7 = yoffs - brevis_height/2;
-       lft x6 = lft x7 = xoffs;
-       draw z6 -- z7;
+       define_pixels (xoffs, yoffs);
+       define_pixels (brevis_width, brevis_height, linethickness);
+       define_pixels (beam_width, beam_height, serif_size, serif_protrude);
+
+       z1l = (xoffs, yoffs - linethickness);
+       z2r = z1r + serif_size * (1, -1);
+       z3l = z2l + (-serif_size, -serif_protrude);
+
+       penpos1 (beam_width, 0);
+       penpos2 (beam_height, 90);
+       penpos3 (beam_width, 180);
+
+       z4 = z1 shifted (0, -shift);
+       z5 = z2 shifted (0, -shift);
+       z6 = z3 shifted (0, -shift);
+       
+       penpos4 (beam_width, 0);
+       penpos5 (beam_height, 90);
+       penpos6 (beam_width, 180);
+
+       save pat_in, pat_out;
+       path pat_in, pat_out;
+
+       pat_out := z6r{down}
+                  .. z6l{up}
+                  .. z5l{right};
+       pat_out := pat_out
+                  -- reverse pat_out xscaled -1
+                                     shifted (2 xoffs + brevis_width, 0);
+       pat_out := pat_out
+                  -- reverse pat_out yscaled -1
+                                     shifted (0, shift - 2 yoffs)
+                  -- cycle;
+
+       fill pat_out;
+
+       pat_in := z1r{down}
+                 .. z2r{right};
+       pat_in := pat_in
+                 -- reverse pat_in xscaled -1
+                                   shifted (2 xoffs + brevis_width, 0);
+       pat_in := pat_in
+                 -- reverse pat_in yscaled -1
+                                   shifted (0, 2 yoffs)
+                 -- cycle;
+
+       unfill pat_in;
+       unfill pat_in shifted (0, -shift);
+
+       penlabels (1, 2, 3, 4, 5, 6);
+enddef;
+
+
+%
+% Draw three brevis notes; the second one shifted down by `shift',
+% the third one by `2 shift'.
+% The other parameters are the same as with `draw_brevis'.
+%
+def draw_triple_brevis (expr exact_center, bwidth, bheight,
+                            blinethickness, shift) =
+       save brevis_width, brevis_height, linethickness;
+
+       brevis_width# = bwidth;
+       brevis_height# = bheight;
+       linethickness# = blinethickness;
+
+       save beam_width, beam_height;
+       save serif_size, serif_protrude, hole_height;
 
-       addto currentpicture also currentpicture
-               xscaled -1 shifted (2xoffs + brevis_width, 0);
+       beam_width# = 1.4 linethickness#;
+       hole_height# = 3 linethickness#;
+       2 beam_height# + hole_height# = brevis_height#;
+       serif_size# = (hole_height# - linethickness#) / 2;
+       serif_protrude# = 1.5 serif_size#;
+
+       save xoffs, yoffs;
+
+       xoffs# = xpart exact_center;
+       yoffs# = ypart exact_center;
+
+       define_pixels (xoffs, yoffs);
+       define_pixels (brevis_width, brevis_height, linethickness);
+       define_pixels (beam_width, beam_height, serif_size, serif_protrude);
+
+       z1l = (xoffs, yoffs - linethickness);
+       z2r = z1r + serif_size * (1, -1);
+       z3l = z2l + (-serif_size, -serif_protrude);
+
+       penpos1 (beam_width, 0);
+       penpos2 (beam_height, 90);
+       penpos3 (beam_width, 180);
+
+       z7 = z1 shifted (0, -2 shift);
+       z8 = z2 shifted (0, -2 shift);
+       z9 = z3 shifted (0, -2 shift);
+       
+       penpos7 (beam_width, 0);
+       penpos8 (beam_height, 90);
+       penpos9 (beam_width, 180);
+
+       save pat_in, pat_out;
+       path pat_in, pat_out;
+
+       pat_out := z9r{down}
+                  .. z9l{up}
+                  .. z8l{right};
+       pat_out := pat_out
+                  -- reverse pat_out xscaled -1
+                                     shifted (2 xoffs + brevis_width, 0);
+       pat_out := pat_out
+                  -- reverse pat_out yscaled -1
+                                     shifted (0, -2 yoffs)
+                  -- cycle;
+
+       fill pat_out;
+
+       pat_in := z1r{down}
+                 .. z2r{right};
+       pat_in := pat_in
+                 -- reverse pat_in xscaled -1
+                                   shifted (2 xoffs + brevis_width, 0);
+       pat_in := pat_in
+                 -- reverse pat_in yscaled -1
+                                   shifted (0, 2 yoffs)
+                 -- cycle;
+
+       unfill pat_in;
+       unfill pat_in shifted (0, -shift);
+       unfill pat_in shifted (0, -2 shift);
+
+       penlabels (1, 2, 3, 7, 8, 9);
 enddef;
 
 
-def draw_neomensural_c_clef(expr exact_center, reduction) = 
+def draw_neomensural_c_clef (expr exact_center, reduction) = 
        save reduced_il, reduced_slt, stem_width;
+
        reduced_il# = staff_space# * reduction;
        reduced_slt# = linethickness# * reduction;
        stem_width# = 1.4 reduced_slt#;
-       define_pixels(reduced_il, reduced_slt, stem_width);
 
-       draw_brevis(exact_center + (3reduced_slt#, 0),
-                   2reduced_il#, reduced_il#, reduced_slt#);
+       define_pixels (reduced_il, reduced_slt, stem_width);
+
+       set_char_box (0 - xpart exact_center,
+                     2 reduced_il# + 6 reduced_slt# + xpart exact_center,
+                     2 reduced_il# - ypart exact_center,
+                     2 reduced_il# + ypart exact_center);
+
+       draw_brevis (exact_center + (3 reduced_slt#, 0),
+                    2 reduced_il#, reduced_il#, reduced_slt#);
 
        save xoffs, yoffs;
+
        xoffs# = xpart exact_center;
        yoffs# = ypart exact_center;
-       define_pixels(xoffs, yoffs);
-
-       pickup pencircle xscaled stem_width yscaled blot_diameter;
-       lft x8  = lft x9  = xoffs;
-       lft x10 = lft x11 = lft x8  + 3reduced_slt;
-       rt  x12 = rt  x13 = lft x10 + 2reduced_il;
-       rt  x14 = rt  x15 = rt  x12 + 3reduced_slt;
-       top y9 - bot y8 = 4reduced_il;
-       top y9 + bot y8 = 2yoffs;
-       y12 = y14 = y10 = y8; y13 = y15 = y11 = y9;
-       draw z8 -- z9;
-       draw z10 -- z11;
-       draw z12 -- z13;
-       draw z14 -- z15;
-
-       set_char_box(0 - xpart exact_center,
-                    2reduced_il# + 6reduced_slt# + xpart exact_center,
-                    2reduced_il# - ypart exact_center,
-                    2reduced_il# + ypart exact_center);
+
+       define_pixels (xoffs, yoffs);
+
+       pickup pencircle xscaled stem_width
+                        yscaled blot_diameter;
+
+       save ellipse, pat;
+       path ellipse, pat;
+
+       ellipse := fullcircle xscaled stem_width
+                             yscaled blot_diameter;
+
+       lft x11 = lft x12 = xoffs;
+       top y12 - bot y11 = 4 reduced_il;
+       top y12 + bot y11 = 2 yoffs;
+       x13 = x3;
+       y13 = y11;
+       rt x14 = rt x15 = w;
+       y14 = y11;
+       y15 = y12;
+
+       pat := get_subpath (ellipse, down, up, z13)
+              -- z3l
+              -- z3r
+              -- cycle;
+
+       fill get_subpath (ellipse, down, up, z11)
+            -- get_subpath (ellipse, up, down, z12)
+            -- cycle;
+       fill get_subpath (ellipse, down, up, z14)
+            -- get_subpath (ellipse, up, down, z15)
+            -- cycle;
+
+       fill pat;
+       fill pat xscaled -1
+                shifted (w, 0);
+       fill pat yscaled -1
+                shifted (0, 2 yoffs);
+       fill pat scaled -1
+                shifted (w, 2 yoffs);
+
+       labels (11, 12, 13, 14, 15);
 enddef;
 
 
-fet_beginchar("neo-mensural c clef", "neomensural.c")
+fet_beginchar ("neo-mensural c clef", "neomensural.c");
        if test = 1:
-               draw_staff(-1,3, 0.0);
+               draw_staff (-1, 3, 0.0);
        fi;
-       draw_neomensural_c_clef((0,0), 1.0);
+       draw_neomensural_c_clef ((0, 0), 1.0);
 fet_endchar;
-fet_beginchar("neo-mensural c clef", "neomensural.c_change")
-       draw_neomensural_c_clef((0,0), .8);
+
+
+fet_beginchar ("neo-mensural c clef", "neomensural.c_change");
+       draw_neomensural_c_clef ((0, 0), .8);
 fet_endchar;
 
 
-def draw_petrucci_c_clef(expr exact_center, flare_align, reduction) = 
+def draw_petrucci_c_clef (expr exact_center, flare_align, reduction) = 
        % inspired by Josquin Desprez, "Stabat Mater", Libro tertio,
        % 1519, printed by Petrucci, in: MGG, volume 7, Table 11.
        % Also by Petrucci's Canti C, Venedig 1503.  In: MGG, volume
        % 9, p. 1681/1682.
 
        save reduced_il, reduced_slt;
+
        reduced_il# = staff_space# * reduction;
        reduced_slt# = linethickness# * reduction;
-       define_pixels(reduced_il);
 
-       draw_brevis(exact_center + (0, 0.5staff_space#),
-                   reduced_il#, reduced_il#, reduced_slt#);
+       define_pixels (reduced_il);
 
-       addto currentpicture also currentpicture shifted (0, -staff_space);
+       draw_double_brevis (exact_center + (0, 0.5 staff_space#),
+                           reduced_il#, reduced_il#, reduced_slt#,
+                           staff_space);
 
        save half_reduced_il, left_depth, left_height;
-       half_reduced_il# = staff_space# * sqrt(reduction);
-       left_height# = half_reduced_il# * min(3.2, 3.2 + 0.2 + flare_align);
-       left_depth# = half_reduced_il# * min(3.2, 3.2 + 0.2 - flare_align);
 
-       define_pixels(half_reduced_il);
-       define_pixels(left_depth, left_height);
+       half_reduced_il# = staff_space# * sqrt (reduction);
+       left_height# = half_reduced_il# * min (3.2, 3.2 + 0.2 + flare_align);
+       left_depth# = half_reduced_il# * min (3.2, 3.2 + 0.2 - flare_align);
+
+       define_pixels (half_reduced_il);
+       define_pixels (left_depth, left_height);
+
+       set_char_box (0 - xpart exact_center,
+                     reduced_il# + xpart exact_center,
+                     left_depth# - ypart exact_center,
+                     left_height# + ypart exact_center);
 
        save xoffs, yoffs;
+
        xoffs# = xpart exact_center;
        yoffs# = ypart exact_center;
-       define_pixels(xoffs, yoffs);
-
-       pickup pencircle xscaled 1.4 linethickness yscaled blot_diameter;
-       lft x8 = lft x9 = xoffs;
-       top y8 = yoffs + left_height;
-       bot y9 = yoffs - left_depth;
-       draw z8 .. z9;
-
-       rt x10 = rt x11 = xoffs + brevis_width;
-       y10 = min(y8 - 0.2*half_reduced_il, yoffs + 2.2half_reduced_il);
-       y11 = max(y9 + 0.2*half_reduced_il, yoffs - 2.2half_reduced_il);
-       draw z10 .. z11;
-
-       set_char_box(0 - xpart exact_center,
-                    reduced_il# + xpart exact_center,
-                    left_depth# - ypart exact_center,
-                    left_height# + ypart exact_center);
+
+       define_pixels (xoffs, yoffs);
+
+       pickup pencircle xscaled 1.4 linethickness
+                        yscaled blot_diameter;
+
+       save ellipse;
+       path ellipse;
+
+       ellipse := fullcircle xscaled 1.4 linethickness
+                             yscaled blot_diameter;
+
+       lft x11 = lft x13 = xoffs;
+       top y11 = yoffs + left_height;
+       bot y13 = yoffs - left_depth;
+       rt x15 = rt x17 = xoffs + brevis_width;
+       y15 = min (y11 - 0.2 half_reduced_il, yoffs + 2.2 half_reduced_il);
+       y17 = max (y13 + 0.2 half_reduced_il, yoffs - 2.2 half_reduced_il);
+
+       z12 = z14 yscaled -1;
+       z14 = z6;
+       z16 = z18 yscaled -1;
+       rt z18 = lft z14 shifted (brevis_width, 0);
+
+       penpos12 (1.4 linethickness, 0);
+       penpos14 (1.4 linethickness, 0);
+       penpos16 (1.4 linethickness, 0);
+       penpos18 (1.4 linethickness, 0);
+
+       if top y11 > -y6 + 0.7 linethickness:
+               fill get_subpath (ellipse, up, down, z11)
+                    -- z12l
+                    -- z12r
+                    -- cycle;
+       fi;
+       if bot y13 < y6 - 0.7 linethickness:
+               fill get_subpath (ellipse, down, up, z13)
+                    -- z14r
+                    -- z14l
+                    -- cycle;
+       fi;
+       if top y15 > -y6 + 0.7 linethickness:
+               fill get_subpath (ellipse, up, down, z15)
+                    -- z16l
+                    -- z16r
+                    -- cycle;
+       fi;
+       if bot y17 < y6 - 0.7 linethickness:
+               fill get_subpath (ellipse, down, up, z17)
+                    -- z18r
+                    -- z18l
+                    -- cycle;
+       fi;
+
+       labels (11, 13, 15, 17);
+       penlabels (12, 14, 16, 18);
 enddef;
 
 
-fet_beginchar("petrucci c1 clef", "petrucci.c1")
+fet_beginchar ("petrucci c1 clef", "petrucci.c1");
        if test = 1:
-               draw_staff(-1,3, 0.0);
+               draw_staff (-1, 3, 0.0);
        fi;
-       draw_petrucci_c_clef((0,0), +2, 1.0);
+       draw_petrucci_c_clef ((0, 0), +2, 1.0);
 fet_endchar;
-fet_beginchar("petrucci c1 clef", "petrucci.c1_change")
-       draw_petrucci_c_clef((0,0), +2, .8);
+
+
+fet_beginchar ("petrucci c1 clef", "petrucci.c1_change");
+       draw_petrucci_c_clef ((0, 0), +2, .8);
 fet_endchar;
 
-fet_beginchar("petrucci c2 clef", "petrucci.c2")
+
+fet_beginchar ("petrucci c2 clef", "petrucci.c2");
        if test = 1:
-               draw_staff(-1,3, 0.0);
+               draw_staff (-1, 3, 0.0);
        fi;
-       draw_petrucci_c_clef((0,0), +1, 1.0);
+       draw_petrucci_c_clef ((0, 0), +1, 1.0);
 fet_endchar;
-fet_beginchar("petrucci c2 clef", "petrucci.c2_change")
-       draw_petrucci_c_clef((0,0), +1, .8);
+
+
+fet_beginchar ("petrucci c2 clef", "petrucci.c2_change");
+       draw_petrucci_c_clef ((0, 0), +1, .8);
 fet_endchar;
 
-fet_beginchar("petrucci c3 clef", "petrucci.c3")
+
+fet_beginchar ("petrucci c3 clef", "petrucci.c3");
        if test = 1:
-               draw_staff(-1,3, 0.0);
+               draw_staff (-1, 3, 0.0);
        fi;
-       draw_petrucci_c_clef((0,0), 0, 1.0);
+       draw_petrucci_c_clef ((0, 0), 0, 1.0);
 fet_endchar;
-fet_beginchar("petrucci c3 clef", "petrucci.c3_change")
-       draw_petrucci_c_clef((0,0), 0, .8);
+
+
+fet_beginchar ("petrucci c3 clef", "petrucci.c3_change");
+       draw_petrucci_c_clef ((0, 0), 0, .8);
 fet_endchar;
 
-fet_beginchar("petrucci c4 clef", "petrucci.c4")
+
+fet_beginchar ("petrucci c4 clef", "petrucci.c4");
        if test = 1:
-               draw_staff(-1,3, 0.0);
+               draw_staff (-1, 3, 0.0);
        fi;
-       draw_petrucci_c_clef((0,0), -1, 1.0);
+       draw_petrucci_c_clef ((0, 0), -1, 1.0);
 fet_endchar;
-fet_beginchar("petrucci c4 clef", "petrucci.c4_change")
-       draw_petrucci_c_clef((0,0), -1, .8);
+
+
+fet_beginchar ("petrucci c4 clef", "petrucci.c4_change");
+       draw_petrucci_c_clef ((0, 0), -1, .8);
 fet_endchar;
 
-fet_beginchar("petrucci c5 clef", "petrucci.c5")
+
+fet_beginchar ("petrucci c5 clef", "petrucci.c5");
        if test = 1:
-               draw_staff(-1,3, 0.0);
+               draw_staff (-1, 3, 0.0);
        fi;
-       draw_petrucci_c_clef((0,0), -2, 1.0);
+       draw_petrucci_c_clef ((0, 0), -2, 1.0);
 fet_endchar;
-fet_beginchar("petrucci c5 clef", "petrucci.c5_change")
-       draw_petrucci_c_clef((0,0), -2, .8);
+
+
+fet_beginchar ("petrucci c5 clef", "petrucci.c5_change");
+       draw_petrucci_c_clef ((0, 0), -2, .8);
 fet_endchar;
 
 
-def draw_mensural_c_clef(expr exact_center, reduction) =
+def draw_mensural_c_clef (expr exact_center, reduction) =
        % inspired by Ockeghem, "Missa Prolationum", in: MGG, volume
        % 9, table 94.
 
        save reduced_il;
+
        reduced_il# = staff_space# * reduction;
-       draw_brevis(exact_center + (0, 0.5staff_space#),
-                   2reduced_il#, 0.8staff_space#, 0.8linethickness#);
-       define_pixels(reduced_il);
-       addto currentpicture also currentpicture shifted (0, -staff_space);
-       addto currentpicture also currentpicture shifted (0, -staff_space);
+
+       define_pixels (reduced_il);
+
+       draw_triple_brevis (exact_center + (0, 0.5 staff_space#),
+                           2 reduced_il#, 0.8 staff_space#,
+                           0.8 linethickness#, staff_space);
 
        save half_reduced_il;
-       half_reduced_il# = staff_space# * sqrt(reduction);
-       define_pixels(half_reduced_il);
+
+       half_reduced_il# = staff_space# * sqrt (reduction);
+
+       define_pixels (half_reduced_il);
+
+       set_char_box (0 - xpart exact_center,
+                     2 reduced_il# + xpart exact_center,
+                     2.2 half_reduced_il# + staff_space# -
+                       2 ypart exact_center,
+                     2.2 half_reduced_il# + 2 ypart exact_center);
 
        save xoffs, yoffs;
+
        xoffs# = xpart exact_center;
        yoffs# = ypart exact_center;
-       define_pixels(xoffs, yoffs);
-
-       pickup pencircle xscaled 1.4 linethickness yscaled blot_diameter;
-       lft x8 = lft x9 = xoffs;
-       top y8 = yoffs + 2.2 half_reduced_il;
-       bot y9 = yoffs - 2.2 half_reduced_il - staff_space;
-       draw z8 .. z9;
-
-       rt x10 = rt x11 = xoffs + brevis_width;
-       y10 = yoffs + 1.4half_reduced_il;
-       y11 = yoffs - 1.4half_reduced_il - staff_space;
-       draw z10 .. z11;
-
-       set_char_box(0 - xpart exact_center,
-                    2reduced_il# + xpart exact_center,
-                    2.2 half_reduced_il# + staff_space# - 2 ypart exact_center,
-                    2.2 half_reduced_il# + 2 ypart exact_center);
+
+       define_pixels (xoffs, yoffs);
+
+       pickup pencircle xscaled 1.4 linethickness
+                        yscaled blot_diameter;
+
+       save ellipse;
+       path ellipse;
+
+       ellipse := fullcircle xscaled 1.4 linethickness
+                             yscaled blot_diameter;
+
+       lft x11 = lft x13 = xoffs;
+       top y11 = yoffs + 2.2 half_reduced_il;
+       bot y13 = yoffs - 2.2 half_reduced_il - staff_space;
+       rt x15 = rt x17 = xoffs + brevis_width;
+       y15 = yoffs + 1.4 half_reduced_il;
+       y17 = yoffs - 1.4 half_reduced_il - staff_space;
+
+       z12 = z14 yscaled -1 shifted (0, -staff_space);
+       z14 = z9;
+       z16 = z18 yscaled -1 shifted (0, -staff_space);
+       rt z18 = lft z14 shifted (brevis_width, 0);
+
+       penpos12 (1.4 linethickness, 0);
+       penpos14 (1.4 linethickness, 0);
+       penpos16 (1.4 linethickness, 0);
+       penpos18 (1.4 linethickness, 0);
+
+       fill get_subpath (ellipse, up, down, z11)
+            -- z12l
+            -- z12r
+            -- cycle;
+       fill get_subpath (ellipse, down, up, z13)
+            -- z14r
+            -- z14l
+            -- cycle;
+       fill get_subpath (ellipse, up, down, z15)
+            -- z16l
+            -- z16r
+            -- cycle;
+       fill get_subpath (ellipse, down, up, z17)
+            -- z18r
+            -- z18l
+            -- cycle;
+
+       labels (11, 13, 15, 17);
+       penlabels (12, 14, 16, 18);
 enddef;
 
 
-fet_beginchar("mensural c clef", "mensural.c")
+fet_beginchar ("mensural c clef", "mensural.c");
        if test = 1:
-               draw_staff(-1,3, 0.0);
+               draw_staff (-1, 3, 0.0);
        fi;
-       draw_mensural_c_clef((0,0), 1.0);
+       draw_mensural_c_clef ((0, 0), 1.0);
 fet_endchar;
-fet_beginchar("mensural c clef", "mensural.c_change")
-       draw_mensural_c_clef((0,0), .8);
+
+
+fet_beginchar ("mensural c clef", "mensural.c_change");
+       draw_mensural_c_clef ((0, 0), .8);
 fet_endchar;
 
-def draw_diamond(expr exact_center, reduction) =
+
+def draw_diamond (expr exact_center, reduction) =
        save stem_width, reduced_nht, holeheight, beamheight;
        save rh_height, rh_width;
 
        stem_width# = 1.4 reduced_slt#;
        reduced_nht# = noteheight# * reduction;
        holeheight# = 3 reduced_slt#;
-       beamheight# = 0.4(reduced_nht# - holeheight#);
+       beamheight# = 0.4 (reduced_nht# - holeheight#);
 
        rh_height# = 1.2 staff_space# * reduction;
-       rh_width# / rh_height# = tand(30);
+       rh_width# / rh_height# = tand (30);
 
-       define_pixels(beamheight);
-       define_pixels(stem_width);
-       define_pixels(rh_height);
-       define_pixels(rh_width);
+       define_pixels (beamheight, stem_width);
+       define_pixels (rh_height, rh_width);
 
        save xoffs, yoffs;
+
        xoffs# = xpart exact_center;
        yoffs# = ypart exact_center;
-       define_pixels(xoffs, yoffs);
-
-       pickup pencircle
-               xscaled beamheight
-               yscaled stem_width
-               rotated 45;
-
-       draw
-               (xoffs - rh_width/2, yoffs) --
-               (xoffs, yoffs + rh_height/2) --
-               (xoffs + rh_width/2, yoffs) --
-               (xoffs, yoffs - rh_height/2) --
-               cycle;
+
+       define_pixels (xoffs, yoffs);
+
+       pickup pencircle xscaled beamheight
+                        yscaled stem_width
+                        rotated 45;
+
+       save ellipse;
+       path ellipse;
+
+       ellipse := reverse fullcircle xscaled beamheight
+                                     yscaled stem_width
+                                     rotated 45;
+
+       x21 := xoffs - rh_width / 2;
+       y21 := yoffs;
+       x22 := xoffs;
+       y22 := yoffs + rh_height / 2;
+       x23 := xoffs + rh_width / 2;
+       y23 := yoffs;
+       x24 := xoffs;
+       y24 := yoffs - rh_height / 2;
+
+       fill get_subpath (ellipse, z21 - z24, z22 - z21, z21)
+            -- get_subpath (ellipse, z22 - z21, z23 - z22, z22)
+            -- get_subpath (ellipse, z23 - z22, z24 - z23, z23)
+            -- get_subpath (ellipse, z24 - z23, z21 - z24, z24)
+            -- cycle;
+
+       save l;
+       path l[];
+
+       l2122 := (directionpoint (z21 - z22) of ellipse) shifted z21
+                -- (directionpoint (z21 - z22) of ellipse) shifted z22;
+       l2223 := (directionpoint (z22 - z23) of ellipse) shifted z22
+                -- (directionpoint (z22 - z23) of ellipse) shifted z23;
+       l2324 := (directionpoint (z23 - z24) of ellipse) shifted z23
+                -- (directionpoint (z23 - z24) of ellipse) shifted z24;
+       l2421 := (directionpoint (z24 - z21) of ellipse) shifted z24
+                -- (directionpoint (z24 - z21) of ellipse) shifted z21;
+
+       unfill l2122 intersectionpoint l2223
+              -- l2223 intersectionpoint l2324
+              -- l2324 intersectionpoint l2421
+              -- l2421 intersectionpoint l2122
+              -- cycle;
+
+       labels (21, 22, 23, 24);
 enddef;
 
-def draw_petrucci_f_clef(expr exact_center, reduction) =
+
+def draw_petrucci_f_clef (expr exact_center, reduction) =
        % inspired by L'homme arme super voces musicales in Misse
        % Josquin, 1502, Petrucci, in: MGG, volume 7, col. 200; also
        % inspired by Gaspar van Weerbeke, "Virgo Maria" (1502), in:
        % MGG, volume 9, col. 653 ("Motette"), fig. 3.; also by Andr'e
        % Campra, "Entr'ee des s'er'enades" (1710), in: MGG, volume 2,
        % col. 1649 ("Contredanse"), fig. 2.
-       %
 
        save interline, reduced_il, reduced_slt;
+
        interline# = staff_space#;
        reduced_il# = staff_space# * reduction;
        reduced_slt# = linethickness# * reduction;
 
-       draw_brevis(exact_center, reduced_il#, reduced_il#, reduced_slt#);
-       draw_diamond(exact_center + (1.6interline#*reduction, interline#/2),
+       draw_brevis (exact_center, reduced_il#, reduced_il#, reduced_slt#);
+       draw_diamond (exact_center +
+                       (1.6 interline# * reduction, interline# / 2),
                     reduction);
-       draw_diamond(exact_center + (1.6interline#*reduction, -interline#/2),
+       draw_diamond (exact_center +
+                       (1.6 interline# * reduction, -interline# / 2),
                     reduction);
 
-       define_pixels(interline);
-       define_pixels(reduced_il);
-       define_pixels(reduced_slt);
+       define_pixels (interline, reduced_il, reduced_slt);
 
        save stem_width;
+
        stem_width# = 1.4 reduced_slt#;
-       define_pixels(stem_width);
+
+       define_pixels (stem_width);
 
        save xoffs, yoffs;
+
        xoffs# = xpart exact_center;
        yoffs# = ypart exact_center;
 
-       define_pixels(xoffs, yoffs);
+       define_pixels (xoffs, yoffs);
 
        % brevis stem
-       pickup pencircle xscaled stem_width yscaled blot_diameter;
-       rt z8 = (xoffs + reduced_il, yoffs);
-       z9 = z8 + (0, -4reduced_il);
-       draw z8 .. z9;
+       pickup pencircle xscaled stem_width
+                        yscaled blot_diameter;
+
+       save ellipse;
+       path ellipse;
+
+       ellipse := fullcircle xscaled stem_width
+                             yscaled blot_diameter;
+
+       rt z8 = (xoffs + reduced_il, yoffs - 4 reduced_slt);
+       rt z9 = (xoffs + reduced_il, yoffs - 4 reduced_il);
+
+       penpos8 (stem_width, 0);
+
+       fill get_subpath (ellipse, down, up, z9)
+            -- z8r
+            -- z8l
+            -- cycle;
 
        % upper diamond's stem
-       pickup pencircle xscaled stem_width yscaled blot_diameter;
-       z10 = (xoffs + 1.6interline*reduction + stem_width/2,
-         yoffs + interline*reduction);
-       top z11 = z10 + (0, 1.5interline*reduction);
-       draw z10 .. z11;
+       z10 = (xoffs + 1.6 interline * reduction + stem_width / 2,
+              yoffs + interline * reduction);
+       top z11 = z10 + (0, 1.5 interline * reduction);
+
+       penpos10 (stem_width, 0);
+
+       fill get_subpath (ellipse, up, down, z11)
+            -- z10l
+            -- z10r
+            -- cycle;
 
        % lower diamond's stem
-       pickup pencircle xscaled stem_width yscaled blot_diameter;
-       z12 = (xoffs + 1.6interline*reduction - stem_width/2,
-         yoffs - interline*reduction);
-       bot z13 = z12 + (0, -3.5interline*reduction);
-       draw z12 .. z13;
+       z12 = (xoffs + 1.6 interline * reduction - stem_width / 2,
+              yoffs - interline * reduction);
+       bot z13 = z12 + (0, -3.5 interline * reduction);
+
+       penpos12 (stem_width, 0);
+
+       fill get_subpath (ellipse, down, up, z13)
+            -- z12r
+            -- z12l
+            -- cycle;
 
        save reduced_il, rh_height, rh_width;
+
        reduced_il# = staff_space# * reduction;
-       rh_height# = 1.2reduced_il#;
-       rh_width# / rh_height# = tand(30);
-       set_char_box(0 - xpart exact_center,
-                    1.6interline#*reduction + 0.5rh_width# + xpart exact_center,
-                    4.5*interline#*reduction - ypart exact_center,
-                    2.5*interline#*reduction + ypart exact_center);
+       rh_height# = 1.2 reduced_il#;
+       rh_width# / rh_height# = tand (30);
+
+       set_char_box (0 - xpart exact_center,
+                     1.6 interline# * reduction + 0.5 rh_width# +
+                       xpart exact_center,
+                     4.5 interline# * reduction - ypart exact_center,
+                     2.5 interline# * reduction + ypart exact_center);
+
+       labels (9, 11, 13);
+       penlabels (8, 10, 12);
 enddef;
 
 
-fet_beginchar("petrucci f clef", "petrucci.f")
+fet_beginchar ("petrucci f clef", "petrucci.f");
        if test = 1:
-               draw_staff(-1,3, 0.0);
+               draw_staff (-1, 3, 0.0);
        fi;
-       draw_petrucci_f_clef((0,0), 1.0);
+       draw_petrucci_f_clef ((0, 0), 1.0);
 fet_endchar;
-fet_beginchar("petrucci f clef", "petrucci.f_change")
-       draw_petrucci_f_clef((0,0), .8);
+
+
+fet_beginchar ("petrucci f clef", "petrucci.f_change");
+       draw_petrucci_f_clef ((0, 0), .8);
 fet_endchar;
 
 
-def draw_mensural_f_clef(expr exact_center, reduction) =
-       %
+def draw_mensural_f_clef (expr exact_center, reduction) =
        % inspired by Philippe le Duc, "Dite Signori" (1590), in: MGG,
        % volume 3, col. 848 ("Duc"); also by John Dowland, "The First
        % Booke of Songes" (1597), in: MGG, volume 3, col. 721
@@ -635,58 +1114,108 @@ def draw_mensural_f_clef(expr exact_center, reduction) =
 
        save width, reduced_slt, stem_width, dot_diameter;
 
-       width# = 1.2staff_space# * reduction;
+       width# = 1.2 staff_space# * reduction;
        reduced_slt# = linethickness# * reduction;
        stem_width# = 1.4 reduced_slt#;
        dot_diameter# = 0.1 reduction * staff_space#;
-       define_pixels(width, stem_width, staff_space, dot_diameter);
+
+       define_pixels (width, stem_width, staff_space, dot_diameter);
 
        save xoffs, yoffs;
+
        xoffs# = xpart exact_center;
        yoffs# = ypart exact_center;
-       define_pixels(xoffs, yoffs);
 
-       pickup pencircle
-               xscaled 0.2width
-               yscaled stem_width
-               rotated 45;
+       define_pixels (xoffs, yoffs);
 
-       % half circle
-       lft z5 = (0, 0);
-       draw    halfcircle scaled width rotated -90
-               shifted (z5-(xoffs, yoffs));
+       pickup pencircle xscaled 0.2 width
+                        yscaled stem_width
+                        rotated 45;
 
+       save ellipse;
+       path ellipse;
+
+       ellipse := fullcircle xscaled 0.2 width
+                             yscaled stem_width
+                             rotated 45;
+
+       % half circle
+       lft z10 = (0, 0);
+
+       save pat;
+       path pat;
+
+       pat := halfcircle scaled width
+                         rotated -90
+                         shifted (z10 - (xoffs, yoffs));
+
+       z5 = point 0 of pat;
+       z6 = point 1 of pat;
+       z7 = point 2 of pat;
+       z8 = point 3 of pat;
+       z9 = point 4 of pat;
+
+       save dirs;
+       pair dirs[];
+
+       dirs5 := direction 0 of pat;
+       dirs6 := direction 1 of pat;
+       dirs7 := direction 2 of pat;
+       dirs8 := direction 3 of pat;
+       dirs9 := direction 4 of pat;
+
+       % we approximate `draw pat'
+       fill get_subpath (ellipse, -dirs5, dirs5, z5)
+            .. get_subpoint (ellipse, dirs6, z6)
+            .. get_subpoint (ellipse, dirs7, z7)
+            .. get_subpoint (ellipse, dirs8, z8)
+            .. get_subpath (ellipse, dirs9, -dirs9, z9)
+            .. get_subpoint (ellipse, -dirs8, z8)
+            .. get_subpoint (ellipse, -dirs7, z7)
+            .. get_subpoint (ellipse, -dirs6, z6)
+            .. cycle;
 
        % upper dot
        rt x2 = xoffs + width;
-       top y1 = yoffs + 0.5width;
+       top y1 = yoffs + 0.5 width;
        z2 - z1 = (dot_diameter, -dot_diameter);
-       draw z1 -- z2;
+
+       fill get_subpath (ellipse, z1 - z2, z2 - z1, z1)
+            -- get_subpath (ellipse, z2 - z1, z1 - z2, z2)
+            -- cycle;
 
        % lower dot
        x3 = x1;
        top y1 - bot y4 = width;
        z4 - z3 = (dot_diameter, -dot_diameter);
-       draw z3 -- z4;
 
-       set_char_box(0 - xpart exact_center,
-                    width# + xpart exact_center,
-                    0.5width# - ypart exact_center,
-                    0.5width# + ypart exact_center);
+       fill get_subpath (ellipse, z3 - z4, z4 - z3, z3)
+            -- get_subpath (ellipse, z4 - z3, z3 - z4, z4)
+            -- cycle;
+
+       set_char_box (0 - xpart exact_center,
+                     width# + xpart exact_center,
+                     0.5 width# - ypart exact_center,
+                     0.5 width# + ypart exact_center);
+
+       labels (1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
 enddef;
 
-fet_beginchar("mensural f clef", "mensural.f")
+
+fet_beginchar ("mensural f clef", "mensural.f");
        if test = 1:
-               draw_staff(-1,3, 0.0);
+               draw_staff (-1, 3, 0.0);
        fi;
-       draw_mensural_f_clef((0,0), 1.0);
+       draw_mensural_f_clef ((0, 0), 1.0);
 fet_endchar;
-fet_beginchar("mensural f clef", "mensural.f_change")
-       draw_mensural_f_clef((0,0), .8);
+
+
+fet_beginchar ("mensural f clef", "mensural.f_change");
+       draw_mensural_f_clef ((0, 0), .8);
 fet_endchar;
 
 
-def draw_petrucci_g_clef(expr exact_center, reduction) =
+def draw_petrucci_g_clef (expr exact_center, reduction) =
        % inspired by Josquin Desprez, "Stabat Mater", Libro tertio,
        % 1519, printed by Petrucci, in: MGG, volume 7, Table 11.
 
@@ -694,70 +1223,234 @@ def draw_petrucci_g_clef(expr exact_center, reduction) =
 
        reduced_il# = staff_space# * reduction;
        reduced_slt# = linethickness# * reduction;
-       define_pixels(reduced_il, reduced_slt);
+       define_pixels (reduced_il, reduced_slt);
 
-       set_char_box(0 - xpart exact_center,
-                    1.25 reduced_il# + xpart exact_center,
-                    0.65 reduced_il# - ypart exact_center,
-                    3.80 reduced_il# + ypart exact_center);
-
-       save za, zb, zc, zd, ze, zf, zg, zh, zi, zj;
-       pair za, zb, zc, zd, ze, zf, zg, zh, zi, zj;
+       set_char_box (0 - xpart exact_center,
+                     1.25 reduced_il# + xpart exact_center,
+                     0.65 reduced_il# - ypart exact_center,
+                     3.80 reduced_il# + ypart exact_center);
 
        save xoffs, yoffs;
+
        xoffs# = xpart exact_center;
        yoffs# = ypart exact_center;
-       define_pixels(xoffs, yoffs);
-
-       pickup pencircle
-               xscaled 0.50 reduced_slt
-               yscaled 0.22 reduced_il
-               rotated -35;
-
-       lft za = (xoffs + 0.80 reduced_il, yoffs + 0.00 reduced_il);
-       lft zb = (xoffs + 1.00 reduced_il, yoffs + 1.20 reduced_il);
-       lft zc = (xoffs + 0.70 reduced_il, yoffs + 2.00 reduced_il);
-       lft zd = (xoffs + 0.30 reduced_il, yoffs + 3.00 reduced_il);
-       lft ze = (xoffs + 0.80 reduced_il, yoffs + 3.70 reduced_il);
-       lft zf = (xoffs + 1.00 reduced_il, yoffs + 3.00 reduced_il);
-       lft zg = (xoffs + 0.60 reduced_il, yoffs + 2.00 reduced_il);
-       lft zh = (xoffs + 0.30 reduced_il, yoffs + 1.70 reduced_il);
-       lft zi = (xoffs + 0.00 reduced_il, yoffs + 0.75 reduced_il);
-       lft zj = (xoffs + 0.20 reduced_il, yoffs + 0.60 reduced_il);
-
-       draw za{-1,2} .. zb .. zc .. zd .. ze .. zf .. zg .. zh .. zi .. zj;
-
-       save za, zb, zc, zd, ze, zf;
-       pair za, zb, zc, zd, ze, zf;
-
-       pickup pencircle
-               xscaled 0.75 reduced_slt
-               yscaled 0.33 reduced_il
-               rotated -35;
-
-       lft za = (xoffs + 1.05 reduced_il, yoffs + 0.45 reduced_il);
-       lft zb = (xoffs + 0.55 reduced_il, yoffs + 0.45 reduced_il);
-       lft zc = (xoffs + 0.55 reduced_il, yoffs - 0.45 reduced_il);
-       lft zd = (xoffs + 1.05 reduced_il, yoffs - 0.45 reduced_il);
-       lft ze = (xoffs + 1.10 reduced_il, yoffs + 0.00 reduced_il);
-       lft zf = (xoffs + 0.80 reduced_il, yoffs + 0.00 reduced_il);
-
-       draw za .. zb .. zc .. zd .. {up}ze -- zf;
+
+       define_pixels (xoffs, yoffs);
+
+       pickup pencircle xscaled 0.50 reduced_slt
+                        yscaled 0.22 reduced_il
+                        rotated -35;
+
+       save ellipse, paths, sub_path, outlines, sub_outlines;
+       path ellipse, paths[], sub_path, outlines[], sub_outlines[];
+
+       ellipse := fullcircle xscaled 0.5 reduced_slt
+                             yscaled 0.22 reduced_il
+                             rotated -35;
+
+       lft z1 = (xoffs + 0.80 reduced_il, yoffs + 0.00 reduced_il);
+       lft z2 = (xoffs + 1.00 reduced_il, yoffs + 1.20 reduced_il);
+       lft z3 = (xoffs + 0.70 reduced_il, yoffs + 2.00 reduced_il);
+       lft z4 = (xoffs + 0.30 reduced_il, yoffs + 3.00 reduced_il);
+       lft z5 = (xoffs + 0.80 reduced_il, yoffs + 3.70 reduced_il);
+       lft z6 = (xoffs + 1.00 reduced_il, yoffs + 3.00 reduced_il);
+       lft z7 = (xoffs + 0.60 reduced_il, yoffs + 2.00 reduced_il);
+       lft z8 = (xoffs + 0.30 reduced_il, yoffs + 1.70 reduced_il);
+       lft z9 = (xoffs + 0.00 reduced_il, yoffs + 0.75 reduced_il);
+       lft z10 = (xoffs + 0.20 reduced_il, yoffs + 0.60 reduced_il);
+
+       paths1 := z1{-1, 2}
+                 .. z2
+                 .. z3
+                 .. z4
+                 .. z5
+                 .. z6
+                 .. z7
+                 .. z8
+                 .. z9
+                 .. z10;
+
+       save dirs, s;
+       pair dirs[];
+
+       s := 1/4;
+
+       % we approximate `draw paths1'
+       for i = 1 step s until (length paths1 + 1):
+               dirs[i] := direction (i - 1) of paths1;
+       endfor;
+
+       outlines1 := get_subpath (ellipse, -dirs1, dirs1, z1)
+                    for i = (1 + s) step s until (length paths1 + 1 - s):
+                            .. get_subpoint (ellipse, dirs[i],
+                                             point (i - 1) of paths1)
+                    endfor
+                    .. get_subpath (ellipse, dirs10, -dirs10, z10)
+                    for i = (length paths1 + 1 - s) step -s until (1 + s):
+                            .. get_subpoint (ellipse, -dirs[i],
+                                             point (i - 1) of paths1)
+                    endfor
+                    .. cycle;
+
+       save len;
+
+       len := length outlines1;
+
+       sub_outlines1 := subpath (0,
+                                 floor (1/4 len)) of outlines1;
+       sub_outlines2 := subpath (floor (1/4 len),
+                                 floor (2/4 len)) of outlines1;
+       sub_outlines3 := subpath (floor (2/4 len),
+                                 floor (3/4 len)) of outlines1;
+       sub_outlines4 := subpath (floor (3/4 len),
+                                 len) of outlines1;
+
+       save times;
+       numeric times[];
+
+       (times12, times21) = sub_outlines1 intersectiontimes sub_outlines2;
+       (times13, times31) = sub_outlines1 intersectiontimes sub_outlines3;
+       (times42, times24) = sub_outlines4 intersectiontimes sub_outlines2;
+       (times43, times34) = sub_outlines4 intersectiontimes sub_outlines3;
+
+       pickup pencircle xscaled 0.75 reduced_slt
+                        yscaled 0.33 reduced_il
+                        rotated -35;
+
+       ellipse := fullcircle xscaled 0.75 reduced_slt
+                             yscaled 0.33 reduced_il
+                             rotated -35;
+
+       lft z21 = (xoffs + 1.05 reduced_il, yoffs + 0.45 reduced_il);
+       lft z22 = (xoffs + 0.55 reduced_il, yoffs + 0.45 reduced_il);
+       lft z23 = (xoffs + 0.55 reduced_il, yoffs - 0.45 reduced_il);
+       lft z24 = (xoffs + 1.05 reduced_il, yoffs - 0.45 reduced_il);
+       lft z25 = (xoffs + 1.10 reduced_il, yoffs + 0.00 reduced_il);
+       lft z26 = (xoffs + 0.80 reduced_il, yoffs + 0.00 reduced_il);
+
+       paths2 := z21
+                 .. z22
+                 .. z23
+                 .. z24
+                 .. {up}z25
+                 -- z26;
+
+       sub_path := subpath (0, 1) of paths2;
+
+       times1 = xpart (sub_outlines1 intersectiontimes sub_path);
+       times4 = xpart (sub_outlines4 intersectiontimes sub_path);
+
+       % we have to find the envelope intersections (if any)
+       save t;
+       numeric t[];
+
+       t1 = find_envelope_cusp (reverse ellipse,
+                                subpath (1, 2) of paths2,
+                                1/256) + 1;
+       if t1 < 1:
+               t1 := 1;
+               t2 := 1;
+       else:
+               t2 = find_envelope_cusp (ellipse,
+                                        subpath (3, 4) of reverse paths2,
+                                        1/256) + 3;
+               t2 := length paths2 - t2;
+       fi;
+
+       t3 = find_envelope_cusp (reverse ellipse,
+                                subpath (2, 4 - epsilon) of paths2,
+                                1/256) + 2;
+       if t3 < 2:
+               t3 := 3;
+               t4 := 3;
+       else:
+               t4 = find_envelope_cusp (ellipse,
+                                        subpath (1 + epsilon, 3)
+                                          of reverse paths2,
+                                        1/256) + 1;
+               t4 := length paths2 - t4;
+       fi;
+
+       fill subpath (times1 + s / 4, times13) of sub_outlines1
+            -- subpath (times31, infinity) of sub_outlines3
+            & subpath (0, times42) of sub_outlines4
+            -- subpath (times24, infinity) of sub_outlines2
+            & subpath (0, times34) of sub_outlines3
+            -- subpath (times43, times4 - s / 4) of sub_outlines4
+            -- cycle;
+       unfill subpath (times12, infinity) of sub_outlines1
+              & subpath (0, times21) of sub_outlines2
+              -- cycle;
+       fill subpath (times4 + s / 4, infinity) of sub_outlines4
+            & subpath (0, times1 - s / 4) of sub_outlines1
+            -- cycle;
+
+
+       % we approximate `draw paths2'
+       for i = 1 step s until (length paths2 - s):
+               dirs[i + 20] := direction (i - 1) of paths2;
+       endfor;
+
+       sub_outlines21 := get_subpath (ellipse, -dirs21, dirs21, z21)
+                         for i = (1 + s) step s until (length paths2 - s):
+                                 .. get_subpoint (ellipse, dirs[i + 20],
+                                                  point (i - 1) of paths2)
+                         endfor
+                         .. get_subpath (ellipse, up, z26 - z25, z25);
+       sub_outlines22 := get_subpath (ellipse, z26 - z25, z25 - z26, z26)
+                         -- get_subpoint (ellipse, z25 - z26, z25);
+       sub_outlines23 := get_subpoint (ellipse, down, z25)
+                         for i = (length paths2 - s) step -s until (t4 + 1):
+                                 .. get_subpoint (ellipse, -dirs[i + 20],
+                                                  point (i - 1) of paths2)
+                         endfor
+                         .. get_subpoint (ellipse, -direction t4 of paths2,
+                                          point t4 of paths2);
+       sub_outlines24 := get_subpoint (ellipse, -direction t3 of paths2,
+                                       point t3 of paths2)
+                         for i = (floor (t3 / s) * s + 1) step -s until (t2 + 1):
+                                 .. get_subpoint (ellipse, -dirs[i + 20],
+                                                  point (i - 1) of paths2)
+                         endfor
+                         .. get_subpoint (ellipse, -direction t2 of paths2,
+                                          point t2 of paths2);
+       sub_outlines25 := get_subpoint (ellipse, -direction t1 of paths2,
+                                       point t1 of paths2)
+                         for i = (floor (t1 / s) * s + 1) step -s until (1 + s):
+                                 .. get_subpoint (ellipse, -dirs[i + 20],
+                                                  point (i - 1) of paths2)
+                         endfor;
+
+       (times2223, times2322) = sub_outlines22 intersectiontimes sub_outlines23;
+       (times2324, times2423) = sub_outlines23 intersectiontimes sub_outlines24;
+       (times2425, times2524) = sub_outlines24 intersectiontimes sub_outlines25;
+
+       fill sub_outlines21
+            -- subpath (0, times2223) of sub_outlines22
+            -- subpath (times2322, times2324) of sub_outlines23
+            -- subpath (times2423, times2425) of sub_outlines24
+            -- subpath (times2524, infinity) of sub_outlines25
+            .. cycle;
+
+       labels (1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
+       labels (21, 22, 23, 24, 25, 26);
 enddef;
 
 
-fet_beginchar("petrucci g clef", "petrucci.g")
+fet_beginchar ("petrucci g clef", "petrucci.g");
        if test = 1:
-               draw_staff(-1,3, 0.0);
+               draw_staff (-1, 3, 0.0);
        fi;
-       draw_petrucci_g_clef((0,0), 1.0);
+       draw_petrucci_g_clef ((0, 0), 1.0);
 fet_endchar;
-fet_beginchar("petrucci g clef", "petrucci.g_change")
-       draw_petrucci_g_clef((0,0), .8);
+
+
+fet_beginchar ("petrucci g clef", "petrucci.g_change");
+       draw_petrucci_g_clef ((0, 0), .8);
 fet_endchar;
 
 
-def draw_mensural_g_clef(expr exact_center, reduction) =
+def draw_mensural_g_clef (expr exact_center, reduction) =
   % TODO: Rewrite me.  The former mensural g clef looked ugly, and the
   % code was removed when it broke for small font sizes after some
   % global changes in the font.  Currently, the character is mapped to
@@ -773,18 +1466,21 @@ def draw_mensural_g_clef(expr exact_center, reduction) =
   % gebenedye" (1568), in: MGG, volume 3, col. 1735 ("Faignient").
 enddef;
 
+
 %
 % FIXME: This clef is preliminarily mapped to the petrucci g clef
 % until the code for the mensural g clef will be rewritten.
 %
-fet_beginchar("mensural g clef", "mensural.g")
+fet_beginchar ("mensural g clef", "mensural.g");
        if test = 1:
-               draw_staff(-1,3, 0.0);
+               draw_staff (-1, 3, 0.0);
        fi;
-       draw_petrucci_g_clef((0,0), 1.0);
+       draw_petrucci_g_clef ((0, 0), 1.0);
 fet_endchar;
-fet_beginchar("mensural g clef", "mensural.g_change")
-       draw_petrucci_g_clef((0,0), .8);
+
+
+fet_beginchar ("mensural g clef", "mensural.g_change");
+       draw_petrucci_g_clef ((0, 0), .8);
 fet_endchar;
 
 
@@ -797,131 +1493,208 @@ fet_endchar;
 %
 %
 %
-def draw_hufnagel_do_clef(expr exact_center, reduction) =
-       %
+def draw_hufnagel_do_clef (expr exact_center, reduction) =
        % inspired by Graduale of Friedrich Zollner (1442), in: MGG,
        % volume 9, col. 1413 ("Neustift"), fig. 1.
-       %
+
        save reduced_il;
 
        reduced_il# = staff_space# * reduction;
 
-       define_pixels(reduced_il);
+       define_pixels (reduced_il);
 
-       pickup pencircle
-               xscaled (0.60reduced_il)
-               yscaled (0.10reduced_il)
-               rotated 40;
-       save za, zb, zc, zd, ze, zf;
-       pair za, zb, zc, zd, ze, zf;
+       set_char_box (0 - xpart exact_center,
+                     1.10 reduced_il# + xpart exact_center,
+                     0.70 reduced_il# - ypart exact_center,
+                     0.75 reduced_il# + ypart exact_center);
 
        save xoffs, yoffs;
+
        xoffs# = xpart exact_center;
        yoffs# = ypart exact_center;
-       define_pixels(xoffs, yoffs);
-
-       za = (xoffs + 0.90reduced_il, yoffs + .45reduced_il);
-       zb = (xoffs + 0.80reduced_il, yoffs + .45reduced_il);
-       zc = (xoffs + 0.50reduced_il, yoffs + .60reduced_il);
-       zd = (xoffs + 0.20reduced_il, yoffs + .45reduced_il);
-       ze = (xoffs + 0.20reduced_il, yoffs - .45reduced_il);
-       zf = (xoffs + 0.40reduced_il, yoffs - .55reduced_il);
-       draw za .. zb .. zc -- zd -- ze -- zf;
-
-       set_char_box(0 - xpart exact_center,
-                    1.10reduced_il# + xpart exact_center,
-                    0.70reduced_il# - ypart exact_center,
-                    0.75reduced_il# + ypart exact_center);
+
+       define_pixels (xoffs, yoffs);
+
+       pickup pencircle xscaled (0.60 reduced_il)
+                        yscaled (0.10 reduced_il)
+                        rotated 40;
+
+       save ellipse, pat;
+       path ellipse, pat;
+
+       ellipse := fullcircle xscaled (0.60 reduced_il)
+                             yscaled (0.10 reduced_il)
+                             rotated 40;
+
+       z1 = (xoffs + 0.90 reduced_il, yoffs + .45 reduced_il);
+       z2 = (xoffs + 0.80 reduced_il, yoffs + .45 reduced_il);
+       z3 = (xoffs + 0.50 reduced_il, yoffs + .60 reduced_il);
+       z4 = (xoffs + 0.20 reduced_il, yoffs + .45 reduced_il);
+       z5 = (xoffs + 0.20 reduced_il, yoffs - .45 reduced_il);
+       z6 = (xoffs + 0.40 reduced_il, yoffs - .55 reduced_il);
+
+       pat := z1
+              .. z2
+              .. z3
+              -- z4
+              -- z5
+              -- z6;
+
+       fill get_subpath (ellipse,
+                         -direction 0 of pat, direction 0 of pat, z1)
+            .. get_subpoint (ellipse, direction 1 of pat, z2)
+            .. get_subpath (ellipse,
+                            direction (2 - epsilon) of pat, z4 - z3, z3)
+            -- get_subpath (ellipse,
+                            z4 - z3, z5 - z4, z4)
+            -- get_subpath (ellipse,
+                            z5 - z4, z6 - z5, z5)
+            -- get_subpath (ellipse,
+                            z6 - z5, z5 - z6, z6)
+            -- get_subpoint (ellipse, z5 - z6, z5)
+            -- get_subpoint (ellipse, z4 - z5, z5)
+            -- get_subpoint (ellipse, z4 - z5, z4)
+            -- get_subpoint (ellipse, -direction (2 - epsilon) of pat, z3)
+            .. get_subpath (ellipse,
+                            -direction 1 of pat, -direction 1 of pat, z2)
+            .. cycle;
+
+       labels (1, 2, 3, 4, 5, 6);
 enddef;
 
 
-fet_beginchar("Hufnagel do clef", "hufnagel.do")
+fet_beginchar ("Hufnagel do clef", "hufnagel.do");
        if test = 1:
-               draw_staff(-1,3, 0.0);
+               draw_staff (-1, 3, 0.0);
        fi;
-       draw_hufnagel_do_clef((0,0), 1.0);
+       draw_hufnagel_do_clef ((0, 0), 1.0);
 fet_endchar;
-fet_beginchar("Hufnagel do clef", "hufnagel.do_change")
-       draw_hufnagel_do_clef((0,0), .8);
+
+
+fet_beginchar ("Hufnagel do clef", "hufnagel.do_change");
+       draw_hufnagel_do_clef ((0, 0), .8);
 fet_endchar;
 
 
-def draw_hufnagel_fa_clef(expr exact_center, reduction) =
-       %
+def draw_hufnagel_fa_clef (expr exact_center, reduction) =
        % inspired by Bamberger Manuscript (15th century), in:
        % MGG, volume 2, table 59.
-       %
+
        save reduced_il;
 
        reduced_il# = staff_space# * reduction;
 
-       define_pixels(reduced_il);
+       define_pixels (reduced_il);
+
+       set_char_box (0 - xpart exact_center,
+                     1.20 reduced_il# + xpart exact_center,
+                     1.15 reduced_il# - ypart exact_center,
+                     1.00 reduced_il# + ypart exact_center);
 
-       pickup pencircle
-               xscaled (0.60reduced_il)
-               yscaled (0.10reduced_il)
-               rotated 40;
-       save za, zb, zc, zd, ze, zf;
-       pair za, zb, zc, zd, ze, zf;
+       pickup pencircle xscaled (0.60 reduced_il)
+                        yscaled (0.10 reduced_il)
+                        rotated 40;
 
        save xoffs, yoffs;
+
        xoffs# = xpart exact_center;
        yoffs# = ypart exact_center;
-       define_pixels(xoffs, yoffs);
-
-       za = (xoffs + 0.90reduced_il, yoffs + 0.70reduced_il);
-       zb = (xoffs + 0.80reduced_il, yoffs + 0.70reduced_il);
-       zc = (xoffs + 0.50reduced_il, yoffs + 0.85reduced_il);
-       zd = (xoffs + 0.20reduced_il, yoffs + 0.70reduced_il);
-       ze = (xoffs + 0.20reduced_il, yoffs - 1.10reduced_il);
-       draw za .. zb .. zc -- zd -- ze;
-
-       save zg, zh, zi, zj;
-       pair zg, zh, zi, zj;
-
-       zg = (xoffs + 0.90reduced_il, yoffs - 0.05reduced_il);
-       zh = (xoffs + 0.80reduced_il, yoffs - 0.05reduced_il);
-       zi = (xoffs + 0.50reduced_il, yoffs + 0.10reduced_il);
-       zj = (xoffs + 0.20reduced_il, yoffs - 0.05reduced_il);
-       draw zg .. zh .. zi -- zj;
-
-       set_char_box(0 - xpart exact_center,
-                    1.20reduced_il# + xpart exact_center,
-                    1.15reduced_il# - ypart exact_center,
-                    1.00reduced_il# + ypart exact_center);
+
+       define_pixels (xoffs, yoffs);
+
+       save ellipse, pat;
+       path ellipse, pat;
+
+       ellipse := fullcircle xscaled (0.60 reduced_il)
+                             yscaled (0.10 reduced_il)
+                             rotated 40;
+
+       z11 = (xoffs + 0.90 reduced_il, yoffs + 0.70 reduced_il);
+       z12 = (xoffs + 0.80 reduced_il, yoffs + 0.70 reduced_il);
+       z13 = (xoffs + 0.50 reduced_il, yoffs + 0.85 reduced_il);
+       z14 = (xoffs + 0.20 reduced_il, yoffs + 0.70 reduced_il);
+       z15 = (xoffs + 0.20 reduced_il, yoffs - 1.10 reduced_il);
+
+       pat := z11
+              .. z12
+              .. z13
+              -- z14
+              -- z15;
+
+       fill get_subpath (ellipse,
+                         -direction 0 of pat, direction 0 of pat, z11)
+            .. get_subpoint (ellipse, direction 1 of pat, z12)
+            .. get_subpath (ellipse,
+                            direction (2 - epsilon) of pat, z14 - z13, z13)
+            -- get_subpath (ellipse,
+                            z14 - z13, z15 - z14, z14)
+            -- get_subpath (ellipse,
+                            z15 - z14, z14 - z15, z15)
+            -- get_subpoint (ellipse, z14 - z15, z14)
+            -- get_subpoint (ellipse, -direction (2 - epsilon) of pat, z13)
+            .. get_subpath (ellipse,
+                            -direction 1 of pat, -direction 1 of pat, z12)
+            .. cycle;
+
+       z16 = (xoffs + 0.90 reduced_il, yoffs - 0.05 reduced_il);
+       z17 = (xoffs + 0.80 reduced_il, yoffs - 0.05 reduced_il);
+       z18 = (xoffs + 0.50 reduced_il, yoffs + 0.10 reduced_il);
+       z19 = (xoffs + 0.20 reduced_il, yoffs - 0.05 reduced_il);
+
+       pat := z16
+              .. z17
+              .. z18
+              -- z19;
+
+       fill get_subpath (ellipse,
+                         -direction 0 of pat, direction 0 of pat, z16)
+            .. get_subpoint (ellipse, direction 1 of pat, z17)
+            .. get_subpath (ellipse,
+                            direction (2 - epsilon) of pat, z19 - z18, z18)
+            -- get_subpoint (ellipse, z19 - z18, z19)
+            -- get_subpoint (ellipse, -direction (2 - epsilon) of pat, z18)
+            .. get_subpoint (ellipse, -direction 1 of pat, z17)
+            .. cycle;
+
+       labels (11, 12, 13, 14, 15, 16, 17, 18, 19);
 enddef;
 
 
-fet_beginchar("Hufnagel fa clef", "hufnagel.fa")
+fet_beginchar ("Hufnagel fa clef", "hufnagel.fa");
        if test = 1:
-               draw_staff(-1,3, 0.0);
+               draw_staff (-1, 3, 0.0);
        fi;
-       draw_hufnagel_fa_clef((0,0), 1.0);
+       draw_hufnagel_fa_clef ((0, 0), 1.0);
 fet_endchar;
-fet_beginchar("Hufnagel fa clef", "hufnagel.fa_change")
-       draw_hufnagel_fa_clef((0,0), .8);
+
+
+fet_beginchar ("Hufnagel fa clef", "hufnagel.fa_change");
+       draw_hufnagel_fa_clef ((0, 0), .8);
 fet_endchar;
 
 
-def draw_hufnagel_do_fa_clef(expr exact_center, reduction) =
-       draw_hufnagel_do_clef(exact_center, reduction);
-       draw_hufnagel_fa_clef(exact_center + (0, -2staff_space#), reduction);
-       set_char_box(0 - xpart exact_center,
-                    1.20reduced_il# + xpart exact_center,
-                    1.15reduced_il# + 2staff_space# - ypart exact_center,
-                    0.75reduced_il# + ypart exact_center);
+def draw_hufnagel_do_fa_clef (expr exact_center, reduction) =
+       draw_hufnagel_do_clef (exact_center, reduction);
+       draw_hufnagel_fa_clef (exact_center + (0, -2 staff_space#), reduction);
+
+       set_char_box (0 - xpart exact_center,
+                     1.20 reduced_il# + xpart exact_center,
+                     1.15 reduced_il# + 2 staff_space# - ypart exact_center,
+                     0.75 reduced_il# + ypart exact_center);
 enddef;
 
 
-fet_beginchar("Hufnagel do/fa clef", "hufnagel.do.fa")
+fet_beginchar ("Hufnagel do/fa clef", "hufnagel.do.fa");
        if test = 1:
-               draw_staff(-1,3, 0.0);
+               draw_staff (-1, 3, 0.0);
        fi;
-       draw_hufnagel_do_fa_clef((0,0), 1.0);
+       draw_hufnagel_do_fa_clef ((0, 0), 1.0);
 fet_endchar;
-fet_beginchar("Hufnagel do/fa clef", "hufnagel.do.fa_change")
-       draw_hufnagel_do_fa_clef((0,0), .8);
+
+
+fet_beginchar ("Hufnagel do/fa clef", "hufnagel.do.fa_change");
+       draw_hufnagel_do_fa_clef ((0, 0), .8);
 fet_endchar;
 
 
-fet_endgroup ("clefs")
+fet_endgroup ("clefs");
index f554eef04730053a215232d96e906974902f5ab7..f6734c53d94f9bacd3aa5b934d652470cbc72209 100644 (file)
@@ -9,7 +9,7 @@
 save black_notehead_width;
 numeric black_notehead_width;
 
-fet_begingroup ("custodes")
+fet_begingroup ("custodes");
 
 %
 % character aligment:
@@ -35,13 +35,15 @@ fet_begingroup ("custodes")
 %
 
 save between_staff_lines, on_staff_line, anywhere;
-between_staff_lines = 0;
-on_staff_line = 1;
-anywhere = 2;
+
+between_staff_lines := 0;
+on_staff_line := 1;
+anywhere := 2;
 
 save dir_up, dir_down;
-dir_up = 1;
-dir_down = -1;
+
+dir_up := 1;
+dir_down := -1;
 
 
 %%%%%%%%
@@ -52,15 +54,16 @@ dir_down = -1;
 %
 
 % parameterized hufnagel custos
-def custos_hufnagel(expr verbose_name, internal_name, 
-                   direction, staffline_adjustment) =
+def custos_hufnagel (expr verbose_name, internal_name, 
+                         direction, staffline_adjustment) =
 
-       fet_beginchar(verbose_name, internal_name)
+       fet_beginchar (verbose_name, internal_name);
                save alpha, dalpha, ht, wd, stem_ht, pen_size;
+
                ht# = noteheight#;
-               wd#/ht# = 0.6;
-               alpha# = 35;
-               dalpha# = direction*alpha#;
+               wd# / ht# = 0.6;
+               alpha = 35;
+               dalpha = direction * alpha;
 
                if staffline_adjustment = between_staff_lines:
                        stem_ht# = 1.00 staff_space#;
@@ -69,59 +72,92 @@ def custos_hufnagel(expr verbose_name, internal_name,
                else: % staffline_adjustment = anywhere
                        stem_ht# = 1.25 staff_space#;
                fi;
-               pen_size# = 0.5*sqrt(wd#*wd#+ht#*ht#);
 
-               define_pixels(ht, wd, pen_size, stem_ht);
-               pickup pencircle
-                 xscaled linethickness
-                 yscaled pen_size
-                 rotated -dalpha#;
+               pen_size# = 0.5 (wd# ++ ht#);
+
+               define_pixels (ht, wd, pen_size, stem_ht);
+
+               save ellipse, pat;
+               path ellipse, pat;
+
+               pickup pencircle xscaled linethickness
+                                yscaled pen_size
+                                rotated -dalpha;
+
+               ellipse := fullcircle xscaled linethickness
+                                     yscaled pen_size
+                                     rotated -dalpha;
 
                if direction = dir_up:
-                       top y1 = ht/2;
-                       bot y2 = -ht/2;
+                       top y1 = ht / 2;
+                       bot y2 = -ht / 2;
                else:
-                       bot y1 = -ht/2;
-                       top y2 = ht/2;
+                       bot y1 = -ht / 2;
+                       top y2 = ht / 2;
                fi;
+
                lft x1 = 0;
                rt  x2 = wd;
-               y3 - y2 = direction*stem_ht;
-               (y3 - y2) = (x3 - x2) * tand(90-dalpha#);
-               draw z1 -- z2 -- z3;
+               y3 - y2 = direction * stem_ht;
+               (y3 - y2) = (x3 - x2) * tand (90 - dalpha);
+
+               fill get_subpath (ellipse, z1 - z2, z2 - z1, z1)
+                    if direction > 0:
+                            -- get_subpath (ellipse, z2 - z1, z3 - z2, z2)
+                    else:
+                            -- get_subpoint (ellipse, z2 - z1, z2)
+                            -- get_subpoint (ellipse, z3 - z2, z2)
+                    fi
+                    -- get_subpath (ellipse, z3 - z2, z2 - z3, z3)
+                    if direction > 0:
+                            -- get_subpoint (ellipse, z2 - z3, z2)
+                            -- get_subpoint (ellipse, z1 - z2, z2)
+                    else:
+                            -- get_subpath (ellipse, z2 - z3, z1 - z2, z2)
+                    fi
+                    -- cycle;
 
                % The stem is intentionally outside of the char box.
                if direction > 0:
-                       set_char_box(0, wd#, ht#/2, stem_ht#);
+                       set_char_box (0, wd#, ht# / 2, stem_ht#);
                else:
-                       set_char_box(0, wd#, stem_ht#, ht#/2);
+                       set_char_box (0, wd#, stem_ht#, ht# / 2);
                fi;
+
+               labels (1, 2, 3);
        fet_endchar;
 enddef;
 
+
 % custos hufnagel, stem up, between staff lines
-custos_hufnagel("Custos Hufnagel", "hufnagel.u0", 
-               dir_up, between_staff_lines);
+custos_hufnagel ("Custos Hufnagel", "hufnagel.u0", 
+                dir_up, between_staff_lines);
+
 
 % custos hufnagel, stem up, on staff line
-custos_hufnagel("Custos Hufnagel", "hufnagel.u1", 
-               dir_up, on_staff_line);
+custos_hufnagel ("Custos Hufnagel", "hufnagel.u1", 
+                dir_up, on_staff_line);
+
 
 % custos hufnagel, stem up, anywhere
-custos_hufnagel("Custos Hufnagel", "hufnagel.u2", 
-               dir_up, anywhere);
+custos_hufnagel ("Custos Hufnagel", "hufnagel.u2", 
+                dir_up, anywhere);
+
 
 % custos hufnagel, stem down, between staff lines
-custos_hufnagel("Reverse Custos Hufnagel", "hufnagel.d0",
-               dir_down, between_staff_lines);
+custos_hufnagel ("Reverse Custos Hufnagel", "hufnagel.d0",
+                dir_down, between_staff_lines);
+
 
 % custos hufnagel, stem down, on staff line
-custos_hufnagel("Reverse Custos Hufnagel", "hufnagel.d1",
-               dir_down, on_staff_line);
+custos_hufnagel ("Reverse Custos Hufnagel", "hufnagel.d1",
+                dir_down, on_staff_line);
+
 
 % custos hufnagel, stem down, anywhere
-custos_hufnagel("Reverse Custos Hufnagel", "hufnagel.d2",
-               dir_down, anywhere);
+custos_hufnagel ("Reverse Custos Hufnagel", "hufnagel.d2",
+                dir_down, anywhere);
+
 
 %%%%%%%%
 %
@@ -130,14 +166,13 @@ custos_hufnagel("Reverse Custos Hufnagel", "hufnagel.d2",
 %
 %
 
-def custos_medicaea(expr verbose_name, internal_name, 
-                   direction, staffline_adjustment) =
-
-       fet_beginchar(verbose_name, internal_name)
-
+def custos_medicaea (expr verbose_name, internal_name, 
+                         direction, staffline_adjustment) =
+       fet_beginchar (verbose_name, internal_name);
                save ht, wd, stem_ht;
+
                ht# = noteheight#;
-               wd#/ht# = 0.25;
+               wd# / ht# = 0.25;
 
                if staffline_adjustment = between_staff_lines:
                        stem_ht# = 1.00 staff_space#;
@@ -147,53 +182,82 @@ def custos_medicaea(expr verbose_name, internal_name,
                        stem_ht# = 1.25 staff_space#;
                fi;
 
-               define_pixels(ht, wd, stem_ht);
+               define_pixels (ht, wd, stem_ht);
+
+               save ellipse;
+               path ellipse;
+
+               pickup pencircle xscaled 0.6 linethickness
+                                yscaled ht;
+
+               ellipse := fullcircle xscaled 0.6 linethickness
+                                     yscaled ht;
 
-               pickup pencircle xscaled 0.6linethickness yscaled ht;
                lft x1 = 0;
                y1 = 0;
                rt x2 = wd;
                y2 = y1;
-               draw z1 -- z2;
 
-               pickup pencircle scaled 0.6linethickness;
+               fill get_subpath (ellipse, left, right, z1)
+                    -- get_subpath (ellipse, right, left, z2)
+                    -- cycle;
+
+               pickup pencircle scaled 0.6 linethickness;
+
                rt x3 = wd;
                y3 = 0;
                x4 = x3;
-               y4 = direction*stem_ht;
-               draw z3 -- z4;
+               if direction > 0:
+                       top y4 = stem_ht;
+                       draw_rounded_block (bot lft z3, top rt z4,
+                                           0.6 linethickness);
+               else:
+                       bot y4 = -stem_ht;
+                       draw_rounded_block (bot lft z4, top rt z3,
+                                           0.6 linethickness);
+               fi;
+
 
                if direction > 0:
-                       set_char_box(0, wd#, ht#/2, stem_ht#);
+                       set_char_box (0, wd#, ht# / 2, stem_ht#);
                else:
-                       set_char_box(0, wd#, stem_ht#, ht#/2);
+                       set_char_box (0, wd#, stem_ht#, ht# / 2);
                fi;
+
+               labels (1, 2, 3, 4);
        fet_endchar;
 enddef;
 
+
 % custos medicaea, stem up, between staff lines
-custos_medicaea("Custos Med.", "medicaea.u0", 
-               dir_up, between_staff_lines);
+custos_medicaea ("Custos Med.", "medicaea.u0", 
+                dir_up, between_staff_lines);
+
 
 % custos medicaea, stem up, on staff line
-custos_medicaea("Custos Med.", "medicaea.u1", 
-               dir_up, on_staff_line);
+custos_medicaea ("Custos Med.", "medicaea.u1", 
+                dir_up, on_staff_line);
+
 
 % custos medicaea, stem up, anywhere
-custos_medicaea("Custos Med.", "medicaea.u2", 
-               dir_up, anywhere);
+custos_medicaea ("Custos Med.", "medicaea.u2", 
+                dir_up, anywhere);
+
 
 % custos medicaea, stem down, between staff lines
-custos_medicaea("Reverse Custos Med.", "medicaea.d0", 
+custos_medicaea ("Reverse Custos Med.", "medicaea.d0", 
                dir_down, between_staff_lines);
 
+
 % custos medicaea, stem down, on staff line
-custos_medicaea("Reverse Custos Med.", "medicaea.d1", 
-               dir_down, on_staff_line);
+custos_medicaea ("Reverse Custos Med.", "medicaea.d1", 
+                dir_down, on_staff_line);
+
 
 % custos medicaea, stem down, anywhere
-custos_medicaea("Reverse Custos Med.", "medicaea.d2", 
-               dir_down, anywhere);
+custos_medicaea ("Reverse Custos Med.", "medicaea.d2", 
+                dir_down, anywhere);
+
 
 %%%%%%%%
 %
@@ -202,14 +266,14 @@ custos_medicaea("Reverse Custos Med.", "medicaea.d2",
 %
 %
 
-def custos_vaticana(expr verbose_name, internal_name, 
-                   direction, staffline_adjustment) =
-
-       fet_beginchar(verbose_name, internal_name)
+def custos_vaticana (expr verbose_name, internal_name, 
+                         direction, staffline_adjustment) =
+       fet_beginchar (verbose_name, internal_name);
                save ht, wd, u_offs, l_offs, stem_size, stem_end;
                save pen_ht, l_shift, curve_ht, bend_ht;
+
                ht# = noteheight#;
-               wd# = 0.24ht#;
+               wd# = 0.24 ht#;
 
                if staffline_adjustment = between_staff_lines:
                        stem_size# = 1.00;
@@ -218,63 +282,89 @@ def custos_vaticana(expr verbose_name, internal_name,
                else: % staffline_adjustment = anywhere
                        stem_size# = 1.25;
                fi;
-               curve_ht# = 0.6ht#;
-               bend_ht# = 0.10ht#;
-               l_shift# = 0.04ht#;
-               u_offs# = +direction*0.5*(bend_ht#+l_shift#);
-               l_offs# = -direction*0.5*(bend_ht#-l_shift#);
-               stem_end# = direction*stem_size#*staff_space#;
-               pen_ht# = curve_ht#-l_shift#;
 
-               define_pixels(u_offs, l_offs, stem_end, ht, wd, pen_ht);
+               curve_ht# = 0.6 ht#;
+               bend_ht# = 0.10 ht#;
+               l_shift# = 0.04 ht#;
+               u_offs# = +direction * 0.5 * (bend_ht# + l_shift#);
+               l_offs# = -direction * 0.5 * (bend_ht# - l_shift#);
+               stem_end# = direction * stem_size# * staff_space#;
+               pen_ht# = curve_ht# - l_shift#;
+
+               define_pixels (u_offs, l_offs, stem_end, ht, wd, pen_ht);
+
+               pickup pencircle scaled 0.6 linethickness;
 
-               pickup pencircle scaled 0.6linethickness;
                z1 = (0, u_offs);
-               z2 = (0.7wd, l_offs);
+               z2 = (0.7 wd, l_offs);
                z3 = (wd, l_offs);
-               penpos1(pen_ht, 90);
-               penpos2(pen_ht, 90);
-               penpos3(pen_ht, 90);
-               penstroke z1e{z2 - z1} .. {right}z2e .. z3e;
+
+               penpos1 (pen_ht, 90);
+               penpos2 (pen_ht, 90);
+               penpos3 (pen_ht, 90);
+
+               penstroke z1e{z2 - z1}
+                         .. {right}z2e
+                         .. z3e;
 
                rt x4 = wd;
-               bot y4 = 0;
                x5 = x4;
-               top y5 = stem_end;
-               draw z4 -- z5;
 
                if direction > 0:
-                       set_char_box(0, wd#, -l_offs#+0.5pen_ht#, stem_end#);
+                       y4 = y3r;
+                       top y5 = stem_end;
+                       draw_rounded_block (bot lft z4, top rt z5,
+                                           0.6 linethickness);
+               else:
+                       y4 = y3l;
+                       bot y5 = stem_end;
+                       draw_rounded_block (bot lft z5, top rt z4,
+                                           0.6 linethickness);
+               fi;
+
+               if direction > 0:
+                       set_char_box (0, wd#,
+                                     -l_offs# + 0.5 pen_ht#, stem_end#);
                else:
-                       set_char_box(0, wd#, -stem_end#, +l_offs#+0.5pen_ht#);
+                       set_char_box (0, wd#,
+                                     -stem_end#, +l_offs# + 0.5 pen_ht#);
                fi;
 
+               penlabels (1, 2, 3);
+               labels (4, 5);
        fet_endchar;
 enddef;
 
+
 % custos vaticana, stem up, between staff lines
-custos_vaticana("Custos Ed. Vat.", "vaticana.u0", 
-               dir_up, between_staff_lines);
+custos_vaticana ("Custos Ed. Vat.", "vaticana.u0", 
+                dir_up, between_staff_lines);
+
 
 % custos vaticana, stem up, on staff line
-custos_vaticana("Custos Ed. Vat.", "vaticana.u1", 
-               dir_up, on_staff_line);
+custos_vaticana ("Custos Ed. Vat.", "vaticana.u1", 
+                dir_up, on_staff_line);
+
 
 % custos vaticana, stem up, anywhere
-custos_vaticana("Custos Ed. Vat.", "vaticana.u2", 
-               dir_up, anywhere);
+custos_vaticana ("Custos Ed. Vat.", "vaticana.u2", 
+                dir_up, anywhere);
+
 
 % custos vaticana, stem down, between staff lines
-custos_vaticana("Reverse Custos Ed. Vat.", "vaticana.d0", 
-               dir_down, between_staff_lines);
+custos_vaticana ("Reverse Custos Ed. Vat.", "vaticana.d0", 
+                dir_down, between_staff_lines);
+
 
 % custos vaticana, stem down, on_staff_line
-custos_vaticana("Reverse Custos Ed. Vat.", "vaticana.d1", 
-               dir_down, on_staff_line);
+custos_vaticana ("Reverse Custos Ed. Vat.", "vaticana.d1", 
+                dir_down, on_staff_line);
+
 
 % custos vaticana, stem down, anywhere
-custos_vaticana("Reverse Custos Ed. Vat.", "vaticana.d2", 
-               dir_down, anywhere);
+custos_vaticana ("Reverse Custos Ed. Vat.", "vaticana.d2", 
+                dir_down, anywhere);
+
 
 %%%%%%%%
 %
@@ -283,15 +373,15 @@ custos_vaticana("Reverse Custos Ed. Vat.", "vaticana.d2",
 %
 %
 
-def custos_mensural(expr verbose_name, internal_name, 
-                   direction, staffline_adjustment) =
-
-       fet_beginchar(verbose_name, internal_name)
+def custos_mensural (expr verbose_name, internal_name, 
+                         direction, staffline_adjustment) =
+       fet_beginchar (verbose_name, internal_name);
                save alpha, dalpha, ht, wd, stem_ht;
+
                ht# = noteheight#;
-               wd#/ht# = 1.2;
-               alpha# = 35;
-               dalpha# = direction*alpha#;
+               wd# / ht# = 1.2;
+               alpha = 35;
+               dalpha = direction * alpha;
 
                if staffline_adjustment = between_staff_lines:
                        stem_ht# = 1.00 staff_space#;
@@ -301,57 +391,112 @@ def custos_mensural(expr verbose_name, internal_name,
                        stem_ht# = 1.25 staff_space#;
                fi;
 
-               define_pixels(ht, wd, stem_ht);
-               pickup pencircle
-                 xscaled linethickness
-                 yscaled 0.4ht
-                 rotated -dalpha#;
+               define_pixels (ht, wd, stem_ht);
+
+               save ellipse;
+               path ellipse;
+
+               pickup pencircle xscaled linethickness
+                                yscaled 0.4ht
+                                rotated -dalpha;
+
+               ellipse := fullcircle xscaled linethickness
+                                     yscaled 0.4ht
+                                     rotated -dalpha;
 
                if direction > 0:
-                       bot y1 = bot y3 = bot y5 = -direction*0.33ht;
-                       top y2 = top y4 = +direction*0.33ht;
+                       bot y1 = bot y3 = bot y5 = -direction * 0.33 ht;
+                       top y2 = top y4 = +direction * 0.33 ht;
                else:
-                       top y1 = top y3 = top y5 = -direction*0.33ht;
-                       bot y2 = bot y4 = +direction*0.33ht;
+                       top y1 = top y3 = top y5 = -direction * 0.33 ht;
+                       bot y2 = bot y4 = +direction * 0.33 ht;
                fi;
-               lft x1 = 0.0wd; lft x2 = 0.2wd; lft x3 = 0.4wd;
-               lft x4 = 0.6wd; lft x5 = 0.8wd;
-               y6 - y5 = direction*stem_ht;
-               (y6 - y5) = (x6 - x5) * tand(90-dalpha#);
 
-               draw z1 -- z2 -- z3 -- z4 -- z5 -- z6;
+               lft x1 = 0.0 wd;
+               lft x2 = 0.2 wd;
+               lft x3 = 0.4 wd;
+               lft x4 = 0.6 wd;
+               lft x5 = 0.8 wd;
+
+               y6 - y5 = direction * stem_ht;
+               y6 - y5 = (x6 - x5) * tand (90 - dalpha);
+
+               if direction > 0:
+                       fill get_subpath (ellipse, z1 - z2, z2 - z1, z1)
+                            -- get_subpoint (ellipse, z2 - z1, z2)
+                            -- get_subpoint (ellipse, z3 - z2, z2)
+                            -- get_subpath (ellipse, z3 - z2, z4 - z3, z3)
+                            -- get_subpoint (ellipse, z4 - z3, z4)
+                            -- get_subpoint (ellipse, z5 - z4, z4)
+                            -- get_subpath (ellipse, z5 - z4, z6 - z5, z5)
+                            -- get_subpath (ellipse, z6 - z5, z5 - z6, z6)
+                            -- get_subpoint (ellipse, z5 - z6, z5)
+                            -- get_subpoint (ellipse, z4 - z5, z5)
+                            -- get_subpath (ellipse, z4 - z5, z3 - z4, z4)
+                            -- get_subpoint (ellipse, z3 - z4, z3)
+                            -- get_subpoint (ellipse, z2 - z3, z3)
+                            -- get_subpath (ellipse, z2 - z3, z1 - z2, z2)
+                            -- cycle;
+               else:
+                       fill get_subpath (ellipse, z1 - z2, z2 - z1, z1)
+                            -- get_subpath (ellipse, z2 -z1, z3 - z2, z2)
+                            -- get_subpoint (ellipse, z3 - z2, z3)
+                            -- get_subpoint (ellipse, z4 - z3, z3)
+                            -- get_subpath (ellipse, z4 -z3, z5 - z4, z4)
+                            -- get_subpoint (ellipse, z5 - z4, z5)
+                            -- get_subpoint (ellipse, z6 - z5, z5)
+                            -- get_subpath (ellipse, z6 - z5, z5 - z6, z6)
+                            -- get_subpath (ellipse, z5 - z6, z4 - z5, z5)
+                            -- get_subpoint (ellipse, z4 - z5, z4)
+                            -- get_subpoint (ellipse, z3 - z4, z4)
+                            -- get_subpath (ellipse, z3 - z4, z2 - z3, z3)
+                            -- get_subpoint (ellipse, z2 - z3, z2)
+                            -- get_subpoint (ellipse, z1 - z2, z2)
+                            -- cycle;
+               fi;
 
                % The stem is intentionally outside of the char box.
                if direction > 0:
-                       set_char_box(0, wd#, +direction*0.33ht#, stem_ht#);
+                       set_char_box (0, wd#,
+                                     +direction * 0.33 ht#, stem_ht#);
                else:
-                       set_char_box(0, wd#, stem_ht#, -direction*0.33ht#);
+                       set_char_box (0, wd#,
+                                     stem_ht#, -direction * 0.33 ht#);
                fi;
+
+               labels (1, 2, 3, 4, 5, 6);
        fet_endchar;
 enddef;
 
+
 % custos mensural, stem up, between staff lines
-custos_mensural("Custos Mensural", "mensural.u0", 
-               dir_up, between_staff_lines);
+custos_mensural ("Custos Mensural", "mensural.u0", 
+                dir_up, between_staff_lines);
+
 
 % custos mensural, stem up, on staff line
-custos_mensural("Custos Mensural", "mensural.u1", 
-               dir_up, on_staff_line);
+custos_mensural ("Custos Mensural", "mensural.u1", 
+                dir_up, on_staff_line);
+
 
 % custos mensural, stem up, anywhere
-custos_mensural("Custos Mensural", "mensural.u2", 
-               dir_up, anywhere);
+custos_mensural ("Custos Mensural", "mensural.u2", 
+                dir_up, anywhere);
+
 
 % custos mensural, stem down, between staff lines
-custos_mensural("Reverse Custos Mensural", "mensural.d0", 
-               dir_down, between_staff_lines);
+custos_mensural ("Reverse Custos Mensural", "mensural.d0", 
+                dir_down, between_staff_lines);
+
 
 % custos mensural, stem down, on staff line
-custos_mensural("Reverse Custos Mensural", "mensural.d1", 
-               dir_down, on_staff_line);
+custos_mensural ("Reverse Custos Mensural", "mensural.d1", 
+                dir_down, on_staff_line);
+
 
 % custos mensural, stem down, anywhere
-custos_mensural("Reverse Custos Mensural", "mensural.d2", 
-               dir_down, anywhere);
+custos_mensural ("Reverse Custos Mensural", "mensural.d2", 
+                dir_down, anywhere);
+
 
-fet_endgroup ("custodes")
+fet_endgroup ("custodes");
index 2ee63a0e930a3fa0170caa65835f20230d3da2ed..ba5a800005c6853338f1a1cd6d30953281685892 100644 (file)
@@ -6,16 +6,18 @@
 % (c) 2001--2006 Juergen Reuter <reuter@ipd.uka.de>
 % 
 
-fet_begingroup ("flags")
+fet_begingroup ("flags");
 
 save between_staff_lines, on_staff_line, anywhere;
-between_staff_lines = 0;
-on_staff_line = 1;
-anywhere = 2;
+
+between_staff_lines := 0;
+on_staff_line := 1;
+anywhere := 2;
 
 save dir_up, dir_down;
-dir_up = 1;
-dir_down = -1;
+
+dir_up := 1;
+dir_down := -1;
 
 
 %%%%%%%%
@@ -27,207 +29,300 @@ dir_down = -1;
 %
 %
 
-def draw_mensural_outermost_flare (expr staffline_adjustment) =
-       define_pixels(linethickness, staff_space)
+def draw_mensural_outermost_flare (expr staffline_adjustment, d_) =
+       define_pixels (linethickness, staff_space);
 
-       pickup pencircle
-               xscaled 1.00 linethickness
-               yscaled 0.22 staff_space
-               rotated -35;
+       save ellipse, pat;
+       path ellipse, pat;
 
-       save za, zb, zc, zd, ze;
-       pair za, zb, zc, zd, ze;
+       pickup pencircle xscaled 1.00 linethickness
+                        yscaled 0.22 staff_space
+                        rotated -35;
 
-       za = (+0.00 staff_space, -0.00 staff_space);
-       zb = (+0.15 staff_space, -0.00 staff_space);
+       ellipse := fullcircle xscaled 1.00 linethickness
+                             yscaled 0.22 staff_space
+                             rotated -35;
+       
+       z11 = (+0.00 staff_space, -0.00 staff_space);
+       z12 = (+0.15 staff_space, -0.00 staff_space);
 
        if staffline_adjustment = between_staff_lines:
-               zc = (+0.45 staff_space, -0.35 staff_space);
-               zd = (+0.45 staff_space, -0.85 staff_space);
-               ze = (+0.00 staff_space, -2.00 staff_space);
+               z13 = (+0.45 staff_space, -0.35 staff_space);
+               z14 = (+0.45 staff_space, -0.85 staff_space);
+               z15 = (+0.00 staff_space, -2.00 staff_space);
        elseif staffline_adjustment = on_staff_line:
-               zc = (+0.20 staff_space, -0.05 staff_space);
-               zd = (+0.20 staff_space, -1.15 staff_space);
-               ze = (+0.00 staff_space, -1.40 staff_space);
+               z13 = (+0.20 staff_space, -0.05 staff_space);
+               z14 = (+0.20 staff_space, -1.15 staff_space);
+               z15 = (+0.00 staff_space, -1.40 staff_space);
        else: % staffline_adjustment = anywhere
-               zc = (+0.33 staff_space, -0.20 staff_space);
-               zd = (+0.33 staff_space, -1.00 staff_space);
-               ze = (+0.00 staff_space, -1.70 staff_space);
+               z13 = (+0.33 staff_space, -0.20 staff_space);
+               z14 = (+0.33 staff_space, -1.00 staff_space);
+               z15 = (+0.00 staff_space, -1.70 staff_space);
        fi;
 
-       draw za .. zb -- zc{zc-zb} .. {ze-zd}zd -- ze;
+       pat := z13{z13 - z12}
+              .. {z15 - z14}z14;
+
+       fill get_subpath (ellipse, z11 - z12, z12 - z11, z11)
+            -- get_subpoint (ellipse, z12 - z11, z12)
+            -- get_subpoint (ellipse, z13 - z12, z12)
+            -- get_subpoint (ellipse, direction 0 of pat, z13)
+                 {direction 0 of pat}
+            .. {direction 1 of pat}
+                 get_subpoint (ellipse, direction 1 of pat, z14)
+            -- get_subpath (ellipse, z15 - z14, z14 - z15, z15)
+            -- get_subpoint (ellipse, -direction 1 of pat, z14)
+                 {-direction 1 of pat}
+            .. {-direction 0 of pat}
+                 get_subpoint (ellipse, -direction 0 of pat, z13)
+            -- get_subpath (ellipse, z12 - z13, z11 - z12, z12)
+            -- cycle;
+
+       if d_ = dir_up:
+               labels (11, 12, 13, 14, 15);
+       fi;
 enddef;
 
-def draw_mensural_inner_flare(expr il_shift) =
-       define_pixels(linethickness, staff_space)
-
-       pickup pencircle
-               xscaled 1.00 linethickness
-               yscaled 0.22 staff_space
-               rotated -35;
-
-       save zs, za, zb, zc, zd;
-       pair zs, za, zb, zc, zd;
 
-       zs = (0, -il_shift * staff_space);
-       za = zs + (+0.00 staff_space, -0.10 staff_space);
-       zb = zs + (+0.33 staff_space, -0.30 staff_space);
-       zc = zs + (+0.33 staff_space, -0.70 staff_space);
-       zd = zs + (+0.00 staff_space, -0.90 staff_space);
-
-       draw za{2,1} .. zb .. zc .. {-2,-1}zd;
+def draw_mensural_inner_flare (expr il_shift, idx, d_) =
+       define_pixels (linethickness, staff_space);
+
+       save ellipse, pat;
+       path ellipse, pat;
+
+       pickup pencircle xscaled 1.00 linethickness
+                        yscaled 0.22 staff_space
+                        rotated -35;
+
+       ellipse := fullcircle xscaled 1.00 linethickness
+                             yscaled 0.22 staff_space
+                             rotated -35;
+
+       save i;
+       numeric i[];
+
+       i0 := idx * 10;
+       i1 := idx * 10 + 1;
+       i2 := idx * 10 + 2;
+       i3 := idx * 10 + 3;
+       i4 := idx * 10 + 4;
+
+       z[i0] = (0, -il_shift * staff_space);
+       z[i1] = z[i0] + (+0.00 staff_space, -0.10 staff_space);
+       z[i2] = z[i0] + (+0.33 staff_space, -0.30 staff_space);
+       z[i3] = z[i0] + (+0.33 staff_space, -0.70 staff_space);
+       z[i4] = z[i0] + (+0.00 staff_space, -0.90 staff_space);
+
+       pat := z[i1]{2, 1}
+              .. z[i2]
+              .. z[i3]
+              .. {-2, -1}z[i4];
+
+       % we avoid cusps originally present in `draw pat'
+       fill get_subpath (ellipse,
+                         -direction 0 of pat, direction 0 of pat, z[i1])
+            .. get_subpoint (ellipse, direction 1 of pat, z[i2])
+                 {direction 1 of pat}
+            .. get_subpoint (ellipse, direction 2 of pat, z[i3])
+                 {direction 2 of pat}
+            .. get_subpath (ellipse,
+                            direction 3 of pat, -direction 3 of pat, z[i4])
+            .. get_subpoint (ellipse, -direction 2 of pat, z[i3])
+                 {-direction 2 of pat}
+            .. get_subpoint (ellipse, -direction 1 of pat, z[i2])
+                 {-direction 1 of pat}
+            .. cycle;
+
+       if d_ = dir_up:
+               labels ([i0], [i1], [i2], [i3], [i4]);
+       fi;
 enddef;
 
-def draw_mensural_flag (expr staffline_adjustment, flares, direction) =
+
+def draw_mensural_flag (expr staffline_adjustment, flares, d_) =
        save char_box_adjust, flare_shift;
+
        if staffline_adjustment = between_staff_lines:
-               flare_shift = 0.5;
+               flare_shift := 0.5;
        elseif staffline_adjustment = on_staff_line:
-               flare_shift = 0.0;
+               flare_shift := 0.0;
        else: % staffline_adjustment = anywhere
-               flare_shift = 0.25;
+               flare_shift := 0.25;
        fi;
-       char_box_adjust = flare_shift+0.5;
-       if direction = dir_up:
-               set_char_box(0,
-                            0.60 staff_space#,
-                            (flares+char_box_adjust)*staff_space#,
-                            0.10 staff_space#)
-       else: % direction = dir_down
-               set_char_box(0.60 staff_space#,
-                            0,
-                            0.10 staff_space#,
-                            (flares+char_box_adjust)*staff_space#)
+
+       char_box_adjust := flare_shift + 0.5;
+
+       if d_ = dir_up:
+               set_char_box (0,
+                             0.60 staff_space#,
+                             (flares + char_box_adjust) * staff_space#,
+                             0.10 staff_space#);
+       else: % d_ = dir_down
+               set_char_box (0.60 staff_space#,
+                             0,
+                             0.10 staff_space#,
+                             (flares + char_box_adjust) * staff_space#);
        fi;
-       draw_mensural_outermost_flare (staffline_adjustment)
+
+       draw_mensural_outermost_flare (staffline_adjustment, d_);
+
        for flare_count := 2 step 1 until 4:
                if flares >= flare_count:
-                       draw_mensural_inner_flare(flare_shift+flare_count-0.5)
+                       draw_mensural_inner_flare (flare_shift
+                                                  + flare_count - 0.5,
+                                                  flare_count, d_);
                fi;
        endfor;
-       if direction = dir_down:
-               currentpicture := currentpicture xscaled -1 yscaled -1;
+
+       if d_ = dir_down:
+               currentpicture := currentpicture xscaled -1
+                                                yscaled -1;
        fi;
 enddef;
 
+
 % 8th mensural flag, upwards, between staff lines
-fet_beginchar("8th Mensural Flag (up)", "mensuralu03")
-       draw_mensural_flag (between_staff_lines, 1, dir_up)
+fet_beginchar ("8th Mensural Flag (up)", "mensuralu03");
+       draw_mensural_flag (between_staff_lines, 1, dir_up);
 fet_endchar;
 
+
 % 8th mensural flag, upwards, on staff line
-fet_beginchar("8th Mensural Flag (up)", "mensuralu13")
-       draw_mensural_flag (on_staff_line, 1, dir_up)
+fet_beginchar ("8th Mensural Flag (up)", "mensuralu13");
+       draw_mensural_flag (on_staff_line, 1, dir_up);
 fet_endchar;
 
+
 % 8th mensural flag, upwards, anywhere
-fet_beginchar("8th Mensural Flag (up)", "mensuralu23")
-       draw_mensural_flag (anywhere, 1, dir_up)
+fet_beginchar ("8th Mensural Flag (up)", "mensuralu23");
+       draw_mensural_flag (anywhere, 1, dir_up);
 fet_endchar;
 
+
 % 8th mensural flag, downwards, between staff lines
-fet_beginchar("8th Mensural Flag (down)", "mensurald03")
-       draw_mensural_flag (between_staff_lines, 1, dir_down)
+fet_beginchar ("8th Mensural Flag (down)", "mensurald03");
+       draw_mensural_flag (between_staff_lines, 1, dir_down);
 fet_endchar;
 
+
 % 8th mensural flag, downwards, on staff line
-fet_beginchar("8th Mensural Flag (down)", "mensurald13")
-       draw_mensural_flag (on_staff_line, 1, dir_down)
+fet_beginchar ("8th Mensural Flag (down)", "mensurald13");
+       draw_mensural_flag (on_staff_line, 1, dir_down);
 fet_endchar;
 
+
 % 8th mensural flag, downwards, anywhere
-fet_beginchar("8th Mensural Flag (down)", "mensurald23")
-       draw_mensural_flag (anywhere, 1, dir_down)
+fet_beginchar ("8th Mensural Flag (down)", "mensurald23");
+       draw_mensural_flag (anywhere, 1, dir_down);
 fet_endchar;
 
+
 % 16th mensural flag, upwards, between staff lines
-fet_beginchar("16th Mensural Flag (up)", "mensuralu04")
-       draw_mensural_flag (between_staff_lines, 2, dir_up)
+fet_beginchar ("16th Mensural Flag (up)", "mensuralu04");
+       draw_mensural_flag (between_staff_lines, 2, dir_up);
 fet_endchar;
 
+
 % 16th mensural flag, upwards, on staff line
-fet_beginchar("16th Mensural Flag (up)", "mensuralu14")
-       draw_mensural_flag (on_staff_line, 2, dir_up)
+fet_beginchar ("16th Mensural Flag (up)", "mensuralu14");
+       draw_mensural_flag (on_staff_line, 2, dir_up);
 fet_endchar;
 
+
 % 16th mensural flag, upwards, anywhere
-fet_beginchar("16th Mensural Flag (up)", "mensuralu24")
-       draw_mensural_flag (anywhere, 2, dir_up)
+fet_beginchar ("16th Mensural Flag (up)", "mensuralu24");
+       draw_mensural_flag (anywhere, 2, dir_up);
 fet_endchar;
 
+
 % 16th mensural flag, downwards, between staff lines
-fet_beginchar("16th Mensural Flag (down)", "mensurald04")
-       draw_mensural_flag (between_staff_lines, 2, dir_down)
+fet_beginchar ("16th Mensural Flag (down)", "mensurald04");
+       draw_mensural_flag (between_staff_lines, 2, dir_down);
 fet_endchar;
 
+
 % 16th mensural flag, downwards, on staff line
-fet_beginchar("16th Mensural Flag (down)", "mensurald14")
-       draw_mensural_flag (on_staff_line, 2, dir_down)
+fet_beginchar ("16th Mensural Flag (down)", "mensurald14");
+       draw_mensural_flag (on_staff_line, 2, dir_down);
 fet_endchar;
 
+
 % 16th mensural flag, downwards, anywhere
-fet_beginchar("16th Mensural Flag (down)", "mensurald24")
-       draw_mensural_flag (anywhere, 2, dir_down)
+fet_beginchar ("16th Mensural Flag (down)", "mensurald24");
+       draw_mensural_flag (anywhere, 2, dir_down);
 fet_endchar;
 
+
 % 32th mensural flag, upwards, between staff lines
-fet_beginchar("32th Mensural Flag (up)", "mensuralu05")
-       draw_mensural_flag (between_staff_lines, 3, dir_up)
+fet_beginchar ("32th Mensural Flag (up)", "mensuralu05");
+       draw_mensural_flag (between_staff_lines, 3, dir_up);
 fet_endchar;
 
+
 % 32th mensural flag, upwards, on staff line
-fet_beginchar("32th Mensural Flag (up)", "mensuralu15")
-       draw_mensural_flag (on_staff_line, 3, dir_up)
+fet_beginchar ("32th Mensural Flag (up)", "mensuralu15");
+       draw_mensural_flag (on_staff_line, 3, dir_up);
 fet_endchar;
 
+
 % 32th mensural flag, upwards, anywhere
-fet_beginchar("32th Mensural Flag (up)", "mensuralu25")
-       draw_mensural_flag (anywhere, 3, dir_up)
+fet_beginchar ("32th Mensural Flag (up)", "mensuralu25");
+       draw_mensural_flag (anywhere, 3, dir_up);
 fet_endchar;
 
+
 % 32th mensural flag, downwards, between staff lines
-fet_beginchar("32th Mensural Flag (down)", "mensurald05")
-       draw_mensural_flag (between_staff_lines, 3, dir_down)
+fet_beginchar ("32th Mensural Flag (down)", "mensurald05");
+       draw_mensural_flag (between_staff_lines, 3, dir_down);
 fet_endchar;
 
+
 % 32th mensural flag, downwards, on staff line
-fet_beginchar("32th Mensural Flag (down)", "mensurald15")
-       draw_mensural_flag (on_staff_line, 3, dir_down)
+fet_beginchar ("32th Mensural Flag (down)", "mensurald15");
+       draw_mensural_flag (on_staff_line, 3, dir_down);
 fet_endchar;
 
+
 % 32th mensural flag, downwards, anywhere
-fet_beginchar("32th Mensural Flag (down)", "mensurald25")
-       draw_mensural_flag (anywhere, 3, dir_down)
+fet_beginchar ("32th Mensural Flag (down)", "mensurald25");
+       draw_mensural_flag (anywhere, 3, dir_down);
 fet_endchar;
 
+
 % 64th mensural flag, upwards, between staff lines
-fet_beginchar("64th Mensural Flag (up)", "mensuralu06")
-       draw_mensural_flag (between_staff_lines, 4, dir_up)
+fet_beginchar ("64th Mensural Flag (up)", "mensuralu06");
+       draw_mensural_flag (between_staff_lines, 4, dir_up);
 fet_endchar;
 
+
 % 64th mensural flag, upwards, on staff line
-fet_beginchar("64th Mensural Flag (up)", "mensuralu16")
-       draw_mensural_flag (on_staff_line, 4, dir_up)
+fet_beginchar ("64th Mensural Flag (up)", "mensuralu16");
+       draw_mensural_flag (on_staff_line, 4, dir_up);
 fet_endchar;
 
+
 % 64th mensural flag, upwards, anywhere
-fet_beginchar("64th Mensural Flag (up)", "mensuralu26")
-       draw_mensural_flag (anywhere, 4, dir_up)
+fet_beginchar ("64th Mensural Flag (up)", "mensuralu26");
+       draw_mensural_flag (anywhere, 4, dir_up);
 fet_endchar;
 
+
 % 64th mensural flag, downwards, between staff lines
-fet_beginchar("64th Mensural Flag (down)", "mensurald06")
-       draw_mensural_flag (between_staff_lines, 4, dir_down)
+fet_beginchar ("64th Mensural Flag (down)", "mensurald06");
+       draw_mensural_flag (between_staff_lines, 4, dir_down);
 fet_endchar;
 
+
 % 64th mensural flag, downwards, on staff line
-fet_beginchar("64th Mensural Flag (down)", "mensurald16")
-       draw_mensural_flag (on_staff_line, 4, dir_down)
+fet_beginchar ("64th Mensural Flag (down)", "mensurald16");
+       draw_mensural_flag (on_staff_line, 4, dir_down);
 fet_endchar;
 
+
 % 64th mensural flag, downwards, anywhere
-fet_beginchar("64th Mensural Flag (down)", "mensurald26")
-       draw_mensural_flag (anywhere, 4, dir_down)
+fet_beginchar ("64th Mensural Flag (down)", "mensurald26");
+       draw_mensural_flag (anywhere, 4, dir_down);
 fet_endchar;
 
-fet_endgroup ("flags")
+
+fet_endgroup ("flags");
index 5c346be8e97c7905970cb35a78dd5d6deb8cbddc..39c4ef6cf1d5be4cb08bfc661abed18065d55361 100644 (file)
@@ -10,7 +10,7 @@
 
 if test = -1:
        mode := smoke;
-fi
+fi;
 
 mode_setup;
 
@@ -25,7 +25,7 @@ input parmesan-macros;
 font_x_height staff_space#;
 
 
-fet_beginfont ("parmesan", design_size, "parmesanMusic")
+fet_beginfont ("parmesan", design_size, "parmesanMusic");
        if test = 0:
                input parmesan-rests;
                input parmesan-heads;
@@ -38,5 +38,5 @@ fet_beginfont ("parmesan", design_size, "parmesanMusic")
                input parmesan-dots;
        else:
 
-       fi
+       fi;
 fet_endfont;
index a21b942b024a3db7475be1c3511735552a9bbf80..b1ccf6455d936b124b4bc02837c486879dbb0e56 100644 (file)
@@ -12,7 +12,7 @@
 save black_notehead_width;
 numeric black_notehead_width;
 
-fet_begingroup ("noteheads")
+fet_begingroup ("noteheads");
 
 %
 % character aligment:
@@ -918,7 +918,7 @@ enddef;
 
 def inclinatum_char (expr verbose_name, internal_name,
                          small, stropha, auctum) =
-       fet_beginchar (verbose_name, "s" & internal_name)
+       fet_beginchar (verbose_name, "s" & internal_name);
                save ht, alpha;
 
                alpha := 35;
@@ -1146,7 +1146,7 @@ epiphonus_char ("Ed. Vat. cephalicus", "vaticana.cephalicus",
 
 
 % quilisma
-fet_beginchar ("Ed. Vat. quilisma", "svaticana.quilisma")
+fet_beginchar ("Ed. Vat. quilisma", "svaticana.quilisma");
        save a_b, b_h, a_w;
 
        a_b := 1.54; % b_h * a_b / a_w = wd / ht
@@ -1232,7 +1232,7 @@ inclinatum_char ("Solesmes stropha aucta", "solesmes.stropha.aucta",
 
 
 % solesmes oriscus
-fet_beginchar ("Solesmes oriscus", "ssolesmes.oriscus")
+fet_beginchar ("Solesmes oriscus", "ssolesmes.oriscus");
        save a_b, b_h, a_w;
 
        a_b := 1.54; % b_h * a_b / a_w = wd / ht
@@ -1309,7 +1309,7 @@ fet_endchar;
 %
 
 % inclinatum
-fet_beginchar ("Ed. Med. inclinatum", "smedicaea.inclinatum")
+fet_beginchar ("Ed. Med. inclinatum", "smedicaea.inclinatum");
        draw_diamond_head (1.2 staff_space#, 0, 0, 35, false);
 fet_endchar;
 
@@ -1468,4 +1468,4 @@ fet_beginchar ("Hufnagel pes lower punctum", "shufnagel.lpes")
 fet_endchar;
 
 
-fet_endgroup ("noteheads")
+fet_endgroup ("noteheads");
index 99c3547c370d3587a4d32f340c6d43c8e245e09c..435cc86a13c7775b5d352a5c050c54738e0b7460 100644 (file)
@@ -1,4 +1,4 @@
-% -*-Fundamental-*-
+% -%-Fundamental-%- -*-Metafont-*-
 % parmesan-scripts.mf -- implement ancient script symbols
 % 
 % source file of LilyPond's pretty-but-neat music font
 % (c) 2002--2006 Juergen Reuter <reuter@ipd.uka.de>
 % 
 
-fet_begingroup ("scripts")
+fet_begingroup ("scripts");
 
-fet_beginchar("ictus", "ictus")
+fet_beginchar ("ictus", "ictus");
        save ht, wd;
        ht# = .35 staff_space#;
        wd# = linethickness#;
-       define_pixels(wd, ht);
-       pickup pencircle
-               xscaled wd
-               yscaled blot_diameter;
-       set_char_box(wd#/2, wd#/2, ht#/2, ht#/2);
-       x1 = 0; top y1 = ht/2;
-       x2 = 0; bot y2 = -ht/2;
-       draw z1 -- z2;
+
+       define_pixels (wd, ht);
+
+       save ellipse;
+       path ellipse;
+
+       pickup pencircle xscaled wd
+                        yscaled blot_diameter;
+
+       ellipse := fullcircle xscaled wd
+                             yscaled blot_diameter;
+
+       set_char_box (wd# / 2, wd# / 2, ht# / 2, ht# / 2);
+
+       x1 = 0;
+       top y1 = ht / 2;
+       x2 = 0;
+       bot y2 = -ht / 2;
+
+       fill get_subpath (ellipse, up, down, z1)
+            -- get_subpath (ellipse, down, up, z2)
+            -- cycle;
+
+       labels (1, 2);
 fet_endchar;
 
 
 def draw_accentus =
        save thick, thin, ht, wd;
+
        thin# = 1 linethickness#;
        thick# = 1.2 linethickness#;
        ht# = .35 staff_space#;
        wd# = .25 staff_space#;
-       define_pixels(wd, ht, thin, thick);
-       z1 = z2 = (-wd/2 + thin/2, -ht/2 + thin/2);
-       z3 = z4 = (wd/2 - thick/2, ht/2 - thick/2);
-       penpos1(thin, angle(z1-z3));
-       penpos2(thin, angle(z1-z3)+90);
-       penpos3(thick, angle(z3-z1)+90);
-       penpos4(thick, angle(z3-z1));
-       fill z1r .. z2r -- z3l .. z4r .. z3r -- z2l .. cycle;
-       set_char_box(wd#/2, wd#/2, ht#/2, ht#/2);
+
+       define_pixels (wd, ht, thin, thick);
+
+       z1 = z2 = (-wd / 2 + thin / 2, -ht / 2 + thin / 2);
+       z3 = z4 = (wd / 2 - thick / 2, ht / 2 - thick / 2);
+
+       penpos1 (thin, angle (z1 - z3));
+       penpos2 (thin, angle (z1 - z3) + 90);
+       penpos3 (thick, angle (z3 - z1) + 90);
+       penpos4 (thick, angle (z3 - z1));
+
+       fill z1r
+            .. z2r
+            -- z3l
+            .. z4r
+            .. z3r
+            -- z2l
+            .. cycle;
+
+       set_char_box (wd#/2, wd#/2, ht#/2, ht#/2);
 enddef;
 
-fet_beginchar("accentus up", "uaccentus")
+
+fet_beginchar ("accentus up", "uaccentus");
        draw_accentus;
+       penlabels (1, 2, 3, 4);
 fet_endchar;
 
-fet_beginchar("accentus down", "daccentus")
+
+fet_beginchar ("accentus down", "daccentus");
        draw_accentus;
        y_mirror_char;
 fet_endchar;
 
 
-def draw_half_ellipse(expr ellips_width, ellips_height) =
-       save width, height, thin, thick;
-       width# = ellips_width;
-       height# = ellips_height;
-       define_pixels(width, height);
-
-       thin = thick = 0.6 linethickness;
-       penpos1(thick, 0);
-       penpos2(thin, -90);
-       z1r = (width/2, 0);
-       z2r = (0, -height/2);
-       penlabels(1,2);
-       penstroke z1e{down} .. {left}z2e;
-       addto currentpicture also currentpicture xscaled -1;
+def draw_half_circle (expr diam) =
+       save diameter, thick;
+
+       diameter# = diam;
+
+       define_pixels (diameter);
+
+       thick = 0.6 linethickness;
+
+       penpos1 (thick, 0);
+       penpos2 (thick, -90);
+       penpos3 (thick, -180);
+
+       z1r = (diameter / 2, 0);
+       z2r = (0, -diameter / 2);
+       z3r = (-diameter / 2, 0);
+       
+       penstroke z1e{down}
+                 .. z2e{left}
+                 .. z3e{up};
 enddef;
 
-fet_beginchar("half circle", "usemicirculus")
-       draw_half_ellipse(5/16 staff_space#, 5/16 staff_space#);
+
+fet_beginchar ("half circle", "usemicirculus");
+       draw_half_circle (5/16 staff_space#);
+
        currentpicture := currentpicture yscaled -1;
-       set_char_box(width#/2, width#/2, 0, height#/2);
+
+       set_char_box (diameter# / 2, diameter# / 2,
+                     0, diameter# / 2);
 fet_endchar;
 
 
-fet_beginchar("half circle", "dsemicirculus")
-       draw_half_ellipse(5/16 staff_space#, 5/16 staff_space#);
-       set_char_box(width#/2, width#/2, height#/2, 0);
+fet_beginchar ("half circle", "dsemicirculus");
+       draw_half_circle (5/16 staff_space#);
+
+       set_char_box (diameter# / 2, diameter# / 2,
+                     diameter# / 2, 0);
+
+       penlabels (1, 2, 3);
 fet_endchar;
 
 
-fet_beginchar("circle", "circulus")
-       draw_half_ellipse(5/16 staff_space#, 5/16 staff_space#);
-       set_char_box(width#/2, width#/2, height#/2, height#/2);
-       addto currentpicture also currentpicture yscaled -1;
+fet_beginchar ("circle", "circulus");
+       save diameter, thick;
+
+       diameter# = 5/16 staff_space#;
+
+       define_pixels (diameter);
+
+       thick = 0.6 linethickness;
+
+       fill fullcircle scaled diameter;
+       unfill fullcircle scaled (diameter - 2 thick);
+
+       set_char_box (diameter# / 2, diameter# / 2,
+                     diameter# / 2, diameter# / 2);
 fet_endchar;
 
 
-fet_beginchar("augmentum", "augmentum")
+fet_beginchar ("augmentum", "augmentum");
        save diameter;
+
        diameter# = 0.25 staff_space#;
-       define_pixels(diameter);
+
+       define_pixels (diameter);
+
        pickup pencircle scaled diameter;
-       drawdot (0,0);
-       set_char_box(diameter#/2, diameter#/2, diameter#/2, diameter#/2);
+
+       drawdot (0, 0);
+
+       set_char_box (diameter# / 2, diameter# / 2,
+                     diameter# / 2, diameter# / 2);
 fet_endchar;
 
 
 def draw_signum_congruentiae =
-       save za, zb, zc, zd, ze, zf, zg, zh;
-       pair za, zb, zc, zd, ze, zf, zg, zh;
-
-       set_char_box(0.50 staff_space# + 1.5 linethickness#,
-                    0.50 staff_space# + 1.5 linethickness#,
-                    2.5 linethickness#,
-                    2.00 staff_space# + 3.5 linethickness#);
-
-       pickup pencircle
-               xscaled 1.0 linethickness
-               yscaled 5.0 linethickness
-               rotated -35;
-       za = (+0.50staff_space, +2.00staff_space);
-       zb = (+0.00staff_space, +2.00staff_space);
-       zc = (-0.50staff_space, +1.50staff_space);
-       zd = (-0.25staff_space, +1.00staff_space);
-       ze = (+0.10staff_space, +0.80staff_space);
-       zf = (+0.00staff_space, +0.00staff_space);
-       draw za{-1,+1} .. zb .. zc .. zd .. ze .. zf;
+       set_char_box (0.50 staff_space# + 1.5 linethickness#,
+                     0.50 staff_space# + 1.5 linethickness#,
+                     2.5 linethickness#,
+                     2.00 staff_space# + 3.5 linethickness#);
+
+       save ellipse, pat;
+       path ellipse, pat;
+
+       ellipse := fullcircle xscaled 1.0 linethickness
+                             yscaled 5.0 linethickness
+                             rotated -35;
+
+       z1 = (+0.50 staff_space, +2.00 staff_space);
+       z2 = (+0.00 staff_space, +2.00 staff_space);
+       z3 = (-0.50 staff_space, +1.50 staff_space);
+       z4 = (-0.25 staff_space, +1.00 staff_space);
+       z5 = (+0.10 staff_space, +0.80 staff_space);
+       z6 = (+0.00 staff_space, +0.00 staff_space);
+
+       pat := z1{-1, +1}
+              .. z2
+              .. z3
+              .. z4
+              .. z5
+              .. z6;
+
+       % we avoid cusps originally present in `draw pat'
+       fill get_subpath (ellipse,
+                         -direction 0 of pat, direction 0 of pat, z1)
+            .. get_subpoint (ellipse, direction 1 of pat, z2)
+                 {direction 1 of pat}
+            .. get_subpoint (ellipse, direction 2 of pat, z3)
+                 {direction 2 of pat}
+            .. get_subpoint (ellipse, direction 3 of pat, z4)
+                 {direction 3 of pat}
+            .. get_subpoint (ellipse, direction 4 of pat, z5)
+                 {direction 4 of pat}
+            .. get_subpath (ellipse,
+                            direction 4.8 of pat, -direction 5 of pat, z6)
+            .. get_subpoint (ellipse, -direction 4 of pat, z5)
+                 {-direction 4 of pat}
+            .. get_subpoint (ellipse, -direction 3 of pat, z4)
+                 {-direction 3 of pat}
+            .. get_subpoint (ellipse, -direction 2.5 of pat, point 2.5 of pat)
+            .. get_subpoint (ellipse, -direction 1 of pat, z2)
+                 {-direction 1 of pat}
+            .. cycle;
 
        pickup pencircle scaled 3.0 linethickness;
-       zg = (-0.5staff_space, +0.0staff_space);
-       zh = (+0.5staff_space, +0.0staff_space);
-       drawdot zg;
-       drawdot zh;
+
+       z7 = (-0.5 staff_space, +0.0 staff_space);
+       z8 = (+0.5 staff_space, +0.0 staff_space);
+
+       drawdot z7;
+       drawdot z8;
 enddef;
 
-fet_beginchar("signum congruentiae up", "usignumcongruentiae")
+
+fet_beginchar ("signum congruentiae up", "usignumcongruentiae");
        draw_signum_congruentiae;
+       labels (1, 2, 3, 4, 5, 6, 7, 8);
 fet_endchar;
 
-fet_beginchar("signum congruentiae down", "dsignumcongruentiae")
+
+fet_beginchar ("signum congruentiae down", "dsignumcongruentiae");
        draw_signum_congruentiae;
        xy_mirror_char;
 fet_endchar;
 
-fet_endgroup ("scripts")
+
+fet_endgroup ("scripts");
index ef5539d615632a4357c78055aebe84b225b6eabb..264a487a10ac569769df89ceae76e9969fc9e6b2 100644 (file)
@@ -8,17 +8,21 @@
 % (c) 2002--2006 Juergen Reuter <reuter@ipd.uka.de>
 % 
 
-fet_begingroup ("timesig")
+fet_begingroup ("timesig");
+
 
 path threequartercircle;
-threequartercircle = halfcircle & quartercircle rotated 180;
+
+threequartercircle := halfcircle & quartercircle rotated 180;
 
 save mensural_Cdiameter, mensural_Cthickness, mensural_Chairpin;
+
 mensural_Cdiameter# := 3/2 staff_space#;
 mensural_Cthickness# := 2 linethickness#;
 mensural_Chairpin# := 0.5 linethickness#;
-define_pixels(mensural_Cdiameter, mensural_Cthickness);
-define_pixels(mensural_Chairpin);
+
+define_pixels (mensural_Cdiameter, mensural_Cthickness, mensural_Chairpin);
+
 
 %%%%%%%%
 %
@@ -31,112 +35,195 @@ define_pixels(mensural_Chairpin);
 
 def draw_nail (expr bottom_left, top_right) =
        save round;
-       round = floor min(blot_diameter,
-                         xpart (top_right-bottom_left),
-                         ypart (top_right-bottom_left));
+
+       round = floor min (blot_diameter,
+                          xpart (top_right-bottom_left),
+                          ypart (top_right-bottom_left));
 
        pickup pencircle scaled round;
 
-       begingroup;
-               save x,y;
-               z2+(round/2,round/2) = top_right + (mensural_Cthickness/2, 0);
-               z4-(round/2,round/2) = bottom_left;
-               y3 = y2;
-               y4 = y1;
-               x2 = x1 + mensural_Cthickness/2;
-               x2 - x1 = x4 - x3;
-               x5 = x1;
-               x6 = x4;
-               y5 = y6 = y2 - 2mensural_Cthickness;
-
-               pickup pencircle scaled round;
-               fill bot z1 .. rt z1 --- rt z5 .. rt z2 .. top z2 ---
-                    top z3 .. lft z3 .. lft z6 --- lft z4 .. bot z4 ---
-                    cycle;
-        endgroup;
+       z2 + (round / 2, round / 2) = top_right +
+                                       (mensural_Cthickness / 2, 0);
+       z4 - (round / 2,round / 2) = bottom_left;
+       y3 = y2;
+       y4 = y1;
+       x2 = x1 + mensural_Cthickness / 2;
+       x2 - x1 = x4 - x3;
+       x5 = x1;
+       x6 = x4;
+       y5 = y6 = y2 - 2 mensural_Cthickness;
+
+       pickup pencircle scaled round;
 
+       fill bot z1{right}
+            .. rt z1{up}
+            -- rt z5{up}
+            .. rt z2
+            .. top z2{left}
+            -- top z3{left}
+            .. lft z3
+            .. lft z6{down}
+            -- lft z4{down}
+            .. bot z4{right}
+            -- cycle;
+
+%      labels (1, 2, 3, 4, 5, 6);
 enddef;
 
-def mensural_timesig (expr verbose_name, internal_name,
-                     full_circle, reverse_circle, slashed, dotted) =
 
-       fet_beginchar(verbose_name, internal_name)
+def mensural_timesig (expr verbose_name, internal_name,
+                          full_circle, reverse_circle, slashed, dotted) =
+       fet_beginchar (verbose_name, internal_name);
                if slashed:
-                       set_char_box(0,
-                                    mensural_Cdiameter# + mensural_Cthickness#,
-                                    .75 (mensural_Cdiameter# + mensural_Cthickness#),
-                                    .75 (mensural_Cdiameter# + mensural_Cthickness#));
+                       set_char_box (
+                         0,
+                         mensural_Cdiameter# + mensural_Cthickness#,
+                         .75 (mensural_Cdiameter# + mensural_Cthickness#),
+                         .75 (mensural_Cdiameter# + mensural_Cthickness#));
+
                        if (full_circle or dotted):
-                               draw_nail((-mensural_Cthickness/2, -d), (mensural_Cthickness/2, h));
+                               draw_nail ((-mensural_Cthickness / 2, -d),
+                                          (mensural_Cthickness / 2, h));
+                       elseif reverse_circle:
+                               draw_nail ((0, -d), (mensural_Cthickness, h));
                        else:
-                               draw_nail((-mensural_Cthickness, -d), (0, h));
+                               draw_nail ((-mensural_Cthickness, -d), (0, h));
                        fi;
                else:
-                       set_char_box(0,
-                                    mensural_Cdiameter# + mensural_Cthickness#,
-                                    .5 (mensural_Cdiameter# + mensural_Cthickness#),
-                                    .5 (mensural_Cdiameter# + mensural_Cthickness#));
+                       set_char_box (
+                         0,
+                         mensural_Cdiameter# + mensural_Cthickness#,
+                         .5 (mensural_Cdiameter# + mensural_Cthickness#),
+                         .5 (mensural_Cdiameter# + mensural_Cthickness#));
+               fi;
+
+               save ellipse, pat;
+               path ellipse, pat;
+
+               ellipse := fullcircle xscaled mensural_Cthickness
+                                     yscaled mensural_Chairpin;
+
+               save rot;
+
+               if reverse_circle:
+                       rot := 225;
+               else:
+                       rot := 45;
                fi;
-               pickup pencircle xscaled mensural_Cthickness yscaled mensural_Chairpin rotated 0;
+
                if full_circle:
-                       draw fullcircle scaled mensural_Cdiameter;
-               elseif reverse_circle:
-                       draw threequartercircle rotated 225 scaled mensural_Cdiameter;
+                       pat := fullcircle scaled mensural_Cdiameter;
+
+                       fill get_subpoint (ellipse,
+                                          direction 0 of pat,
+                                          point 0 of pat)
+                            for i = 1 step 1 until length pat:
+                                    .. get_subpoint (ellipse,
+                                                     direction i of pat,
+                                                     point i of pat)
+                            endfor
+                            .. cycle;
+                       unfill get_subpoint (ellipse,
+                                            -direction 0 of pat,
+                                            point 0 of pat)
+                              for i = 1 step 1 until length pat:
+                                      .. get_subpoint (ellipse,
+                                                       -direction i of pat,
+                                                       point i of pat)
+                              endfor
+                              .. cycle;
                else:
-                       draw threequartercircle rotated 45 scaled mensural_Cdiameter;
+                       pat := threequartercircle rotated rot
+                                                 scaled mensural_Cdiameter;
+
+                       fill get_subpath (ellipse,
+                                         -direction 0 of pat,
+                                         direction 0 of pat,
+                                         point 0 of pat)
+                            for i = 1 step 1 until (length pat - 1):
+                                    .. get_subpoint (ellipse,
+                                                     direction i of pat,
+                                                     point i of pat)
+                            endfor
+                            .. get_subpath (ellipse,
+                                            direction infinity of pat,
+                                            -direction infinity of pat,
+                                            point infinity of pat)
+                            for i = (length pat - 1) step -1 until 1:
+                                    .. get_subpoint (ellipse,
+                                                     -direction i of pat,
+                                                     point i of pat)
+                            endfor
+                            .. cycle;
                fi;
+
                if dotted:
                        pickup pencircle scaled 4 linethickness;
-                       drawdot (0,0);
+                       drawdot (0, 0);
                fi;
-               currentpicture := currentpicture shifted 0.5(mensural_Cdiameter + mensural_Cthickness, 0);
+
+               currentpicture := currentpicture
+                                   shifted 0.5 (mensural_Cdiameter
+                                                + mensural_Cthickness, 0);
        fet_endchar;
 enddef;
 
+
 %% tempus imperfectum cum prolatione imperfecta
 mensural_timesig ("Mensural 4/4 meter", "mensural44",
                  false, false, false, false);
 
+
 %% tempus imperfectum cum prolatione imperfecta proportio dupla
 mensural_timesig ("Mensural 2/2 meter", "mensural22",
                  false, false, true, false);
 
+
 %% tempus perfectum cum prolatione imperfecta
 mensural_timesig ("Mensural 3/2 meter", "mensural32",
                  true, false, false, false);
 
+
 %% tempus imperfectum cum prolatione perfecta
 mensural_timesig ("Mensural 6/4 meter", "mensural64",
                  false, false, false, true);
 
+
 %% tempus perfectum cum prolatione perfecta
 mensural_timesig ("Mensural 9/4 meter", "mensural94",
                  true, false, false, true);
 
+
 %% tempus perfectum cum prolatione imperfecta proportio dupla
 mensural_timesig ("Mensural 3/4 meter", "mensural34",
                  true, false, true, false);
 
+
 %% tempus imperfectum cum prolatione perfecta proportio dupla
 mensural_timesig ("Mensural 6/8 meter", "mensural68",
                  false, false, true, true);
 
+
 %% tempus perfectum cum prolatione perfecta proportio dupla
 mensural_timesig ("Mensural 9/8 meter", "mensural98",
                  true, false, true, true);
+
        
 %% tempus imperfectum cum prolatione imperfecta diminutio simplex
 mensural_timesig ("Mensural 4/8 meter", "mensural48",
                  false, true, false, false);
 
+
 %% tempus imperfectum cum prolatione perfecta diminutio simplex
 mensural_timesig ("Mensural 6/8 meter", "mensural68alt",
                  false, true, false, true);
 
+
 %% tempus imperfectum cum prolatione imperfecta diminutio duplex
 mensural_timesig ("Mensural 2/4 meter", "mensural24",
                  false, true, true, false);
 
+
 %%%%%%%%
 %
 %
@@ -147,88 +234,165 @@ mensural_timesig ("Mensural 2/4 meter", "mensural24",
 %
 
 save neomensural_Cdiameter, neomensural_Cthickness;
+
 neomensural_Cdiameter# := 3/2 staff_space#;
 neomensural_Cthickness# := 2 linethickness#;
-define_pixels(neomensural_Cdiameter, neomensural_Cthickness);
+
+define_pixels (neomensural_Cdiameter, neomensural_Cthickness);
+
 
 def neomensural_timesig (expr verbose_name, internal_name,
-                        full_circle, reverse_circle, slashed, dotted) =
+                             full_circle, reverse_circle, slashed, dotted) =
+       fet_beginchar (verbose_name, internal_name);
+               set_char_box (
+                 0,
+                 neomensural_Cdiameter# + neomensural_Cthickness#,
+                 .5 (neomensural_Cdiameter# + neomensural_Cthickness#),
+                 .5 (neomensural_Cdiameter# + neomensural_Cthickness#));
 
-       fet_beginchar(verbose_name, internal_name)
                if slashed:
-                       set_char_box(0,
-                                    neomensural_Cdiameter# + neomensural_Cthickness#,
-                                    .5 (neomensural_Cdiameter# + neomensural_Cthickness#),
-                                    .5 (neomensural_Cdiameter# + neomensural_Cthickness#));
                        if (full_circle or dotted):
-                               draw_block((-neomensural_Cthickness/2, -d), (neomensural_Cthickness/2, h));
+                               draw_block ((-neomensural_Cthickness / 2,
+                                            -d + neomensural_Cthickness / 2),
+                                           (neomensural_Cthickness / 2,
+                                            h - neomensural_Cthickness / 2));
+                       elseif reverse_circle:
+                               draw_block ((0,
+                                            -d + neomensural_Cthickness / 2),
+                                           (neomensural_Cthickness,
+                                            h - neomensural_Cthickness / 2));
                        else:
-                               draw_block((-neomensural_Cthickness, -d), (0, h));
+                               draw_block ((-neomensural_Cthickness,
+                                            -d + neomensural_Cthickness / 2),
+                                           (0,
+                                            h - neomensural_Cthickness / 2));
                        fi;
+               fi;
+
+               save ellipse, pat;
+               path ellipse, pat;
+
+               ellipse := fullcircle scaled neomensural_Cthickness;
+
+               save rot;
+
+               if reverse_circle:
+                       rot := 225;
                else:
-                       set_char_box(0,
-                                    neomensural_Cdiameter# + neomensural_Cthickness#,
-                                    .5 (neomensural_Cdiameter# + neomensural_Cthickness#),
-                                    .5 (neomensural_Cdiameter# + neomensural_Cthickness#));
+                       rot := 45;
                fi;
-               pickup pencircle scaled neomensural_Cthickness;
+
                if full_circle:
-                       draw fullcircle scaled neomensural_Cdiameter;
-               elseif reverse_circle:
-                       draw threequartercircle rotated 225 scaled neomensural_Cdiameter;
+                       pat := fullcircle scaled neomensural_Cdiameter;
+
+                       fill get_subpoint (ellipse,
+                                          direction 0 of pat,
+                                          point 0 of pat)
+                            for i = 1 step 1 until length pat:
+                                    .. get_subpoint (ellipse,
+                                                     direction i of pat,
+                                                     point i of pat)
+                            endfor
+                            .. cycle;
+                       unfill get_subpoint (ellipse,
+                                            -direction 0 of pat,
+                                            point 0 of pat)
+                              for i = 1 step 1 until length pat:
+                                      .. get_subpoint (ellipse,
+                                                       -direction i of pat,
+                                                       point i of pat)
+                              endfor
+                              .. cycle;
                else:
-                       draw threequartercircle rotated 45 scaled neomensural_Cdiameter;
+                       pat := threequartercircle rotated rot
+                                                 scaled neomensural_Cdiameter;
+
+                       fill get_subpath (ellipse,
+                                         -direction 0 of pat,
+                                         direction 0 of pat,
+                                         point 0 of pat)
+                            for i = 1 step 1 until (length pat - 1):
+                                    .. get_subpoint (ellipse,
+                                                     direction i of pat,
+                                                     point i of pat)
+                            endfor
+                            .. get_subpath (ellipse,
+                                            direction infinity of pat,
+                                            -direction infinity of pat,
+                                            point infinity of pat)
+                            for i = (length pat - 1) step -1 until 1:
+                                    .. get_subpoint (ellipse,
+                                                     -direction i of pat,
+                                                     point i of pat)
+                            endfor
+                            .. cycle;
                fi;
+
                if dotted:
                        pickup pencircle scaled 4 linethickness;
-                       drawdot (0,0);
+                       drawdot (0, 0);
                fi;
-               currentpicture := currentpicture shifted 0.5(neomensural_Cdiameter + neomensural_Cthickness, 0);
+
+               currentpicture := currentpicture
+                                    shifted 0.5 (neomensural_Cdiameter
+                                                 + neomensural_Cthickness, 0);
        fet_endchar;
 enddef;
 
+
 %% tempus imperfectum cum prolatione imperfecta
 neomensural_timesig ("Mensural 4/4 meter", "neomensural44",
-                       false, false, false, false);
+                    false, false, false, false);
+
 
 %% tempus imperfectum cum prolatione imperfecta proportio dupla
 neomensural_timesig ("Mensural 2/2 meter", "neomensural22",
-                       false, false, true, false);
+                    false, false, true, false);
+
 
 %% tempus perfectum cum prolatione imperfecta
 neomensural_timesig ("Mensural 3/2 meter", "neomensural32",
-                       true, false, false, false);
+                    true, false, false, false);
+
 
 %% tempus imperfectum cum prolatione perfecta
 neomensural_timesig ("Mensural 6/4 meter", "neomensural64",
-                       false, false, false, true);
+                    false, false, false, true);
+
 
 %% tempus perfectum cum prolatione perfecta
 neomensural_timesig ("Mensural 9/4 meter", "neomensural94",
-                       true, false, false, true);
+                    true, false, false, true);
+
 
 %% tempus perfectum cum prolatione imperfecta proportio dupla
 neomensural_timesig ("Mensural 3/4 meter", "neomensural34",
-                       true, false, true, false);
+                    true, false, true, false);
+
 
 %% tempus imperfectum cum prolatione perfecta proportio dupla
 neomensural_timesig ("Mensural 6/8 meter", "neomensural68",
-                       false, false, true, true);
+                    false, false, true, true);
+
 
 %% tempus perfectum cum prolatione perfecta proportio dupla
 neomensural_timesig ("Mensural 9/8 meter", "neomensural98",
-                       true, false, true, true);
+                    true, false, true, true);
+
        
 %% tempus imperfectum cum prolatione imperfecta diminutio simplex
 neomensural_timesig ("Mensural 4/8 meter", "neomensural48",
-                       false, true, false, false);
+                    false, true, false, false);
+
 
 %% tempus imperfectum cum prolatione perfecta diminutio simplex
 neomensural_timesig ("Mensural 6/8 meter", "neomensural68alt",
-                       false, true, false, true);
+                    false, true, false, true);
+
 
 %% tempus imperfectum cum prolatione imperfecta diminutio duplex
 neomensural_timesig ("Mensural 2/4 meter", "neomensural24",
-                       false, true, true, false);
+                    false, true, true, false);
+
 
-fet_endgroup ("timesig")
+fet_endgroup ("timesig");
index 206fe9d31c4e8af47fb6a9fc0f84c3d74fa76673..169b40e190a3a45799a11b9be6b0b3a6337faa8d 100644 (file)
@@ -1,13 +1,13 @@
 # Translation of LilyPond.
 # Copyright (C) 2007 Han-Wen Nienhuys, Jan Nieuwenhuizen
-# This file is distributed under the same license as the lilypond package.
+# This file is distributed under the same license as lilypond package.
 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: lilypond 2.11.20\n"
-"Report-Msgid-Bugs-To: http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs"
-"POT-Creation-Date: 2007-02-25 22:11+0100\n"
+"Project-Id-Version: lilypond 2.11.22\n"
+"Report-Msgid-Bugs-To: http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs\n"
+"POT-Creation-Date: 2007-04-28 12:03+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -538,13 +538,7 @@ msgstr ""
 msgid "natural alteration glyph not found"
 msgstr ""
 
-#: align-interface.cc:191
-msgid ""
-"vertical alignment called before line-breaking.\n"
-"Only do cross-staff spanners with PianoStaff."
-msgstr ""
-
-#: align-interface.cc:324
+#: align-interface.cc:322
 msgid "tried to get a translation for something that is no child of mine"
 msgstr ""
 
@@ -1318,7 +1312,7 @@ msgstr ""
 msgid "none of note heads `%s' or `%s' found"
 msgstr ""
 
-#: note-heads-engraver.cc:61
+#: note-heads-engraver.cc:64
 msgid "NoteEvent without pitch"
 msgstr ""
 
@@ -1357,47 +1351,47 @@ msgstr ""
 msgid "FT_Get_Glyph_Name () error: %s"
 msgstr ""
 
-#: page-turn-page-breaking.cc:162
+#: page-turn-page-breaking.cc:146
 #, c-format
 msgid "page-turn-page-breaking: breaking from %d to %d"
 msgstr ""
 
-#: page-turn-page-breaking.cc:213
+#: page-turn-page-breaking.cc:195
 msgid ""
 "cannot fit the first page turn onto a single page.  Consider setting first-"
 "page-number to an even number."
 msgstr ""
 
-#: page-turn-page-breaking.cc:226
+#: page-turn-page-breaking.cc:208
 #, c-format
 msgid "Calculating page and line breaks (%d possible page breaks)..."
 msgstr ""
 
-#: page-turn-page-breaking.cc:244 paper-score.cc:146
+#: page-turn-page-breaking.cc:226 paper-score.cc:146
 msgid "Drawing systems..."
 msgstr ""
 
-#: page-turn-page-breaking.cc:293
+#: page-turn-page-breaking.cc:275
 #, c-format
 msgid "break starting at page %d"
 msgstr ""
 
-#: page-turn-page-breaking.cc:294
+#: page-turn-page-breaking.cc:276
 #, c-format
 msgid "\tdemerits: %f"
 msgstr ""
 
-#: page-turn-page-breaking.cc:295
+#: page-turn-page-breaking.cc:277
 #, c-format
 msgid "\tsystem count: %d"
 msgstr ""
 
-#: page-turn-page-breaking.cc:296
+#: page-turn-page-breaking.cc:278
 #, c-format
 msgid "\tpage count: %d"
 msgstr ""
 
-#: page-turn-page-breaking.cc:297
+#: page-turn-page-breaking.cc:279
 #, c-format
 msgid "\tprevious break: %d"
 msgstr ""
@@ -1467,7 +1461,7 @@ msgstr ""
 msgid "MIDI output to `%s'..."
 msgstr ""
 
-#: phrasing-slur-engraver.cc:146
+#: phrasing-slur-engraver.cc:131
 msgid "unterminated phrasing slur"
 msgstr ""
 
@@ -1912,7 +1906,7 @@ msgstr ""
 msgid "program too old: %s (file requires: %s)"
 msgstr ""
 
-#: backend-library.scm:19 lily.scm:753 ps-to-png.scm:58
+#: backend-library.scm:19 lily.scm:752 ps-to-png.scm:58
 #, scheme-format
 msgid "Invoking `~a'..."
 msgstr ""
@@ -2069,7 +2063,7 @@ msgstr ""
 msgid "TeX file name must not contain whitespace: `~a'"
 msgstr ""
 
-#: graphviz.scm:51
+#: graphviz.scm:53
 #, scheme-format
 msgid "Writing graph `~a'..."
 msgstr ""
@@ -2128,12 +2122,12 @@ msgid ""
 "~a"
 msgstr ""
 
-#: lily.scm:649 lily.scm:743
+#: lily.scm:649 lily.scm:742
 #, scheme-format
 msgid "failed files: ~S"
 msgstr ""
 
-#: lily.scm:733
+#: lily.scm:732
 #, scheme-format
 msgid "Redirecting output to ~a..."
 msgstr ""
index 1cd2d4e76660dd61beab4e3662a5a7a5db80d494..f2d9dbd9ca929527f153ddb4957f35881cdf684a 100644 (file)
@@ -2999,3 +2999,11 @@ def conv (str):
     return str
 
 conversions.append (((2, 11, 15), conv, """#'edge-height -> #'bound-details #'right/left #'text = ..."""))
+
+def conv (str):
+    str = re.sub (r"\\override\s*([a-zA-Z.]+)\s*#'break-align-symbol\s*=\s*#'([a-z-]+)",
+                  r"\\override \1 #'break-align-symbols = #'(\2)", str)
+    return str
+
+conversions.append (((2, 11, 23), conv, """#'break-align-symbol -> #'break-align-symbols"""))
+
index 3bf185ac42b686ad0e4851dd0e39d15fd0de0a3f..34a87a20cf46b8d0c45c0b94111da72e08149497 100644 (file)
@@ -102,6 +102,10 @@ ly:break-aligned-interface::calc-extent-aligned-anchor for aligning
 an anchor to a grobs extent")
      (break-align-symbol ,symbol? "This key is used for aligning and
 spacing breakable items.")
+     (break-align-symbols ,list? "A list of symbols that determine
+which break-aligned grobs to align this to. If the grob selected by
+the first symbol in the list is invisible due to break-visibility,
+we will align to the next grob (and so on).")
      (break-align-orders ,vector? "Defines the order in which
 prefatory matter (clefs, key signatures) appears.  The format is a
 vector of length@tie{}3, where each element is one order for
index 3ab5b2c677efdb1de3f3816864ad35f170439962..5ae742fc8b43b747f5007d4594fde0f2ba166597 100644 (file)
        (glyph . "|")
        (gap . 0.4)
        (layer . 0)
-       (break-visibility . ,all-visible)
+       (break-visibility . ,bar-line::calc-break-visibility)
        (non-musical . #t)
        (stencil . ,ly:bar-line::print)
        (glyph-name . ,bar-line::calc-glyph-name)
        (self-alignment-X . 1)
 
        ;; want the bar number before the clef at line start. 
-       (break-align-symbol . left-edge)
+       (break-align-symbols . (left-edge staff-bar))
        (meta .
              ((class . Item)
               (interfaces . (side-position-interface
        (axes . (0))
        (X-extent . ,ly:axis-group-interface::width)
        (break-align-anchor . ,ly:break-aligned-interface::calc-average-anchor)
+       (break-visibility . ,ly:break-aligned-interface::calc-break-visibility)
        (meta . ((class . Item)
                 (interfaces . (break-aligned-interface
                                axis-group-interface))))))
        (font-size . 2)
        (baseline-skip . 2)
        (break-visibility . ,end-of-line-invisible)
-       (break-align-symbol . clef)
+       (break-align-symbols . (staff-bar clef))
        (padding . 0.8)
        (outside-staff-priority . 1500)
        (meta . ((class . Item)
index eea76143769952258f68b3dd449f889a1d20b7f1..bd3aa52744aea695cfce8e72ce91341f3683a5ea 100644 (file)
@@ -224,45 +224,49 @@ centered, X==1 is at the right, X == -1 is at the left."
 
 ;;
 ;; How should a  bar line behave at a break? 
-;;
-;; Why prepend `default-' to every scm identifier?
+(define bar-glyph-alist
+  '((":|:" . (":|" . "|:"))
+    ("||:" . ("||" . "|:"))
+    ("dashed" . ("dashed" . '())) 
+    ("|" . ("|" . ()))
+    ("||:" . ("||" . "|:"))
+    ("|s" . (() . "|"))
+    ("|:" . ("|" . "|:"))
+    ("|." . ("|." . ()))
+    
+    ;; hmm... should we end with a bar line here?
+    (".|" . ("|" . ".|"))
+    (":|" . (":|" . ()))
+    ("||" . ("||" . ()))
+    (".|." . (".|." . ()))
+    ("" . ("" . ""))
+    (":" . (":" . ""))
+    ("." . ("." . ()))
+    ("empty" . (() . ()))
+    ("brace" . (() . "brace"))
+    ("bracket" . (() . "bracket")) 
+    ))
+
 (define-public (bar-line::calc-glyph-name grob)
   (let* (
         (glyph (ly:grob-property grob 'glyph))
         (dir (ly:item-break-dir grob))
-        (result (assoc glyph 
-                      '((":|:" . (":|" . "|:"))
-                        ("||:" . ("||" . "|:"))
-                        ("dashed" . ("dashed" . '())) 
-                        ("|" . ("|" . ()))
-                        ("||:" . ("||" . "|:"))
-                        ("|s" . (() . "|"))
-                        ("|:" . ("|" . "|:"))
-                        ("|." . ("|." . ()))
-
-                        ;; hmm... should we end with a bar line here?
-                        (".|" . ("|" . ".|"))
-                        (":|" . (":|" . ()))
-                        ("||" . ("||" . ()))
-                        (".|." . (".|." . ()))
-                        ("" . ("" . ""))
-                        (":" . (":" . ""))
-                        ("." . ("." . ()))
-                        ("empty" . (() . ()))
-                        ("brace" . (() . "brace"))
-                        ("bracket" . (() . "bracket"))  )))
+        (result (assoc glyph  bar-glyph-alist))
         (glyph-name (if (= dir CENTER)
                         glyph
                         (if (and result (string? (index-cell (cdr result) dir)))
                             (index-cell (cdr result) dir)
                             #f)))
         )
-
-    (if (not glyph-name)
-       (ly:grob-suicide! grob))
-
     glyph-name))
 
+(define-public (bar-line::calc-break-visibility grob)
+  (let* ((glyph (ly:grob-property grob 'glyph))
+        (result (assoc glyph bar-glyph-alist)))
+    (if result
+       (vector (string? (cadr result)) #t (string? (cddr result)))
+       #(#f #f #f))))
+
 
 (define-public (shift-right-at-line-begin g)
   "Shift an item to the right, but only at the start of the line."