]> git.donarmstrong.com Git - lilypond.git/commitdiff
*** empty log message ***
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 23 Dec 2003 22:29:44 +0000 (22:29 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 23 Dec 2003 22:29:44 +0000 (22:29 +0000)
94 files changed:
Documentation/user/refman.itely
input/mutopia/F.Schubert/standchen.ly
input/mutopia/R.Schumann/romanze-op28-2.ly
input/mutopia/W.A.Mozart/mozart-hrn3-defs.ly
input/regression/accidental-single-double.ly
input/regression/accidental-voice.ly
input/regression/accidental.ly
input/template/piano-dynamics.ly
input/test/bagpipe.ly
input/test/bar-number-regular-interval.ly
input/test/cautionaries.ly
input/test/figured-bass-alternate.ly
lily/engraver-group-engraver.cc
lily/font-interface.cc
lily/font-metric.cc
lily/font-select.cc
lily/font-size-engraver.cc
lily/include/input-file-results.hh
lily/include/lily-guile.hh
lily/include/midi-def.hh
lily/include/music-output-def.hh
lily/include/music-output.hh
lily/include/my-lily-lexer.hh
lily/include/my-lily-parser.hh
lily/include/paper-def.hh
lily/include/paper-outputter.hh
lily/include/paper-score.hh
lily/include/performance.hh
lily/include/score.hh
lily/input-file-results.cc
lily/lily-guile.cc
lily/main.cc
lily/mark-engraver.cc
lily/midi-def.cc
lily/music-output-def.cc
lily/music.cc
lily/my-lily-lexer.cc
lily/my-lily-parser.cc
lily/paper-def.cc
lily/paper-score.cc
lily/parser.yy
lily/performance.cc
lily/piano-pedal-engraver.cc
lily/recording-group-engraver.cc [new file with mode: 0644]
lily/scm-option.cc
lily/score-engraver.cc
lily/score-performer.cc
lily/score.cc
lily/spacing-spanner.cc
lily/stem.cc
lily/string-number-engraver.cc
lily/text-spanner.cc
lily/tie-engraver.cc
lily/translator-group.cc
lily/translator.cc
ly/engraver-init.ly
ly/gregorian-init.ly
ly/paper11-init.ly
ly/paper13-init.ly
ly/paper16-init.ly
ly/paper20-init.ly
ly/paper23-init.ly
ly/paper26-init.ly
ly/params-init.ly
mf/GNUmakefile
mf/feta-bolletjes.mf
mf/feta-din-code.mf
mf/feta-generic.mf
mf/feta-macros.mf
mf/feta-params.mf
mf/feta-toevallig.mf
mf/feta11.mf
mf/feta13.mf
mf/feta16.mf
mf/feta23.mf
mf/feta26.mf
mf/parmesan11.mf
mf/parmesan13.mf
mf/parmesan16.mf
mf/parmesan23.mf
mf/parmesan26.mf
scm/chord-name.scm
scm/define-grob-properties.scm
scm/define-translator-properties.scm
scm/document-functions.scm
scm/font.scm
scm/lily.scm
scm/music-functions.scm
scm/new-markup.scm
scm/output-lib.scm
scm/output-ps.scm
scm/to-xml.scm
scripts/convert-ly.py
tex/GNUmakefile

index 4678a6aaea854046d5ebf5a3dcedea7f8fa81809..5822820de897514766125b980a16d76f7367e30b 100644 (file)
@@ -3114,7 +3114,6 @@ terminating too soon.
 The staff switches often do not end up in optimal places. For high
 quality output, staff switches should be specified manually.
 
 
 @node Manual staff switches
 @subsection Manual staff switches
@@ -3134,6 +3133,7 @@ current voice from its current staff to the Staff called
 @code{"down"}.
 
 
+
 @node Pedals
 @subsection Pedals
 @cindex Pedals
@@ -7535,11 +7535,10 @@ then you can use
 @end example
 @end itemize
 
- The object description is an Scheme association
-list. Since a Scheme list is a singly linked list, we can treat it as
-a stack, and @code{\override} and @code{\revert} are push and pop
-operations.  The association list is stored in a normal context
-property, hence
+The object description is an Scheme association list. Since a Scheme
+list is a singly linked list, we can treat it as a stack, and
+@code{\override} and @code{\revert} are push and pop operations.  The
+association list is stored in a normal context property, hence
 @example
  \property Voice.NoteHead  = #'() 
 @end example
@@ -7562,6 +7561,28 @@ Cyclic references in Scheme values for properties cause hangs and/or
 crashes.  Reverting properties that are system defaults may also lead
 to crashes.
 
+A property tweak of modifies a local copy of the object definition.
+After such a tweak, the definition is independent of the objects in
+enclosing contexts. For example
+
+@lilypond
+  \property Voice.Stem \set #'neutral-direction = #1
+  b'8
+  \property Staff.Stem \set #'thickness = #4.0
+  b'16
+  \new Voice { b'32 }
+@end lilypond
+
+In this fragment, @code{neutral-direction} is tweaked. As a result,
+the current @internalsref{Voice} gets a private version of the
+@internalsref{Stem} object. The following tweak modifies the
+definition at @internalsref{Staff} level. Since it a different
+definition, the thickness of the @code{b'16} is unaffected.  For the
+third note, a new Voice is created, which inherits the new definition,
+including the changed thickness, but excluding the new neutral
+direction.
+
+
 @node Constructing a tweak
 @subsection Constructing a tweak
 
@@ -7761,34 +7782,26 @@ center-line:
 
 The most common thing to change about the appearance of fonts is their
 size. The font size of any context can be easily changed by setting
-the @code{fontSize} property for that context.  Its value is an
-integer: negative numbers make the font smaller, positive numbers
-larger. An example is given below:
+the @code{fontSize} property for that context.  Its value is a number:
+negative numbers make the font smaller, positive numbers larger. An
+example is given below:
 @c
 @lilypond[fragment,relative=1,verbatim,quote]
   c4 c4 \property Voice.fontSize = #-1
   f4 g4
 @end lilypond
-This command will set @code{font-relative-size} (see below), and does
+This command will set @code{font-size} (see below), and does
 not change the size of variable symbols, such as beams or slurs.
 
-
 One of the uses of @code{fontSize} is to get smaller symbol for cue
 notes. An elaborate example of those is in
 @inputfileref{input/test,cue-notes.ly}.
 
 @cindex magnification
 
-The size of the font may be scaled with the object property
-@code{font-magnification}.  For example, @code{2.0} blows up all
-letters by a factor 2 in both directions.
 
 
 @cindex cue notes
-@cindex font size
-@cindex size
-@cindex symbol size
-@cindex glyph size
 
 The font used for printing a object can be selected by setting
 @code{font-name}, e.g.
@@ -7800,7 +7813,13 @@ The font used for printing a object can be selected by setting
 @noindent
 Any font can be used, as long as it is available to @TeX{}. Possible
 fonts include foreign fonts or fonts that do not belong to the
-Computer Modern font family.
+Computer Modern font family.  The size of fonts selected in this way
+can be changed with the @code{font-magnification} property.  For
+example, @code{2.0} blows up all letters by a factor 2 in both
+directions.
+
+@cindex font size
+@cindex font magnification
 
 Font selection for the standard fonts, @TeX{}'s Computer Modern fonts,
 can also be adjusted with a more fine-grained mechanism.  By setting
@@ -7808,6 +7827,7 @@ the object properties described below, you can select a different font;
 all three mechanisms work for every object that supports
 @code{font-interface}:
 
+
 @table @code
 @item font-family
  is a symbol indicating the general class of the typeface.  Supported are
@@ -7825,22 +7845,6 @@ is a  symbol indicating the series of the font. There are typically several
 font series for each font family and shape. Choices are @code{medium}
 and @code{bold}. 
 
-@item font-relative-size
-  is a number indicating the size relative the standard size.  For example,
-  with 20pt staff height, relative size -1  corresponds to 16pt staff
-  height, and relative size +1 corresponds to 23 pt staff height.
-
-   There are small differences in design between fonts designed for
-different sizes, hence @code{font-relative-size} is preferred over
-@code{font-magnification} for changing font sizes.
-
-
-@item font-design-size
-is a number indicating  the design size of the font. 
-
-This is a feature of the Computer Modern Font: each point size has a
-slightly different design. Smaller design sizes are relatively wider,
-which enhances readability.
 @end table
 
 For any of these properties, the value @code{*} (i.e. the symbol
@@ -7854,6 +7858,20 @@ to override default setting, which are always present. For example:
 
 @cindex @code{font-style}
 
+The font size is set by modifying the @code{font-size} property.  Its
+value is a number indicating the size relative to the standard size.
+Each step up is an increase of approximately 12% of the font size. Six
+steps is exactly a factor two.
+
+LilyPond has fonts in different design sizes: the music fonts for
+smaller sizes are chubbier, while the text fonts are relatively wider.
+Font size changes are achieved by scaling the design size that is
+closest to the desired size.
+
+The @code{font-size} mechanism does not work for fonts selected
+through @code{font-name}. These may be scaled with
+@code{font-magnification}.
+
 @refcommands
 
 The following commands set @code{fontSize} for the current voice.
index 079577d4b501b654db2c98b4b50719896e0c23d3..5601bc1f60f13278668767ce3c488de351422b18 100644 (file)
@@ -42,7 +42,7 @@ instrument = "Piano"
  footer = "Mutopia-2001/04/27-xx"
 } 
 
-\version "1.9.8"
+\version "2.1.1"
 
 dynamicUp = \property Voice.DynamicLineSpanner \override #'direction = #1
 dynamicRevert = \property Voice.DynamicLineSpanner \revert #'direction
@@ -382,7 +382,7 @@ global =  \notes{
 
 allLyrics = \lyrics {
        % maybe should be bigger by default, in grob-description.scm ?
-       \property Lyrics . LyricText \override #'font-relative-size = #1
+       \property Lyrics . LyricText \override #'font-size = #2
        \property Lyrics . LyricHyphen \override #'maximum-length = #1.5
        \context LyricsVoice = "leise-1"  { \lyricVerseOne
        \lyricVerseTwo
index aeadb1f0d1a8d61fe07b408c385749c14f3078d5..d58caec389215c1f1c22e057eca5e6f65fcb10b3 100644 (file)
@@ -6,7 +6,7 @@
 %% 19 is broken --hwn.
 %\include "paper19.ly"
 \include "paper16.ly"
-\version "1.9.8"
+\version "2.1.1"
 
 \header {
   title = "Romanzen"
@@ -245,7 +245,7 @@ leftb = \notes \transpose c cis {
     \property PianoStaff.connectArpeggios = ##t
     \property PianoStaff.Arpeggio \override #'molecule-callback = \arpeggioBracket
 
-    \property PianoStaff.InstrumentName \set #'font-relative-size   = #3
+    \property PianoStaff.InstrumentName \set #'font-size = #6
     \property PianoStaff.InstrumentName \set #'font-shape   = #'italic
     \property PianoStaff.InstrumentName \set #'font-magnification   = #3
     
@@ -255,7 +255,7 @@ leftb = \notes \transpose c cis {
       \clef G <<\global \context Voice=upv \righta >>
     }
     \context Staff = mid {
-    \property Staff.InstrumentName \set #'font-relative-size   = #0
+    \property Staff.InstrumentName \set #'font-size = #0
     \property Staff.InstrumentName \set #'font-shape   = #'upright
     \property Staff.InstrumentName \set #'font-magnification   = #1
     \property Staff.InstrumentName \set #'extra-offset = #'(0 . 6)
index 2eb3ed210961f631905596cb6df4449f010fc958..3ded8e1afa34da69746420420e67af9c4ca9b34f 100644 (file)
@@ -4,7 +4,7 @@ longgrace = \property Voice.Stem \override #'stroke-style = #'()
 endlonggrace = \property Voice.Stem \revert #'stroke-style
 ritenuto = \markup { \italic  "rit." }
 
-\version "1.9.8"
+\version "2.1.1"
   
 cresc = \notes {
     #(ly:export (make-event-chord (list (make-span-event 'CrescendoEvent START)))) 
@@ -40,7 +40,7 @@ stopGraceMusic= \sequential {
         restNumberThreshold = #1
 
        RehearsalMark \override #'font-series = #'bold
-       RehearsalMark \override #'font-relative-size = #3
+       RehearsalMark \override #'font-size = #6
 
         Beam \override #'thickness = #0.6
         Beam \override #'space-function = #(lambda (beam mult) 0.8)
index d9c33e1e758df21673f9c0c608799d6b1303368a..7d912da1bad6206077992d6234337fd4306d62c2 100644 (file)
@@ -20,5 +20,6 @@ gisis'4 gis gisis ges |
                \thenotes
        }
        >>
+\paper { raggedright = ##t }
 }
 
index 5d500fdfc0b7fb5ef5fade10cc451606dca2997d..ee0654a91468119a593f40a5d8e42435abce11ec 100644 (file)
@@ -57,4 +57,5 @@ voiceb = \notes \transpose c c' {
        >>
        \new NoteNames \apply #no-octaves \voiceb
     >>
+\paper { raggedright = ##t }
 }
index afadf3edfccb9728b7f1ad0633a236679e00f2a5..8f66fcb29bf1d8da96a06e1ce442ae49732ad017 100644 (file)
@@ -14,4 +14,5 @@ foo = \notes\relative c''   {   \key as \major dis4 dis dis!^"force" dis? }
   << \foo 
    \context NoteNames \foo
   >>
+\paper { raggedright = ##t }
 }
index a6be85879ccbb9bcf387cada3bbaa9ca942dc275..33cc264801490d7bbec3dbb1a491fd3b10f933f7 100644 (file)
@@ -1,4 +1,4 @@
-\version "1.9.8"
+\version "2.1.1"
 \header {
 texidoc ="
   Template that puts dynamics on a separate line, so it is neatly
@@ -48,7 +48,7 @@ pedal = \notes {
       \consists "Dynamic_engraver"
       \consists "Text_engraver"
 
-      TextScript \override #'font-relative-size = #1
+      TextScript \override #'font-size = #2
       TextScript \override #'font-shape = #'italic
       DynamicText \override #'extra-offset = #'(0 . 2.5)
       Hairpin \override #'extra-offset = #'(0 . 2.5)
index 9a9d6048eb29f857279650adc9fc126beabc208b..dc38f9138260a3ed73546a2388d48a1c24b144b7 100644 (file)
@@ -1,4 +1,4 @@
-\version "1.9.8"
+\version "2.1.1"
 
 \header {
  texidoc = "@cindex Bagpipe Music
index aa7f9ddbb4968955abc51a4e46b2a7ee5d93c900..f3c5bbb804bcab7203607a12689615e698716bce 100644 (file)
@@ -5,7 +5,7 @@ Bar numbers can also be printed at regular intervals.
 
 " }
 
-\version "1.9.8"
+\version "2.1.1"
 
 \score {
     \context Staff \notes \transpose  c c' {
@@ -13,7 +13,7 @@ Bar numbers can also be printed at regular intervals.
        \property Score.barNumberVisibility = #(every-nth-bar-number-visible 4)
        \property Score.BarNumber \override #'molecule-callback =
        #(make-molecule-boxer 0.1 0.25 0.25 Text_item::brew_molecule)
-       \property Score.BarNumber \override #'font-relative-size = #1
+       \property Score.BarNumber \override #'font-size = #2
        
        \repeat unfold 9 { c1 } \bar "|."
     }
index f040cd3900afb536f75095f109c09a72ad896947..346bb340baf48c3e8efd8ed948cbdc95011780fe 100644 (file)
@@ -1,4 +1,4 @@
-\version "1.9.8"
+\version "2.1.1"
 \header{
        texidoc="@cindex Cautionary Accidentals
 LilyPond can display cautionary accidentals in different ways.
@@ -6,7 +6,7 @@ LilyPond can display cautionary accidentals in different ways.
 \score { \notes \context Staff \transpose c c'' {
   \key d \major
 %  \property Staff.autoReminders = #'cautionary
-  \property Staff.Accidental \override #'font-relative-size = #0
+  \property Staff.Accidental \override #'font-size = #0
   <dis c>1 cis?2 d?
   \property Staff.Accidental \override #'cautionary-style = #'smaller
   <dis c>1 cis?2 d?
index e02ebf3d8a81f1fd7fc807adbd0790ad01bcd768..75ef37575d1f3c364d5c05f6ac3a22dff5d08ab8 100644 (file)
@@ -3,7 +3,7 @@
 texidoc = "An alternate method to make bass figures is to use
 markup texts."
 }
-\version "1.9.8"
+\version "2.1.1"
 
 nat = \markup { \musicglyph #"accidentals-0" }
 sh = \markup { \smaller \raise #0.6 \musicglyph #"accidentals-1" }
@@ -13,7 +13,7 @@ fl = \markup { \musicglyph #"accidentals--1" }
       \context Voice \notes {
          \clef bass
          \property Voice.TextScript \set #'font-family = #'number
-         \property Voice.TextScript \set #'font-relative-size = #-3
+         \property Voice.TextScript \set #'font-size = #-6
          \property Voice.TextScript \set #'baseline-skip = #1.4
          
          dis4_\markup { 6 }
index aa25efaa6e457e1d0e0549af72567503e99653b0..5cab78639a6298163c083867f4d664d81c084d8e 100644 (file)
@@ -1,6 +1,6 @@
 /*
-  engravergroup.cc -- implement Engraver_group_engraver
-
+  engraver-group-engraver.cc -- implement Engraver_group_engraver
+  
   source file of the GNU LilyPond music typesetter
 
   (c)  1997--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
@@ -32,38 +32,6 @@ Engraver_group_engraver::process_acknowledged_grobs_in_simple_children ()
     }
 }
 
-/*
-
-  Done: eliminating useless broadcast/acknowledge
-
-
-One cause for translation slowness: grob broadcasted/acknowledges
- (b/a): every grob is b/a-ed to all peer-engravers and all
-parent-engravers. This means that lots of (often) useless b/a is done
-for large scores (the top-level engravers gets to know every detail of
-every voice, thread, etc. Measurements indicate this is 10% of the
- interpretation time:
-
- standchen
-
-old: (pre 1.5.13)  10.28
-new: 8.73
-speedup: 15 %
-
-Coriolan:
-
-new: 197.59
-old: 219.12 seconds
-speedup: 10%
-
-
-The cost of this B/A is # of useless engravers * cost of one ack,
-which is rather low, since cost of one ack is only an interface check.
-The cost of precomputing engraver lists has two elts: computing the
-list itself, GC for the structure, looking up the list during the
-acks.
-
-*/
 SCM find_acknowledge_engravers (SCM gravlist, SCM meta);
 SCM find_accept_engravers (SCM gravlist, SCM music_descr);
 
@@ -190,7 +158,8 @@ ENTER_DESCRIPTION(Engraver_group_engraver,
 /*****************/
 
 
-bool engraver_valid (Translator*tr, SCM ifaces)
+bool
+engraver_valid (Translator*tr, SCM ifaces)
 {
   SCM ack_ifs = scm_assoc (ly_symbol2scm ("interfaces-acked"), tr->translator_description());
   ack_ifs = gh_cdr (ack_ifs);
index d48e60a4c050cbc195b4a55ceb40d9ea2ad9fc55..cddd1d033cfcdd28b608e89f5dbdb54ca58c3ed3 100644 (file)
@@ -57,4 +57,4 @@ Font_interface::font_alist_chain (Grob*g)
 ADD_INTERFACE (Font_interface, "font-interface",
               "Any symbol that is typeset through fixed sets of glyphs (ie. fonts)",
               "font-magnification font font-series font-shape "
-              "font-family font-name font-design-size font-relative-size");
+              "font-family font-name font-size");
index 90dcae5657067849c9ee8063c122ad0364ab01be..52933a503c960c42142ce24d9dbe7fa27ffb1840 100644 (file)
@@ -189,7 +189,7 @@ LY_DEFINE(ly_text_dimension,"ly:text-dimension", 2 , 0, 0,
   
   return gh_cons (ly_interval2scm (b[X_AXIS]), ly_interval2scm(b[Y_AXIS]));
 }
-  
+
 Molecule
 Font_metric::get_char_molecule (int code)  const
 {
index 2890b629dbe6de7a98011e6261df8b742b5cfdd5..294ba8d3fcf0559c44d6de96a34abe08d236a57f 100644 (file)
@@ -1,27 +1,17 @@
-#include "paper-def.hh"
-#include "font-interface.hh"
-#include "warn.hh"
-
-
-/*
-  TODO revise font handling.
-
+/*   
+  font-select.cc -- implement property -> font_metric routines. 
 
-* relative sizes should relate to staff-space, eg.  font-staff-space
-= 1.2 ^ relative-size
+  source file of the GNU LilyPond music typesetter
 
-* If a relative size is given, lily should magnify the closest
-design size font to match that. (ie. fonts should have variable
-scaling)
+  (c) 2003 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
-(this requires that fonts are stored as (filename , designsize))
-
-
-  
  */
 
+#include <math.h>
 
-
+#include "paper-def.hh"
+#include "font-interface.hh"
+#include "warn.hh"
 
 LY_DEFINE(ly_paper_get_font,"ly:paper-get-font", 2, 0, 0,
          (SCM paper, SCM chain),
@@ -51,22 +41,63 @@ wild_compare (SCM field_val, SCM val)
 {
   return (val == SCM_BOOL_F || field_val == ly_symbol2scm ("*") || field_val == val);
 }
+Font_metric*
+get_font_by_design_size (Paper_def* paper, Real requested,
+                        SCM font_vector)
+{
+  int n = SCM_VECTOR_LENGTH (font_vector);
+  Real size = 1e6;
+  Real last_size = -1e6;
+  int i = 0;
+  
+  for (; i < n; i++)
+    {
+      size = gh_scm2double (gh_car (SCM_VECTOR_REF (font_vector, i)));
+      if (size > requested)
+       break ;
+      last_size = size; 
+    }
+
+  if (i == n)
+    {
+      i = n-1;
+    }
+  else if (i > 0)
+    {
+      if ((requested / last_size) < (size / requested))
+       {
+         i -- ;
+         size = last_size;
+       }
+    }
+  
+  return paper->find_font (gh_cdr (SCM_VECTOR_REF (font_vector, i)),
+                          requested / size);
+}
+
+
+Font_metric*
+get_font_by_mag_step (Paper_def* paper, Real requested_step,
+                     SCM font_vector, Real default_size)
+{
+  return get_font_by_design_size (paper,
+                                 default_size * pow (2.0, requested_step / 6.0),
+                                 font_vector);
+}
+
+
 
 /*
   We can probably get more efficiency points if we preprocess FONTS
   to make lookup easier.
  */
 SCM
-properties_to_font_name (SCM fonts, SCM alist_chain)
+properties_to_font_size_family (SCM fonts, SCM alist_chain)
 {
   SCM shape = SCM_BOOL_F;
   SCM family = SCM_BOOL_F;
   SCM series = SCM_BOOL_F;
-
   
-  SCM point_sz = ly_assoc_chain (ly_symbol2scm ("font-design-size"), alist_chain);
-  SCM rel_sz = SCM_BOOL_F;
-
   shape = ly_assoc_chain (ly_symbol2scm ("font-shape"), alist_chain);
   family = ly_assoc_chain (ly_symbol2scm ("font-family"), alist_chain);
   series = ly_assoc_chain (ly_symbol2scm ("font-series"), alist_chain);
@@ -79,40 +110,28 @@ properties_to_font_name (SCM fonts, SCM alist_chain)
     series = ly_cdr (series);
 
 
-  if (gh_pair_p (point_sz))
-    point_sz = ly_cdr (point_sz);
-  else
-    {
-      rel_sz = ly_assoc_chain (ly_symbol2scm ("font-relative-size"), alist_chain);
-      if (gh_pair_p (rel_sz))
-       rel_sz = ly_cdr (rel_sz);
-    }
-
   for (SCM s = fonts ; gh_pair_p (s); s = ly_cdr (s))
     {
       SCM qlist = ly_caar (s);
 
-      if (!wild_compare (scm_list_ref (qlist, gh_int2scm (1)), series))
+      if (!wild_compare (SCM_VECTOR_REF (qlist, 0), series))
        continue;
-      if (!wild_compare (scm_list_ref (qlist, gh_int2scm (2)), shape))
+      if (!wild_compare (SCM_VECTOR_REF (qlist, 1), shape))
        continue;
-      if (!wild_compare (scm_list_ref (qlist, gh_int2scm (3)), family))
+      if (!wild_compare (SCM_VECTOR_REF (qlist, 2), family))
        continue;
   
-      if (point_sz == SCM_BOOL_F && !wild_compare (ly_car (qlist), rel_sz))
-       continue;
-          
       SCM qname = ly_cdar (s);
       return qname;
     }
 
-  warning (_ ("couldn't find any font satisfying "));
-  scm_write (scm_list_n (point_sz, shape, series , family, rel_sz,
+  warning (_ ("couldn't find any font size family satisfying "));
+  
+  scm_write (scm_list_n (shape, series , family, 
                         SCM_UNDEFINED), scm_current_error_port ());
   scm_flush (scm_current_error_port ());
  
   return scm_makfrom0str ("cmr10");
-  
 }
 
 
@@ -124,16 +143,38 @@ select_font (Paper_def *paper, SCM chain)
   if (!gh_pair_p (name) || !gh_string_p (gh_cdr (name)))
     {
       SCM fonts = paper->lookup_variable (ly_symbol2scm ("fonts"));
-      name = properties_to_font_name (fonts, chain);
+      name = properties_to_font_size_family (fonts, chain);
     }
   else
     name  = gh_cdr (name);
+
+
+  if (gh_string_p (name))
+    {
+      SCM mag = ly_assoc_chain (ly_symbol2scm ("font-magnification"), chain);
   
-  SCM mag = ly_assoc_chain (ly_symbol2scm ("font-magnification"), chain);
-  
-  Real rmag = gh_pair_p (mag) && gh_number_p (gh_cdr (mag))
-    ? gh_scm2double (gh_cdr (mag)) : 1.0;
+      Real rmag = gh_pair_p (mag) && gh_number_p (gh_cdr (mag))
+       ? gh_scm2double (gh_cdr (mag)) : 1.0;
   
-  Font_metric *fm = paper->find_font (name, rmag);
-  return fm;
+      return paper->find_font (name, rmag);
+    }
+  else if (gh_pair_p (name)) // (DEFAULT . FONT-VEC) pair
+    {
+      SCM vec = gh_cdr (name);
+      SCM base_size = gh_car (name);
+      
+      SCM font_size = ly_assoc_chain (ly_symbol2scm ("font-size"), chain);
+      Real req = 0.0;
+      if (gh_pair_p (font_size))
+       req = gh_scm2double (ly_cdr (font_size));
+
+      return get_font_by_mag_step (paper, req,
+                                  vec, gh_scm2double (base_size));
+    }
+
+  assert (0);
+
+  return 0;
 }
+
+
index f04842e158ac2e337965aa2d3fab3d6cacdeaebd..369f1ca5bcd3294bcd1f0d79746778648cc526f7 100644 (file)
@@ -1,5 +1,5 @@
 /*   
-  font-size-engraver.cc --  implement 
+  font-size-engraver.cc --  implement Font_size_engraver
   
   source file of the GNU LilyPond music typesetter
   
@@ -36,9 +36,9 @@ Font_size_engraver::acknowledge_grob (Grob_info gi)
 
   if (gh_number_p (sz)
       && gh_scm2double (sz)
-      && !gh_number_p (gi.grob_->get_grob_property ("font-relative-size")))
+      && !gh_number_p (gi.grob_->get_grob_property ("font-size")))
     {
-      gi.grob_->set_grob_property ("font-relative-size", sz);
+      gi.grob_->set_grob_property ("font-size", sz);
     }
 }
 
index 95242400b985df68303e13c6ebd482c83b15d52e..22c4622f17002f9e0e43fa2b142e75ec66028e2d 100644 (file)
@@ -21,13 +21,13 @@ public:
   Sources sources_;
   Array<String> inclusion_names_;
   Array<String> target_strings_;
-  Link_array<Score> scores_;
   Protected_scm header_;
 
-  void do_deps ();
-  void do_scores ();
+  int score_count_;
+  
+  void do_deps (String);
 
-  Input_file_results (String file, String init);
+  Input_file_results (String init, String in, String out);
   ~Input_file_results ();
   
 private:
@@ -37,7 +37,7 @@ private:
 
 extern Input_file_results* global_input_file;
 
-void do_one_file (String init_string, String file_string);
+void do_one_file (String init_string, String in_file, String out_file);
 
 
 #endif /* FILE_RESULTS_HH */
index 5af2ab0176f554ff6b0123e8150419f6bb96d3ca..f0c82421f2876e13195ccf17d1a4f3b2884b5085 100644 (file)
@@ -37,6 +37,7 @@
 
 #include "drul-array.hh"
 
+
 /* Guile 1.4.x compatibility */
 #if GUILE_MINOR_VERSION < 5
 
@@ -80,6 +81,9 @@ inline SCM scm_c_make_vector  (int k, SCM val) {
 #if GUILE_MINOR_VERSION < 7
 #define scm_gc_unregister_collectable_memory(a,b,c) scm_done_free(b)
 #define scm_gc_register_collectable_memory(a,b,c) scm_done_malloc(b)
+#define SCM_VECTOR_REF(v,i) (SCM_VELTS((v))[(i)])
+
+
 #endif
 
 #include "direction.hh"
@@ -220,8 +224,6 @@ unsigned int ly_scm_hash (SCM s);
 SCM index_get_cell (SCM cell, Direction d);
 SCM index_set_cell (SCM cell, Direction d, SCM val);
 
-
-
 SCM ly_snoc (SCM s, SCM list);
 SCM ly_split_list (SCM s, SCM list);
 SCM ly_unique (SCM list);
@@ -233,8 +235,9 @@ SCM ly_unique (SCM list);
  */
 void add_scm_init_func (void (*) ());
 
-
+extern "C" {
 typedef SCM (*Scheme_function_unknown) ();
+}
 
 #if __GNUC__ > 2 || __GNUC_MINOR__ >= 96
 typedef SCM (*Scheme_function_0) ();
index 1434afab8a07669c30a7c73bef254543e431b77d..c39510624f7880a81fc9f943a2c01deae245cfcc 100644 (file)
@@ -29,8 +29,6 @@ public:
 
   int get_tempo (Moment moment);
   void set_tempo (Moment moment, int count_per_minute_i);
-  virtual int get_next_score_count () const;
-  static void reset_score_count ();
 };
 
 #endif // MIDI_DEF_HH
index cdfa93e9392db8f3e4f37624a9ccdebd0b937a30..c923fcab3689246b059d3b7bf94c757efc8d67b7 100644 (file)
@@ -30,7 +30,6 @@ public:
   VIRTUAL_COPY_CONS (Music_output_def);
   Music_output_def (Music_output_def const&);
   Music_output_def ();
-  virtual int get_next_score_count () const;
 
   Global_translator *get_global_translator ();
   Translator_group *get_group_translator (String type) const;
index ace7b0dae842acf438277f0e1570370d67f041fb..c77ae58069122e4e04b604b3e98623e09239eabe 100644 (file)
@@ -21,15 +21,11 @@ class Music_output
 {
 public:
   Protected_scm header_;
-  String default_out_string_;
-  String origin_string_;
-  int errorlevel_;
 
-  virtual void process () {} 
+  virtual void process (String) {} 
   virtual ~Music_output (){}
   Music_output () 
   {
-    errorlevel_ = 0;
   }
        
 };
index b548b4a23b88c0d275ce2aa613e7ff69384688a6..e50fd7273c8a295460f8c67620ba4fc0c51cdf6b 100644 (file)
@@ -29,7 +29,7 @@ class My_lily_lexer : public Includable_lexer
 {
   Protected_scm scopes_;
 public:
-  String main_input_string_;
+  String main_input_name_;
   void * lexval;
   bool main_input_b_;
 
index 7f8534b5ba29d21c06c6689ba014f77b16061d79..730b95dde0449b60a55180a75d25fc699a761b09 100644 (file)
@@ -34,11 +34,12 @@ public:
   ~My_lily_parser ();
 
   void do_init_file ();
-  void parse_file ( String init_string, String file_string);
+  void parse_file (String init, String file, String out_name);
 
 public:
   Duration default_duration_;
-
+  String output_basename_;
+  
   Scheme_hash_table *default_header_;
 
   int fatal_error_;
index c177436ec8ae06727620df1743b4aeca00509651..ad898a679f4571c96c6ef4745ba1625551148c30 100644 (file)
@@ -49,7 +49,7 @@ protected:
   VIRTUAL_COPY_CONS (Music_output_def);
 
 public:    
-  Paper_outputter* get_paper_outputter (;
+  Paper_outputter* get_paper_outputter (String)  const;
 
   SCM font_descriptions ()const;
   virtual ~Paper_def ();
@@ -66,8 +66,6 @@ public:
 
   Interval line_dimensions_int (int) const;
 
-  virtual int get_next_score_count () const;
-  static void reset_score_count ();
   void output_settings (Paper_outputter*) const;
 
   Font_metric * find_font (SCM name, Real mag);
index b7d500c8d6aac568ab4bf820fd87024bc71bd8da..6098856c58218619b97fcc46930d91c7361cf392 100644 (file)
@@ -27,8 +27,6 @@
 class Paper_outputter
 {
   bool verbatim_scheme_b_;
-
-  
 public:
 
   SCM output_func_ ;
index 5310e2ac086a5bccd8292c56764541ae727b4b1d..831f913e3ebbe2cc2f003b6368144ca3a7949c1d 100644 (file)
@@ -42,7 +42,7 @@ public:
     
 protected:
     /* MAIN ROUTINES */
-  virtual void process ();
+  virtual void process (String);
 
 private:
   /// before calc_breaking
index 2976e11c58633ef21966942209d69f43594479a0..a98133fc1e9be9e4ae7a6b12f0ec766e5b93272e 100644 (file)
@@ -27,7 +27,7 @@ public:
   void output_header_track (Midi_stream& midi_stream_r);
 
   void print () const;
-  void process ();
+  void process (String);
 
   Link_array<Audio_staff> audio_staffs_;
   Cons<Audio_element> *audio_elem_p_list_;
index 38e7d8b9345168533e3ce57cbe50233c83af84e1..8a50481cc3f00fef1496015864daf288a5657380 100644 (file)
 #include "parray.hh"
 #include "smobs.hh"
 
-/// the total music def of one movement
-class Score: public Input {
+class Score : public Input
+{
 public:
-  /// paper_, staves_ and commands_ form the problem definition.
   Link_array<Music_output_def> defs_;
   SCM music_;
   SCM header_;
-  Input_file_results* input_file_;
-  
-  int errorlevel_;
     
-  /// construction
   Score ();
   Score (Score const&);
-
-
-  void process ();
-  void add_output (Music_output_def *def);
   DECLARE_SMOBS (Score,foo);
 private:
-  void run_translator (Music_output_def*);
 };
 DECLARE_UNSMOB(Score,score); 
+
+
+SCM ly_run_translator (SCM, SCM);
+SCM ly_render_output (SCM, SCM, SCM);
+void default_rendering (SCM,SCM,SCM,SCM);
 #endif
index f92671aa6c6368fb9d47dbe413ae01533eb5ffa2..ef55dee50cdb0719066000af6ceafdda02b3757f 100644 (file)
@@ -32,6 +32,8 @@
 #include "scm-hash.hh"
 #include "ly-modules.hh"
 
+bool store_locations_global_b;
+
 
 /*
   no ! suffix since it doesn't modify 1st argument.
@@ -98,11 +100,11 @@ write_dependency_file (String fn,
 
 
 void
-Input_file_results::do_deps ()
+Input_file_results::do_deps (String output)
 {
   if (dependency_global_b)
     {
-      Path p = split_path (output_name_global);
+      Path p = split_path (output);
       p.ext = "dep";
       write_dependency_file (p.to_string (),
                             target_strings_,
@@ -110,37 +112,8 @@ Input_file_results::do_deps ()
     }
 }
 
-
-void
-Input_file_results::do_scores ()
-{
-  if (header_ == SCM_EOL)
-    header_ = ly_make_anonymous_module ();
-
-  for (int i=0; i < scores_.size (); i++)
-    {
-      Score* is = scores_[i];
-      is->input_file_ = this;
-      
-      if (is->errorlevel_)
-       {
-         is->warning (_ ("Score contains errors; will not process it"));
-         exit_status_global |= 1;
-       }
-      else
-       {
-         is->process ();
-       }
-    }
-  do_deps ();
-}
-
 Input_file_results::~Input_file_results ()
 {
-  for (int i=0; i < scores_.size (); i++)
-    scm_gc_unprotect_object (scores_[i]->self_scm ());
-  scores_.clear ();
-  
   inclusion_names_.clear ();
   if (header_)
     header_ = SCM_EOL;
@@ -154,43 +127,45 @@ Input_file_results::~Input_file_results ()
 
 Input_file_results* global_input_file;
 
-Input_file_results::Input_file_results (String init_string, String file_string)
+Input_file_results::Input_file_results (String init, String in_file, String out_file)
 {
-  header_ = SCM_EOL;
+  header_ = ly_make_anonymous_module ();
   global_input_file = this;
-  
+  score_count_ = 0;
   sources_.set_path (&global_path);
   
-  My_lily_parser parser (this);
 
-  progress_indication (_f ("Now processing: `%s'", file_string.to_str0 ()));
+  progress_indication (_f ("Now processing: `%s'", in_file.to_str0 ()));
   progress_indication ("\n");
-  parser.parse_file (init_string, file_string);
+
+  My_lily_parser parser (this);
+  parser.parse_file (init, in_file, out_file);
   
   if (parser.error_level_)
     {
       exit_status_global  = 1;
     }
-  else
-    do_scores ();
+
   
+  do_deps (out_file);
 }
 
 
 void
-do_one_file (String init_string, String file_string
+do_one_file (String init, String in_file, String out_file
 {
-   if (init_string.length () && global_path.find (init_string).empty_b ())
+  if (init.length () && global_path.find (init).empty_b ())
     {
-      warning (_f ("can't find file: `%s'", init_string));
+      warning (_f ("can't find file: `%s'", init));
       warning (_f ("(search path: `%s')", global_path.to_string ().to_str0 ()));
       return;
     }
-  if ((file_string != "-") && global_path.find (file_string).empty_b ())
+
+  if ((in_file != "-") && global_path.find (in_file).empty_b ())
     {
-      warning (_f ("can't find file: `%s'", file_string));
+      warning (_f ("can't find file: `%s'", in_file));
       return;
     }
 
-  Input_file_results inp_file(init_string, file_string);
+  Input_file_results inp_file (init, in_file, out_file);
 }
index a91937a2ff152f4664cf7c84755dec99315780ec..3c9fe9079b1b1ac18e74a1a66613808954d2aa53 100644 (file)
@@ -13,7 +13,7 @@
 #include <stdlib.h>
 #include <math.h>   /* isinf */
 #include <string.h> /* strdup, strchr */
-
+#include <ctype.h>
 
 #include "lily-proto.hh"
 
index 6ea0664d18d9fa0f6d7e1a1ab8047bd1a18a4400..44e2acf6225a9a0d14e0acbd3d9ff6e07473d051 100644 (file)
@@ -292,15 +292,6 @@ distill_inname (String str)
   return p;
 }
 
-String
-format_to_ext (String format)
-{
-  if (format == "tex")
-    /* .lytex change put off */
-    return "tex"; // "lytex";
-  return format;
-}
-
 void
 prepend_load_path (String dir)
 {
@@ -353,15 +344,12 @@ main_prog (void *, int, char **)
   do
     {
       String infile (arg);
-      Midi_def::reset_score_count ();
-      Paper_def::reset_score_count ();
-
       Path inpath = distill_inname (infile);
 
       /* By default, use base name of input file for output file name */
       Path outpath = inpath;
       if (inpath.to_string () != "-")
-       outpath.ext = format_to_ext (output_format_global);
+       outpath.ext = output_format_global;
 
       /* By default, write output to cwd; do not copy directory part
          of input file name */
@@ -377,11 +365,7 @@ main_prog (void *, int, char **)
       else
        init = "init.ly";
        
-      /* Burp: output name communication goes through _global */
-      String save_output_name_global = output_name_global;
-      output_name_global = outpath.to_string ();
-      do_one_file (init, inpath.to_string ());
-      output_name_global = save_output_name_global;
+      do_one_file (init, inpath.to_string (), outpath.to_string ());
       
       p++;
     } while ((arg  = oparser_p_static->get_next_arg ()));
@@ -437,7 +421,8 @@ main (int argc, char **argv)
            String s = oparser_p_static->optional_argument_str0_;
            Path p = split_path (s);
            if (s != "-" && p.ext.empty_b ())
-             p.ext = format_to_ext (output_format_global);
+             p.ext = output_format_global;
+
            output_name_global = p.to_string ();
          }
          break;
@@ -452,8 +437,11 @@ main (int argc, char **argv)
        case 'f':
          if (oparser_p_static->optional_argument_str0_ == "help")
            {
-             printf("See http://lilypond.org/wiki?OutputFormats for more information.\n"\
-                    "This option is for developers only.\n");
+             printf("This option is for developers only;  Read the source code for more information\n");
+             
+             // actually it's not here,
+             // but we award you special points for looking here.
+             
              exit (0);
            }
          output_format_global = oparser_p_static->optional_argument_str0_;
index 0d875ba8c11a30ecc8a048770ae239e635ee62a6..003ec782f611b6659eeb52f1ad589d55f0b94f0e 100644 (file)
@@ -61,8 +61,9 @@ Mark_engraver::acknowledge_grob (Grob_info inf)
   if (text_ && Bar_line::has_interface (s))
     {
       /*
-       Ugh. Figure out how to do this right at beginning of line, (without
-       creating class Bar_script : public Item).
+      TODO: make this configurable. RehearsalMark cannot be
+      break-aligned, since the width of the object should not be taken
+      into alignment considerations.
       */
       text_->set_parent (s, X_AXIS);
     }
index ec5428971ac23ca635d8a11d7407d451a0fbf5b1..e42f2dce6e4e7c3fab47266dd8cb937566fda09b 100644 (file)
@@ -49,17 +49,3 @@ Midi_def::set_tempo (Moment one_beat_mom, int beats_per_minute_i)
   set_variable (ly_symbol2scm ("whole-in-seconds"), m.smobbed_copy ());
 }
 
-
-int Midi_def::score_count_=0;
-
-int
-Midi_def::get_next_score_count () const
-{
-  return score_count_++;
-}
-
-void
-Midi_def::reset_score_count ()
-{
-  score_count_ = 0;
-}
index 1f834889f4a537ca6eabe3d44cd61d1f364f767e..bf037321195be66c246625e156be444083bf2e77 100644 (file)
 
 #include "ly-smobs.icc"
 
-int
-Music_output_def::get_next_score_count () const
-{
-  return 0;
-}
-
 Music_output_def::Music_output_def ()
 {
   scaled_fonts_ = SCM_EOL;
@@ -36,6 +30,8 @@ Music_output_def::Music_output_def ()
   scope_ =   ly_make_anonymous_module();
 }
 
+
+
 Music_output_def::~Music_output_def ()
 {
 }
@@ -118,24 +114,6 @@ Music_output_def::print_smob (SCM s, SCM p, scm_print_state *)
   return 1;
 }
 
-/*
-  ugh: should move into Music_output_def (complication: .midi and .tex
-  need separate counts.)  */
-String
-Music_output_def::outname_string () 
-{
-  String out = output_name_global;
-  int def = get_next_score_count ();
-  if (def && out != "-")
-    {
-      Path p = split_path (out);
-      p.base += "-" + to_string (def);
-      out = p.to_string ();
-    }
-  return out;
-}
-
-
 
 SCM
 Music_output_def::get_scmvar (String s) const
@@ -158,7 +136,6 @@ Music_output_def::lookup_variable (SCM sym) const
   return scm_variable_ref (var);
 }
 
-
 LY_DEFINE(ly_paper_lookup,
          "ly:paper-lookup",
          2, 0,0,
index 7e6fe2b14fec55a2e17421c447b61111727d6eed..e147eaa86f4e2daef67e20bac458c2a41d85b041 100644 (file)
@@ -215,8 +215,6 @@ Music::internal_set_mus_property (SCM s, SCM v)
   mutable_property_alist_ =  scm_assq_set_x (mutable_property_alist_, s, v);
 }
 
-
-
 #include "main.hh"
 
 void
@@ -238,8 +236,8 @@ Music::~Music ()
   
 }
 
-LY_DEFINE(ly_get_music_length,
-         "ly:get-music-length", 1, 0, 0,  (SCM mus),
+LY_DEFINE(ly_music_length,
+         "ly:music-length", 1, 0, 0,  (SCM mus),
          "Get the length (in musical time) of music expression @var{mus}.")
 {
   Music * sc = unsmob_music (mus);
@@ -250,8 +248,7 @@ LY_DEFINE(ly_get_music_length,
 LY_DEFINE(ly_get_mus_property,
          "ly:get-mus-property", 2, 0, 0,  (SCM mus, SCM sym),
          "Get the property @var{sym} of music expression @var{mus}.\n"
-         "If @var{sym} is undefined, return @code{'()}.\n"
-         )
+         "If @var{sym} is undefined, return @code{'()}.\n" )
 {
   Music * sc = unsmob_music (mus);
   SCM_ASSERT_TYPE(sc, mus, SCM_ARG1, __FUNCTION__, "music");
@@ -395,3 +392,4 @@ make_music_by_name (SCM sym)
   scm_gc_protect_object (rv);
   return unsmob_music (rv);
 }
+
index bd57eb0899ddb7e365d0d8f27d9ef4fabf7d1cd1..07ab9374a63c0067188cc747a42984de1387348e 100644 (file)
@@ -161,12 +161,12 @@ My_lily_lexer::lookup_identifier (String s)
 void
 My_lily_lexer::start_main_input ()
 {  
-  new_input (main_input_string_, &global_input_file->sources_);
+  new_input (main_input_name_, &global_input_file->sources_);
   allow_includes_b_ = allow_includes_b_ &&  ! (safe_global_b);
 
   scm_module_define (gh_car (scopes_),
                     ly_symbol2scm ("input-file-name"),
-                    scm_makfrom0str (main_input_string_.to_str0()));
+                    scm_makfrom0str (main_input_name_.to_str0()));
 }
 
 void
index b912dc4b512d281a6dd95ac35ec116fee1ab3831..86d7bc3fa95059aeb33707e0be5f99ce14b657c7 100644 (file)
@@ -35,11 +35,12 @@ My_lily_parser::~My_lily_parser ()
 
 
 void
-My_lily_parser::parse_file (String init, String s)
+My_lily_parser::parse_file (String init, String in_file, String out_file)
 {
   lexer_ = new My_lily_lexer;
-
-  lexer_->main_input_string_ = s;
+  output_basename_ = out_file;
+  
+  lexer_->main_input_name_ = in_file;
 
   progress_indication (_ ("Parsing..."));
 
index 4d59d1f763b464eafebef2dd5640672f36409d3c..a784bfab15c72945522f9d061be1032a235fd52d 100644 (file)
@@ -67,25 +67,11 @@ Paper_def::line_dimensions_int (int n) const
 }
 
 
-int Paper_def::score_count_ = 0;
-
-int
-Paper_def::get_next_score_count () const
-{
-  return score_count_ ++;
-}
-
-void
-Paper_def::reset_score_count ()
-{
-  score_count_ = 0;
-}
 
 
 Paper_outputter*
-Paper_def::get_paper_outputter (
+Paper_def::get_paper_outputter (String outname)  const
 {
-  String outname = outname_string (); 
   progress_indication (_f ("paper output to `%s'...",
                           outname == "-" ? String ("<stdout>") : outname));
 
index d6af7039ca25057404be5f68968f862cec2bbe06..5feda5abf9a8c2ebcf2446dc88b8d6999e851ce7 100644 (file)
@@ -72,7 +72,7 @@ Paper_score::calc_breaking ()
   urg. clean me
  */
 void
-Paper_score::process ()
+Paper_score::process (String outname)
 {
   if (verbose_global_b)
     progress_indication (_f ("Element count %d (spanners %d) ",
@@ -95,7 +95,7 @@ Paper_score::process ()
   Array<Column_x_positions> breaking = calc_breaking ();
   system_->break_into_pieces (breaking);
   
-  outputter_ = paper_->get_paper_outputter ();
+  outputter_ = paper_->get_paper_outputter (outname);
   outputter_->output_header ();
   outputter_->output_version ();
 
@@ -112,10 +112,13 @@ Paper_score::process ()
       outputter_->output_scope (header_, "lilypond");
       outputter_->write_header_fields_to_file (header_);
     }
-  
+
+#if 0
+  // todo: transport origin_string_ in header.
   outputter_->output_comment (_ ("Outputting Score, defined at: "));
   outputter_->output_comment (origin_string_);
-
+#endif
+  
   outputter_->output_scope (paper_->scope_, "lilypondpaper");
 
   SCM scm = scm_list_n (ly_symbol2scm ("header-end"), SCM_UNDEFINED);
index ee022a618511671e0ee5e9b8629e10f845e4ef70..640eb3881977c50694e3b3f2444c71e9e276c68c 100644 (file)
@@ -53,7 +53,6 @@ TODO:
 */
 
 #include <ctype.h>
-#include <stdio.h>
 #include <stdlib.h>
 #include <stdio.h>
 
@@ -83,7 +82,6 @@ TODO:
 #include "text-item.hh"
 #include "music-list.hh"
 
-
 #define MY_MAKE_MUSIC(x)  make_music_by_name (ly_symbol2scm (x))
 
 
@@ -429,7 +427,36 @@ toplevel_expression:
                THIS->input_file_->header_ = $1;
        }
        | score_block {
-               THIS->input_file_->scores_.push ($1);
+               Score * sc = $1;
+
+               SCM head = ly_module_p (sc->header_) ? sc->header_ : THIS->input_file_->header_.to_SCM ();
+
+               Path p = split_path (THIS->output_basename_);
+               int *c =  &THIS->input_file_->score_count_;
+               if (*c)
+                       {
+                       p.base += "-" + to_string (*c);
+                       }
+
+               (*c)++;
+               SCM outname = scm_makfrom0str (p.to_string ().to_str0());
+
+               for (int i=0; i < sc->defs_.size (); i++)
+                       default_rendering (sc->music_, sc->defs_[i]->self_scm(),head, outname);
+
+               if (sc->defs_.empty ())
+               {
+                  Music_output_def *id =
+                       unsmob_music_output_def (THIS->lexer_->lookup_identifier
+                               ("$defaultpaper"));
+
+                  id = id ? id->clone () : new Paper_def;
+       
+                  default_rendering (sc->music_, id->self_scm(), head, outname);
+                                               
+                  scm_gc_unprotect_object (id->self_scm ());
+               }
+               scm_gc_unprotect_object (sc->self_scm());
        }
        | output_def {
                if (dynamic_cast<Paper_def*> ($1))
@@ -559,15 +586,16 @@ translator_spec_block:
        ;
 
 translator_spec_body:
-       TRANSLATOR_IDENTIFIER   {
+       /**/ {
+               $$ = Translator_def::make_scm ();
+               unsmob_translator_def ($$)->set_spot (THIS->here_input ());
+       }
+       | TRANSLATOR_IDENTIFIER {
                $$ = $1;
                unsmob_translator_def ($$)-> set_spot (THIS->here_input ());
        }
-       | TYPE STRING   {
-               $$ = Translator_def::make_scm ();
-               Translator_def*td =  unsmob_translator_def ($$);
-               td->translator_group_type_ = $2;
-               td->set_spot (THIS->here_input ());
+       | translator_spec_body TYPE STRING      {
+               unsmob_translator_def ($$)->translator_group_type_ = $3;
        }
        | translator_spec_body DESCRIPTION string  {
                unsmob_translator_def ($$)->description_ = $3;
@@ -627,12 +655,7 @@ score_block:
        /*cont*/ '{' score_body '}'     {
                THIS->pop_spot ();
                $$ = $4;
-               if (!$$->defs_.size ())
-               {
-                 Music_output_def *id =
-                       unsmob_music_output_def (THIS->lexer_->lookup_identifier ("$defaultpaper"));
-                 $$->add_output (id ? id->clone () :  new Paper_def );
-               }
+
        }
        ;
 
@@ -661,7 +684,7 @@ score_body:
                $$->header_ = $2;
        }
        | score_body output_def {
-               $$->add_output ($2);
+               $$->defs_.push ($2);
        }
        | score_body error {
 
index 23be820ad001b5ee3d5a5726894d552619bfde70..740465d290b089b68ad67611ef22d42e9408f0bc 100644 (file)
@@ -110,8 +110,9 @@ Performance::output_header_track (Midi_stream& midi_stream)
   Midi_text at (&at_a);
   midi_track.add (Moment (0), &at);
 
-  
-  str = _f ("from musical definition: %s", origin_string_);
+
+  // TODO:
+  //  str = _f ("from musical definition: %s", origin_string_);
 
   Audio_text from_a (Audio_text::TEXT, str);
   Midi_text from (&from_a);
@@ -147,19 +148,11 @@ Performance::add_element (Audio_element *p)
 
 
 void
-Performance::process ()
+Performance::process (String out)
 {
-  String out = output_name_global;
   if (out == "-")
     out = "lelie.midi";
-  int def = midi_->get_next_score_count ();
-  if (def)
-    {
-      Path p = split_path (out);
-      p.base += "-" + to_string (def);
-      out = p.to_string ();
-    }
-
+  
   /* Maybe a bit crude, but we had this before */
   Path p = split_path (out);
   p.ext = "midi";
index 67a877306ed6d06c63730f8a58f6a5c4e3e71bcf..cb993f4bab896f574bf674d556bb4a3328f2fd5e 100644 (file)
@@ -144,7 +144,6 @@ Piano_pedal_engraver::acknowledge_grob (Grob_info info)
          if (p->line_spanner_)
            {
              Side_position_interface::add_support (p->line_spanner_, info.grob_);
-             
              add_bound_item (p->line_spanner_,info.grob_);
            }     
          if (p->bracket_)
@@ -404,10 +403,22 @@ Piano_pedal_engraver::create_bracket_grobs (Pedal_info *p, bool mixed)
            p->bracket_->set_grob_property ("pedal-text", p->item_->self_scm ());
        }
 
-      p->bracket_->set_bound (LEFT, unsmob_grob (get_property ("currentMusicalColumn")));
-      Axis_group_interface::add_element (p->line_spanner_, p->bracket_);             
 
-      add_bound_item (p->line_spanner_, p->bracket_->get_bound (LEFT));
+      /*
+       We do not use currentMusicalColumn for the left span-point.
+       If the column as accidentals (eg on a different stave), the
+       currentMusicalColumn is too wide, making the bracket too big.
+
+       TODO:
+
+       Hmm. What do we do when there are no notes when the spanner starts?
+
+       TODO:
+
+       what about the right span point?
+       
+       */
+      Axis_group_interface::add_element (p->line_spanner_, p->bracket_);             
       announce_grob (p->bracket_, p->event_drul_[START]->self_scm ());
 
       if (!p->event_drul_[STOP])
diff --git a/lily/recording-group-engraver.cc b/lily/recording-group-engraver.cc
new file mode 100644 (file)
index 0000000..615992d
--- /dev/null
@@ -0,0 +1,91 @@
+/*   
+  recording-group-engraver.cc -- implement Recording_group_engraver
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 2003 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ */
+
+#include "engraver-group-engraver.hh"
+#include "protected-scm.hh"
+
+class Recording_group_engraver : public Engraver_group_engraver
+{
+public:
+  TRANSLATOR_DECLARATIONS(Recording_group_engraver);
+  virtual bool try_music (Music *m);
+  virtual void start_translation_timestep ();
+  virtual void stop_translation_timestep ();
+  virtual void finalize ();
+  virtual void initialize ();
+  Protected_scm accumulator_;
+};
+
+void
+Recording_group_engraver::initialize ()
+{
+  Engraver_group_engraver::initialize ();
+  accumulator_ = gh_cons (SCM_EOL, SCM_EOL);
+}
+
+Recording_group_engraver::Recording_group_engraver()
+{
+}
+
+void
+Recording_group_engraver::start_translation_timestep ()
+{
+  Engraver_group_engraver::start_translation_timestep();
+  
+  scm_set_car_x (accumulator_, gh_cons (now_mom ().smobbed_copy (), SCM_EOL));
+}
+
+void
+Recording_group_engraver::stop_translation_timestep ()
+{
+  Engraver_group_engraver::stop_translation_timestep();
+  scm_set_cdr_x (accumulator_, gh_cons (gh_car (accumulator_), gh_cdr (accumulator_)));
+
+  scm_set_car_x (accumulator_, SCM_EOL);
+}
+
+void
+Recording_group_engraver::finalize ()
+{
+  Engraver_group_engraver::finalize ();
+  SCM proc = get_property ("recordEventSequence");
+
+  if (gh_procedure_p (proc))
+    scm_call_2  (proc, daddy_trans_->self_scm(), gh_cdr (accumulator_));
+
+  accumulator_ = SCM_EOL;
+}
+
+bool
+Recording_group_engraver::try_music (Music  *m)
+{
+  bool here_success = Translator_group::try_music_on_nongroup_children (m);
+  bool retval = here_success;
+  if (!here_success && daddy_trans_)
+    retval = daddy_trans_->try_music (m);
+      
+  SCM seq = gh_cdar (accumulator_);
+  seq = gh_cons (gh_cons  (m->self_scm(), gh_bool2scm (here_success)),
+                seq);
+  
+  scm_set_cdr_x  (gh_car (accumulator_), seq);
+
+  return retval;
+}
+
+
+ENTER_DESCRIPTION(Recording_group_engraver,
+                 "Engraver_group_engraver that records all music events "
+                 "for this context. Calls the procedure "
+                 "in @code{recordEventSequence} when finished.",
+                 "",
+                 "",
+                 "",
+                 "recordEventSequence",
+                 "");
index 39f3094356b17f8ca6f94fc65977b35a50d53d35..de3deb00051dc9463fe2c0259324b7356d59e7ce 100644 (file)
@@ -98,7 +98,7 @@ LY_DEFINE (ly_set_option, "ly:set-option", 1, 1, 0, (SCM var, SCM val),
 "@end table\n"
 "\n"
 "This function is useful to call from the command line: @code{lilypond -e\n"
-"\"(ly-set-option 'midi-debug #t_)\"}.\n")
+"\"(ly-set-option 'midi-debug #t)\"}.\n")
 {
   if (val == SCM_UNDEFINED)
     val = SCM_BOOL_T;
index d19bf5dd91861990541035de24c80603a8787981..d7e740850f6e7fd3aee0154f434a656a7f7a6630 100644 (file)
@@ -84,7 +84,7 @@ Score_engraver::finish ()
     progress_indication ("[" + to_string (breaks_) + "]");
    
   check_removal ();
-  removal_processing ();
+  finalize ();
 
 }
 
index ee48102cbb79f47d39c853e36ae4a5ee6ddae130..0cb5d00a8bc449e5fadcad2a720e0a0cb32ade87 100644 (file)
@@ -98,7 +98,7 @@ void
 Score_performer::finish ()
 {
   check_removal ();
-  removal_processing ();
+  finalize ();
 }
 
 Music_output *
index 04e09684e38b068480a483a9fc2d277fc6121371..7da39afce45a189b2b70d8154868169b752bf7d8 100644 (file)
 Score::Score ()
   : Input ()
 {
-  input_file_ = 0;
   header_ = SCM_EOL;
   music_ = SCM_EOL;
-  errorlevel_ = 0;
 
   smobify_self ();
 }
 
+Score::~Score ()
+{
+  
+}
+
+
+
+
+IMPLEMENT_SMOBS (Score);
+IMPLEMENT_DEFAULT_EQUAL_P (Score);
+
+
+SCM
+Score::mark_smob (SCM s)
+{
+  Score * sc = (Score*) SCM_CELL_WORD_1 (s);
+
+  if (sc->header_)
+    scm_gc_mark (sc->header_);
+  for (int i = sc->defs_.size (); i--;)
+    scm_gc_mark (sc->defs_[i]->self_scm ());
+  
+  return sc->music_;
+}
+
+int
+Score::print_smob (SCM , SCM p, scm_print_state*)
+{
+  scm_puts ("#<Score>", p);
+
+  return 1;
+}
+
+
+
 /*
   store point & click locations.
   Global to save some time. (Sue us!)
  */
-bool store_locations_global_b;
 
 Score::Score (Score const &s)
   : Input (s)
@@ -58,32 +90,35 @@ Score::Score (Score const &s)
   
   for (int i=0; i < s.defs_.size (); i++)
     defs_.push (s.defs_[i]->clone ());
-  errorlevel_ = s.errorlevel_;
 
   header_ = ly_make_anonymous_module ();
   if (ly_module_p (s.header_))
     ly_copy_module_variables (header_, s.header_);
 }
 
-Score::~Score ()
-{
-  
-}
-
 
 
-void
-Score::run_translator (Music_output_def *odef)
+LY_DEFINE(ly_run_translator, "ly:run-translator", 
+         2, 0, 0,
+         (SCM mus, SCM output_def),
+         "Process @var{mus} according to @var{output_def}. A interpretation "
+"context is set up, and @var{mus} is interpreted with it. The  "
+"context is returned in its final state." )
 {
+  Music_output_def *odef = unsmob_music_output_def (output_def);
+  Music * music = unsmob_music (mus);
+
+  SCM_ASSERT_TYPE (music, mus, SCM_ARG1, __FUNCTION__, "Music");
+  SCM_ASSERT_TYPE (odef, output_def, SCM_ARG2, __FUNCTION__, "Output definition");
+  
   Cpu_timer timer;
   Global_translator * trans = odef->get_global_translator ();
   if (!trans)
     {
       programming_error ("no toplevel translator");
-      return ;
+      return SCM_BOOL_F;
     }
   progress_indication (_ ("Interpreting music..."));
-  Music * music = unsmob_music (music_);
   
   trans->final_mom_ = music->get_length ();
   SCM protected_iter =  Music_iterator::get_static_get_iterator (music);
@@ -95,8 +130,7 @@ Score::run_translator (Music_output_def *odef)
   if (! iter->ok ())
     {
       warning (_ ("Need music in a score"));
-      errorlevel_ =1;
-      return ;
+      return SCM_BOOL_F;       // todo: shoudl throw exception.
     }
 
   trans->start ();
@@ -105,73 +139,48 @@ Score::run_translator (Music_output_def *odef)
   scm_remember_upto_here_1 (protected_iter);
   trans->finish ();
 
-  if (errorlevel_)
-    {
-      // should we? hampers debugging.
-      warning (_ ("errors found."));
-    }
-
-  Music_output * output = trans->get_output ();
-  scm_gc_unprotect_object (trans->self_scm ());
-  
   if (verbose_global_b)
     progress_indication (_f ("elapsed time: %.2f seconds",  timer.read ()));
 
-  if (!header_)
-    header_ = ly_make_anonymous_module(); // ug.h
-
-  output->header_ = header_;
-  output->origin_string_ =  location_string ();
-
-  progress_indication ("\n");
-  output->process ();
   
-  delete output ;
+  return scm_gc_unprotect_object (trans->self_scm ());
 }
 
-void
-Score::process ()
-{
-  if (!unsmob_music (music_))
-    return;
 
-  for (int i=0; i < defs_.size (); i++)
-    {
-      if (no_paper_global_b 
-         && dynamic_cast<Paper_def*> (defs_[i]))
-       continue;
-      run_translator (defs_[i]);
-    }
-}
-
-
-void
-Score::add_output (Music_output_def *pap)
+LY_DEFINE(ly_render_output, "ly:render-output",
+         3,0,0,
+         (SCM context, SCM header, SCM out_filename),
+         "Given a Score context in its final state, calculate the output, "
+         "and  dump the result to @var{out-filename}, using "
+         "@var{header} for the bibliographic information.")
 {
-  defs_.push (pap);
-}
-
-IMPLEMENT_SMOBS (Score);
-IMPLEMENT_DEFAULT_EQUAL_P (Score);
-
+  Translator *tr = unsmob_translator (context);
+  Global_translator * gt = dynamic_cast<Global_translator*> (tr);
+  
+  SCM_ASSERT_TYPE(gt, context, SCM_ARG1, __FUNCTION__,
+                 "Score context");
+  SCM_ASSERT_TYPE(ly_module_p(header), header, SCM_ARG2, __FUNCTION__,
+                 "module");
+  SCM_ASSERT_TYPE(gh_string_p (out_filename), out_filename, SCM_ARG3, __FUNCTION__,
+                 "output filename");
 
-SCM
-Score::mark_smob (SCM s)
-{
-  Score * sc = (Score*) SCM_CELL_WORD_1 (s);
+  Music_output * output = gt->get_output ();
 
-  if (sc->header_)
-    scm_gc_mark (sc->header_);
-  for (int i = sc->defs_.size (); i--;)
-    scm_gc_mark (sc->defs_[i]->self_scm ());
+  output->header_ = header;
   
-  return sc->music_;
+  progress_indication ("\n");
+  output->process (ly_scm2string (out_filename));
+  
+  delete output ;
+
+  return SCM_UNDEFINED ;
 }
 
-int
-Score::print_smob (SCM , SCM p, scm_print_state*)
+void
+default_rendering (SCM mus, SCM outdef, SCM head, SCM outname)
 {
-  scm_puts ("#<Score>", p);
-
-  return 1;
+  SCM context = ly_run_translator (mus, outdef);
+  
+  if (unsmob_translator (context))
+    ly_render_output (context,  head, outname);
 }
index 4e733fe639b4d4d2984e938e3a100de1de5db260..5d0213b07c8e2e7f43a646503e2d1aa2264ae93e 100644 (file)
@@ -361,7 +361,7 @@ Spacing_spanner::set_springs (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
 
-  Link_array<Grob> all (me->pscore_->system_->columns ()) ;
+  Link_array<Grob> all (me->pscore_->system_->columns ());
 
   set_explicit_neighbor_columns (all);
 
index eaedf13ec82dc12d73b1eeec409d182101086408..e14fc302bef1dbbfc282e5bdabfdcf764530a668 100644 (file)
@@ -479,16 +479,21 @@ Stem::position_noteheads (Grob*me)
              Real l = Note_head::head_extent (heads[i], X_AXIS).length ();
 
              Direction d = get_direction (me);
-             /* reversed head should be shifted l-thickness, but this looks
-                too crowded, so we only shift l-0.5*thickness.
-                Notice that this leads to assymetry: Normal heads overlap
-                the stem 100% whereas reversed heads only overlaps the stem
-                50% */
-             #define magic 0.5
-             heads[i]->translate_axis ((l-thick*magic) * d, X_AXIS);
+             /*
+               Reversed head should be shifted l-thickness, but this
+               looks too crowded, so we only shift l-0.5*thickness.
+
+               This leads to assymetry: Normal heads overlap the
+               stem 100% whereas reversed heads only overlaps the
+               stem 50%
+
+             */
+
+             Real reverse_overlap =0.5;
+             heads[i]->translate_axis ((l-thick*reverse_overlap) * d, X_AXIS);
 
              if (invisible_b(me))
-               heads[i]->translate_axis (-thick*(2-magic) * d , X_AXIS);
+               heads[i]->translate_axis (-thick*(2 - reverse_overlap) * d , X_AXIS);
 
              
             /* TODO:
index 350530053de0353e224d2de9d9adb36f5887ed9b..ba527cc8fe3e2097925e8334a2f6396adfabbbce 100644 (file)
@@ -16,7 +16,7 @@ protected:
 
 
 bool
-String_number_engraver::try_music (Music * m)
+String_number_engraver::try_music (Music * )
 {
   return true;
 }
index ce660216ffb0d6174a9dac43188e74e703ccb33b..6de80dd798dc0f3c358319abce192121d30a364d 100644 (file)
@@ -72,7 +72,6 @@ Text_spanner::brew_molecule (SCM smob)
   while (flip (&d) != LEFT);
 
 
-
   SCM properties = Font_interface::font_alist_chain (me);
   SCM edge_text = me->get_grob_property ("edge-text");
   Drul_array<Molecule> edge;
index 7cc71e4d5150a427017fd5bf84e7ac7a9095801d..681c1dfaade242d3ee88c2175b8806d8b0acddca 100644 (file)
@@ -17,6 +17,7 @@
 #include "grob-pitch-tuple.hh"
 #include "warn.hh"
 #include "note-head.hh"
+#include "staff-symbol-referencer.hh"
 
 /**
    Manufacture ties.  Acknowledge noteheads, and put them into a
@@ -89,8 +90,9 @@ Tie_engraver::acknowledge_grob (Grob_info i)
       for  (int i = heads_to_tie_.size (); i--;)
        {
          Grob *th =  heads_to_tie_[i];
-         int staff_pos = gh_scm2int (h->get_grob_property ("staff-position"));
-         int left_staff_pos = gh_scm2int (th->get_grob_property ("staff-position"));
+         int staff_pos = int (Staff_symbol_referencer::get_position (h));
+         int left_staff_pos = int (Staff_symbol_referencer::get_position (th));
+         
          if (staff_pos == left_staff_pos)
            {
              Grob * p = new Spanner (get_property ("Tie"));
index 655d15f4f54c8118b5f5f598a2b0f19d7a4d0b06..f34b0c2e76dedcc95ac5f430fc6675bfcc197697 100644 (file)
@@ -168,6 +168,7 @@ Translator_group::try_music (Music* m)
   
   if (!hebbes_b && daddy_trans_)
     hebbes_b = daddy_trans_->try_music (m);
+  
   return hebbes_b ;
 }
 
@@ -189,7 +190,7 @@ Translator_group::get_ancestor (int level)
 void
 Translator_group::terminate_translator (Translator*r)
 {
-  r->removal_processing ();
+  r->finalize ();
   /*
     Return value ignored. GC does the rest.
    */
@@ -395,7 +396,7 @@ Translator_group::initialize ()
 void
 Translator_group::finalize ()
 {
-  each (&Translator::removal_processing);
+  each (&Translator::finalize);
 }
 
 
index 3e440ab335965a980109ee2f61e7e1dea3610518..5d4af073f5ff32d27567f01e4ce1098486ae92bf 100644 (file)
@@ -72,12 +72,6 @@ Translator::now_mom () const
   return daddy_trans_->now_mom ();
 }
 
-void
-Translator::removal_processing ()
-{
-  finalize ();
-}
-
 void
 Translator::do_announces ()
 {
index 5684d564d427c004f1606ffb50497f2fa480d0bf..01f27a16d2ece462507686af6ac23d8bfa52dcd0 100644 (file)
@@ -536,9 +536,9 @@ ScoreContext = \translator {
                 
                 (Voice Stem lengths ,(map (lambda (x) (* 0.8 x)) '(3.5 3.5 3.5 4.5 5.0)))
                 (Voice Stem stem-shorten (0.4 0))
-                (Voice Stem font-relative-size -1)
-                (Voice NoteHead font-relative-size -1)
-                (Voice Dots font-relative-size -1)
+                (Voice Stem  font-size -3)
+                (Voice NoteHead  font-size -3)
+                (Voice Dots  font-size -3)
                 (Voice Stem beamed-lengths  
                  ,(map (lambda (x) (* 0.8 x)) '(3.26)))
                 (Voice Stem beamed-minimum-free-lengths  
@@ -554,7 +554,7 @@ ScoreContext = \translator {
                 (Voice Beam position-callbacks (,Beam::least_squares
                                                    ,Beam::check_concave
                                                    ,Beam::slope_damping))
-                (Staff Accidental font-relative-size -2)
+                (Staff Accidental font-size -4)
                 (Voice Slur direction -1)
        )
        
index f1e8c08dd0c02add982503ffd3592ec8be9e24bb..76c943b1f79e712ea94688e10ce6d41016c74c5b 100644 (file)
@@ -1,4 +1,4 @@
-\version "1.9.8"
+\version "2.1.1"
 
 %%%%%%%%
 %%%%%%%% shortcuts common for all styles of gregorian chant notation
@@ -39,7 +39,7 @@ cavum =
 %
 virgula = {
   \once \property Voice.BreathingSign \override #'text = #(make-musicglyph-markup "scripts-rcomma")
-  \once \property Voice.BreathingSign \override #'font-relative-size = #-1
+  \once \property Voice.BreathingSign \override #'font-size = #-2
 
   % Workaround: add padding.  Correct fix would be spacing engine handle this.
   \once \property Voice.BreathingSign \override #'extra-X-extent = #'(-1.0 . 0)
@@ -48,7 +48,7 @@ virgula = {
 }
 caesura = {
   \once \property Voice.BreathingSign \override #'text = #(make-musicglyph-markup "scripts-rvarcomma")
-  \once \property Voice.BreathingSign \override #'font-relative-size = #-1
+  \once \property Voice.BreathingSign \override #'font-size = #-2
 
   % Workaround: add padding.  Correct fix would be spacing engine handle this.
   \once \property Voice.BreathingSign \override #'extra-X-extent = #'(-1.0 . 0)
index cf373e578bb78872177c47c83677b2ee7e7f48ed..300ae89c50c680669c64bd1594c9f723767cab91 100644 (file)
@@ -4,7 +4,7 @@
 
 paperEleven = \paper {
        staffheight = 11.0\pt
-       #(define fonts (make-font-list 'paper11))
+       #(define fonts (scale-font-list  (/ 11. 20.)))
 
        \include "params-init.ly"
 }
index 98fcf5e80010acfb1eb69f0b0b1f5f23cdbbc5e0..544161575f6c277448da70868988e09f6f4ff6b5 100644 (file)
@@ -5,7 +5,7 @@
 
 paperThirteen = \paper {
        staffheight = 13.0\pt
-       #(define fonts (make-font-list 'paper13))
+       #(define fonts (scale-font-list  (/ 13. 20.)))
        
        \include "params-init.ly"
 }
index 983d71763e9242480605b2395adeff0d5996078b..8ace29880affcd29842899976ad04ae1b4b658a6 100644 (file)
@@ -5,7 +5,7 @@
 
 paperSixteen = \paper {
        staffheight = 16.0\pt
-       #(define fonts (make-font-list 'paper16))
+       #(define fonts (scale-font-list (/ 16. 20.)))
 
        \include "params-init.ly"
 }
index c981c38dfd3d0726d5758344d6ed0b2f0a431021..616c2c404d15c7ad3fd73b10e6ce0d788e389eb9 100644 (file)
@@ -5,9 +5,21 @@
 
 paperTwenty = \paper {
        staffheight = 20.0\pt
-       #(define fonts (make-font-list 'paper20))
+       #(define fonts (scale-font-list  1.0))
        
        \include "params-init.ly"
 }
 
 \paper { \paperTwenty }
+
+
+%{
+
+; note:
+; you can add fonts manually  in the paper block by issuing
+
+#(set! fonts (append ...myfonts... fonts))
+
+for the format of myfonts, see font.scm
+
+%}
index 35affc4d44238e7e767727633470a8c14de71c92..e55531407664d0c209143d807b02c2eac2dc7f46 100644 (file)
@@ -5,7 +5,7 @@
 
 paperTwentythree = \paper {
        staffheight = 23.0\pt
-       #(define fonts (make-font-list 'paper23))
+       #(define fonts (scale-font-list  (/ 23. 20.)))
        \include "params-init.ly"
 }
 
index f4d325218755063d77aad9d3e5ac69c6a4087498..acf8499dcdfd7bb20a903206b3c491d2a13a0503 100644 (file)
@@ -4,7 +4,7 @@
 
 paperTwentysix = \paper {
        staffheight = 26.0\pt
-       #(define fonts (make-font-list 'paper26))
+       #(define fonts (scale-font-list (/ 26. 20.)))
        \include "params-init.ly"
 }
 
index 23990bdb5c269ae58cc939cb3b4293a5c204f488..1091b75b0986a7008950158a586ed2668786c58b 100644 (file)
@@ -1,4 +1,4 @@
-\version "1.9.8"
+\version "2.1.1"
 % JUNKME.
 
 %% deprecated
@@ -60,7 +60,6 @@ interscoreline = 4. \mm
 %%
 #(define font-defaults
       '((font-family . music)
-       (font-relative-size . 0)
        (font-shape . upright)
        (baseline-skip . 2)
        (word-space . 0.6)
index c8b1161194bea1585e2f289fbd50c8997d7b1266..393495a7c0b8900359e01cc66beac512ae48fcd2 100644 (file)
@@ -51,9 +51,7 @@ INSTALLATION_OUT_DIR3=$(local_lilypond_datadir)/fonts/tfm
 INSTALLATION_OUT_FILES3=$(TFM_FILES)
 
 
-SAUTER_FONTS =  cmbxti5 cmbxti6 cmbxti7 cmbxti8 cmbxti12 \
-       cmcsc7 cmcsc8 cmcsc12 cmtt5 cmtt6 cmtt7 cmtt17 \
-       cmbx14 cmbx17 cmti5 cmti6 cmss5 cmss6 cmss7 cmss14
+SAUTER_FONTS = cmbxti7 
 
 ALL_FONTS = $(FETA_FONTS) $(SAUTER_FONTS)
 
index 1d6e27ce44416aa4a7be502de927658e2fde4f59..396f895dca9782bdba923c75dc691dcc4af29901 100644 (file)
@@ -49,12 +49,22 @@ def notehead_calc =
        enddef;
 
 
+% a: x diameter
+% b: y diameter
+% err_x: drift of y axis at top
+% err_y: drift of x axis at right
+def distorted_ellipse(expr a,b,err_y,err_x,super) =
+       superellipse((a,err_x),(-err_y,b),(-a,-err_x),(err_y,-b),super);
+       enddef;
+
+
+
 % draw the outer and inner ellipse.
 def notehead_draw =
        path black,white;
        black=distorted_ellipse(a,beta,a*err_y_a,0,superness);
        white=distorted_ellipse(ai,bi,ai*err_y_ai,bi*err_x_bi,inner_superness);
-if test>1: %fixme
+if test > 1: %fixme
                save x;
                x1=-x3=a; x2=x4=0; y1=y3=0; y2=-y4=b;
                penlabels(1,2,3,4);
@@ -145,12 +155,14 @@ fet_endchar;
 fet_beginchar("Half notehead", "1", 
        "halfhead")
        setup_notehead_vars;
-               % a_b:=1.49; % after text
+       % a_b:=1.49; % after text
        a_b:=1.50; % after drawing
        err_y_a:=0.157;
        tilt:=34;
+
        % superness:=0.66;
        superness:=0.67; % jcn
+
        % ai_a:=0.863;
        % was 0.85
        % set to 0.83 to avoid stem entering white part.
index 0523d2189a1dc17f939fc932256ea43e7999d2a5..9919a896167bd279e8298e2ddd3300e8eb848d71 100644 (file)
@@ -1,4 +1,11 @@
 
+%%
+%
+% TODO: blot diameter should be fixed, not scalable.
+%
+%
+
+
 save serif_thick;
 serif_thick# = 1.1 stafflinethickness#;
 define_blacker_pixels (serif_thick);
index 0249176f87999b23667021e16f6d13850ddde5ec..4c1e0916eb1915d64e5f6cd25c856c872b580ed2 100644 (file)
@@ -39,15 +39,6 @@ if test = 0:
        input feta-solfa;
        
 else:
-       input feta-bolletjes;   
-       input feta-banier;
-%      input feta-eindelijk;
-%      input feta-klef;
-%      input feta-toevallig;
-%      input feta-schrift;
-%      input feta-haak;
-%      input feta-timesig;
-%      input feta-pendaal;
-%      input feta-accordion;
-%      input feta-solfa;
+       input feta-test-generic.mf;
+
 fi
index a39c3a1fd7561b411597047cb6ac226ac5eb69e9..ae413e6a516b647fc7ef2cbabee9462c921d47b3 100644 (file)
@@ -118,16 +118,6 @@ def simple_serif(expr p,q, a)=
 enddef;
 %
 
-% a: x diameter
-% b: y diameter
-% err_x: drift of y axis at top
-% err_y: drift of x axis at right
-def distorted_ellipse(expr a,b,err_y,err_x,super) =
-       superellipse((a,err_x),(-err_y,b),(-a,-err_x),(err_y,-b),super);
-       enddef;
-
-
-
 %
 % draw an axis aligned block making sure that edges are on pixels.
 %
index d57d5c3721de90535fb37dc068c1fa0ff67dc909..e822bcc5914f9385d07559fc2a4fa9acb5a9a00a 100644 (file)
@@ -6,6 +6,7 @@ stafflines = 5;
 
 staff_space#:=staffsize#/(stafflines-1);
 
+
 % URG!
 %font_x_height  staff_space# ;
 
index c6812f4f05e1d8edf57b839084238d51ab8317bf..1c5ca0165e225188409fa85530d98d5621b529cf 100644 (file)
@@ -357,7 +357,7 @@ fet_beginchar("Double Sharp", "4", "sharpsharp")
        z5 = z1 reflectedabout((0,0), (1,1));
 
        labels(1,2,3,4,5);
-       pickup pencircle scaled 1/20 staff_space;
+       pickup pencircle scaled blot_diameter;
        filldraw  
                z1{dir 45} .. {right}z2 -- z3 -- 
                z4{down} .. {dir 225}z5 .. cycle;
index 95785f3595082f2fdd1437120b150ff3d56426fe..c0e87d7d8c3e72a009f98c7626d05c78ca41f859 100644 (file)
@@ -4,7 +4,7 @@
 
 input feta-autometric;
 fet_beginfont("feta", 11);
-staffsize#:=11pt#;
+staffsize#:=11.22pt#;
 test:=0;
 
 
index 161d9d9fb6ef424b8c1d620433a5bf5e42a0d271..1987d397500c504b62a4e197f2a1c918746d3fe0 100644 (file)
@@ -1,10 +1,9 @@
 % feta16.mf
 % part of LilyPond's pretty-but-neat music font
 
-
 input feta-autometric;
 fet_beginfont("feta", 13);
-staffsize#:=13pt#;
+staffsize#:=12.60pt#;
 test:=0;
 
 
index 8d7d9538abe2b8c198cb7853d14970299043ec8c..30d7b0a2a22433c731303dd75e58dca8cef8c7b1 100644 (file)
@@ -3,7 +3,7 @@
 
 input feta-autometric;
 fet_beginfont("feta", 16);
-staffsize#:=16pt#;
+staffsize#:=15.87pt#;
 test:=0;
 
 
index 5ef48a8a0d004ba7d40e9c3090020bfba16057d8..95962446bacff6c5819e60b33500649c954c5305 100644 (file)
@@ -2,9 +2,10 @@
 % part of LilyPond's pretty-but-neat music font
 
 input feta-autometric;
-% why is this 22.5?
+
+% todo change file name
 fet_beginfont("feta", 22.5);
-staffsize#:=22.5pt#;
+staffsize#:=22.45pt#;
 test:=0;
 
 
index add32d85f94391ff80f07645e436e0e84ff429e9..ec85398e995c9bd3d08b9c69de6099717aa8b2af 100644 (file)
@@ -3,7 +3,7 @@
 
 input feta-autometric;
 fet_beginfont("feta", 26);
-staffsize#:=26pt#;
+staffsize#:=25.20pt#;
 test:=0;
 
 
index 53804759ad762ecb3b47c3d44928f51eb237d7f9..d0877b022d94bfc685e1fe1204337d1e04d6ff49 100644 (file)
@@ -1,7 +1,7 @@
 % parmesan11.mf
 % part of LilyPond's pretty-but-neat music font
 
-staffsize#:=11pt#;
+staffsize#:=11.22pt#;
 
 input feta-autometric;
 fet_beginfont("parmesan", 11);
index 765744646e2e1bcddc779b9348c26a59f4b3d281..06878f238881d06738d9c5e5651b558177c2607d 100644 (file)
@@ -1,7 +1,7 @@
 % parmesan13.mf
 % part of LilyPond's pretty-but-neat music font
 
-staffsize#:=13pt#;
+staffsize#:=12.60pt#;
 
 input feta-autometric;
 fet_beginfont("parmesan", 13);
index 76abf22974e97a2b61902e2bb2f4b8ff6dd94054..0b6f3220223c48f15a18787a473f22c4c9ddbcd8 100644 (file)
@@ -1,7 +1,7 @@
 % parmesan16.mf
 % part of LilyPond's pretty-but-neat music font
 
-staffsize#:=16pt#;
+staffsize#:=15.87pt#;
 
 input feta-autometric;
 fet_beginfont("parmesan", 16);
index c6710ccad194bfffbdaa2d2702ba740d2554bf4a..4ab3732714e6e18cec3699896371797a41e6c181 100644 (file)
@@ -1,7 +1,7 @@
 % parmesan23.mf
 % part of LilyPond's pretty-but-neat music font
 
-staffsize#:=23pt#;
+staffsize#:=22.45pt#;
 
 input feta-autometric;
 fet_beginfont("parmesan", 23);
index 33c9ae714c2a1c59290a130a5a1759b873a4a4ff..3b86b2232db34aac0155bffeeabe4fba62ceb929 100644 (file)
@@ -1,7 +1,7 @@
 % parmesan26.mf
 % part of LilyPond's pretty-but-neat music font
 
-staffsize#:=26pt#;
+staffsize#:=25.20pt#;
 
 input feta-autometric;
 fet_beginfont("parmesan", 26);
index 6ffecfa843696fa3c6c7bf622e8930f197acdcf4..1bc5ba99ef24b0acf1295f8c33cc496f9572ad45 100644 (file)
@@ -119,7 +119,7 @@ FOOBAR-MARKUP) if OMIT-ROOT is given and non-false.
   (define (is-req-chord? m)
     (and
      (memq 'event-chord (ly:get-mus-property m 'types))
-     (not (equal? (ly:make-moment 0 1) (ly:get-music-length m)))))
+     (not (equal? ZERO-MOMENT (ly:music-length m)))))
 
   (let* ((elts (filter is-req-chord? (ly:get-mus-property seq 'elements)))
         (alist (map chord-to-exception-entry elts)))
index 978fb0f950de88998312fa515d88e1f0ebe419ea..7f75bfb9d93e476b526782d94916116203991a7d 100644 (file)
@@ -215,13 +215,13 @@ options include undefined and mensural.
 definition: music roman braces dynamic math ...")
 (grob-property-description 'font-name string? "file name for the font to load.
 Overrides all other font-X qualifiers.")
-(grob-property-description 'font-design-size number? "partial font definition: exact font size in points FIXME: should override font-relative-size.")
 (grob-property-description 'font-magnification number? "Magnification
   of the font. If undefined, the default is @code{1.0}.")
 
-(grob-property-description 'font-relative-size number? "partial font
-definition: the relative size compared the `normal' size.  0 is
-style-sheet's normal size, -1 is smaller, +1 is bigger.")
+(grob-property-description 'font-size number? "font definition: the
+relative size compared the `normal' size.  0 is style-sheet's normal
+size, -1 is smaller, +1 is bigger.  Each step of 1 is approximately
+12% larger, 6 steps are exactly a factor 2 larger. Fractional values are allowed.")
 
 (grob-property-description 'font-series symbol? "partial font definition: medium, bold.")
 (grob-property-description 'font-shape symbol? "partial font definition: upright or italic.")
index 16203d0ef2b7414477fb19d790854581147e5e99..2fd1825b49097caa03b6da51704cb48062690119 100644 (file)
@@ -332,6 +332,12 @@ auto string-selecting mechanism selects the highest string with a fret
 not less than minimumFret")
 (translator-property-description 'minimumVerticalExtent number-pair?
 "minimum vertical extent, same format as VerticalExtent")
+(translator-property-description 'recordEventSequence procedure?
+                                "Upon termination of this context,
+this function is called with current context and a list of music
+objects.  The list of contains entries with start times, music objects
+and whether they're processed in this context.")
+
 (translator-property-description 'noDirection boolean? "Don't set directions by a2-engraver when part-combining.")
 (translator-property-description
  'originalCentralCPosition integer?
index 5b2a64455e6b52561d1f0b341c91be4599baaa97..19b619b365f7c8bb6e4abad078263a2268b56817 100644 (file)
@@ -2,12 +2,15 @@
  (ice-9 regex)
  )
 
+(define (dashify-underscores str)
+   (regexp-substitute/global #f "_" str 'pre "-" 'post))
+
 (define (format-c-header c-h)
   (regexp-substitute/global
    #f "," 
-   (regexp-substitute/global #f "(SCM|\\)|\\() *" c-h 'pre "" 'post)
-   'pre " " 'post)
-  )
+   (regexp-substitute/global #f "(SCM|\\)|\\() *" (dashify-underscores c-h)
+                            'pre "" 'post)
+   'pre " " 'post))
 
 (define (document-scheme-function name c-header doc-string)
   (string-append
@@ -21,8 +24,7 @@
     (lambda (key val prior)
       (cons (cons key val)  prior)
       )
-    '() (ly:get-all-function-documentation))
-   )
+    '() (ly:get-all-function-documentation)))
 
 (define (all-scheme-functions-doc)
   (let*
index 22c7b5f4703ebbcff7d2bc28c366b85b0fb148d4..41784a0bc2aa9002c5fd754f4edcdbd753a4b168 100644 (file)
 ;;; (c)  2000--2003 Jan Nieuwenhuizen <janneke@gnu.org>
 ;;;
 
-(define (font-field name font-descr)
-      (list-ref
-       font-descr
-       (cond
-       ((eq? name 'font-relative-size)  0)
-       ((eq? name 'font-series) 1)
-       ((eq? name 'font-shape) 2)
-       ((eq? name 'font-family) 3)
-       ((eq? name 'font-design-size) 4)
-       (else (ly:warning "unknown font field name"))
-       )
-       ))
-
+;; Should separate default sizes
+;; into separate list/alist ?
+
+
+"
+Each entry in this vector has the following format
+
+
+ (cons
+  #(QUALIFIERS)
+  (cons DEFAULT-SIZE
+        #(SIZE-FONT-ENTRIES... ) ))
+
+where each SIZE-FONT-ENTRY is
+
+  (cons DESIGN-SIZE FONT-NAME)
+
+or
+
+  (cons DESIGN-SIZE (list FONT-NAME1 FONT-NAME2 .. )) 
+
+"
+
+
+(define-public paper20-font-vector
+  '((#(medium upright number) .
+     (10 . #((10.0  . "feta-nummer10"))))
+    (#(medium upright roman) .
+     (10.0 . #((6.0 . "cmr6")
+              (8.0 . "cmr8") 
+              (10.0 . "cmr10")
+              (17.0 . "cmr17")
+              )))
+    (#(* * music). 
+     (20.0 . #((11.22 . ("feta11" "parmesan11"))
+              (12.60 . ("feta13" "parmesan13"))
+              (14.14 . ("feta14" "parmesan14"))
+              (15.87 . ("feta16" "parmesan16"))
+              (17.82 . ("feta18" "parmesan18"))
+              (20.0 . ("feta20" "parmesan20"))
+              (22.45 . ("feta23" "parmesan23"))
+              (25.20 . ("feta26" "parmesan26"))
+              )))
+    (#(medium upright sans) .
+     (10.0  . #((8.0 . "cmss8")
+               (10.0 . "cmss10")
+               (12.0 . "cmss12")
+               (17.0 . "cmss17")
+               )))
+    (#(medium upright typewriter) .
+     (10.0 . #((8.0 .  "cmtt8")
+              (10.0 . "cmtt10")
+              (12.0 . "cmtt12")
+              )))
+    (#(bold italic roman) .
+     (10.0 . #((8.0 . "cmbxti7")
+              (10.0 . "cmbxti10")
+              (14.0 . "cmbxti14")
+              )))
+    (#(medium italic roman) .
+     (10.0 . #((7.0 . "cmti7")
+              (10.0 . "cmti10")
+              (12.0 . "cmti12")
+              )))
+    (#(bold upright roman) .
+     (10.0 . #((6.0 . "cmbx6")
+              (8.0 . "cmbx8")
+              (10.0 . "cmbx10")
+              (12.0 . "cmbx12")
+              )))
+    (#(medium caps roman) .
+     (10.0 . #((10.0 . "cmcsc10"))))
+
+    ;; this is a little pointless, since feta-din scales linearly
+    (#(* * dynamic) .
+     (14.0 .  #((8.0 . "feta-din10")
+               (10.0 . "feta-din10")
+               (14.0 . "feta-din14")
+               (17.0 . "feta-din17")
+               )))
+    (#(* * math) .
+     (10.0 . #((10.0 . "msam10"))))
+     ))
+
+(define (scale-font-entry entry factor)
+  (cons
+   (car entry)
+   (cons (* (cadr entry) factor)
+        (cddr entry))))
 
 (define size-independent-fonts
-  `(
-    ((* * * braces *) . ("feta-braces00"
-                        "feta-braces10"
-                        "feta-braces20"
-                        "feta-braces30"
-                        "feta-braces40"
-                        "feta-braces50"
-                        "feta-braces60"
-                        "feta-braces70"
-                        "feta-braces80") )))
-
-;; FIXME: what about this comment?:
-
-;; font-lookup seems a  little inefficient -- walking this entire list
-;; for a single font.
-;;
-;;   should really have name/pt size at the front of the list.
-;;   (also tried to vary the order of this list, with little effect)
-;;
-;; (font-relative-size font-series font-shape font-family 
-;; font-design-size)
-
-(define paper20-style-sheet-alist
-  '(
-    ;; why are font file names strings, not symbols?
-    ((3 medium upright number 13) . "feta-nummer13")
-    ((2 medium upright number 13) . "feta-nummer13")
-    ((1 medium upright number 11) . "feta-nummer11")
-    ((0 medium upright number 10) . "feta-nummer10")
-    ((-1 medium upright number 8) . "feta-nummer8")
-    ((-2 medium upright number 7) . "feta-nummer7")
-    ((-3 medium upright number 6) . "feta-nummer6")
-    ((-4 medium upright number 5) . "feta-nummer5")
-    ((-5 medium upright number 4) . "feta-nummer4")
-
-    ((4 medium upright roman 17) . "cmr17")
-    ((3 medium upright roman 17) . "cmr17")
-    ((2 medium upright roman 12) . "cmr12")
-    ((1 medium upright roman 12) . "cmr12")
-    ((0 medium upright roman 10) . "cmr10")
-    ((-1 medium upright roman 8) . "cmr8" )
-    ((-2 medium upright roman 7) . "cmr7" )
-    ((-3 medium upright roman 6) . "cmr6" )
-    ((-4 medium upright roman 5) . "cmr5" )
-    ((-5 medium upright roman 5) . "cmr5" )
-
-    ((4 medium upright sans 17) . "cmss17")
-    ((3 medium upright sans 17) . "cmss17")
-    ((2 medium upright sans 14) . "cmss14")
-    ((1 medium upright sans 12) . "cmss12")
-    ((0 medium upright sans 10) . "cmss10")
-    ((-1 medium upright sans 9) . "cmss9" )
-    ((-2 medium upright sans 8) . "cmss8" )
-    ((-3 medium upright sans 7) . "cmss7" )
-    ((-4 medium upright sans 6) . "cmss6" )
-    ((-5 medium upright sans 5) . "cmss5" )
-    
-    ((3 medium italic roman 12) . "cmti12")
-    ((2 medium italic roman 12) . "cmti12")
-    ((1 medium italic roman 12) . "cmti12") ;;; ugh. Should add magnification here! 
-    ((0 medium italic roman 10) . "cmti10")
-    ((-1 medium italic roman 8) . "cmti8")    
-    ((-2 medium italic roman 7) . "cmti7")
-    ((-3 medium italic roman 6) . "cmti6")    
-    ((-4 medium italic roman 5) . "cmti5")    
-    ((-5 medium italic roman 5) . "cmti5")    
-
-    ;;; cmbx17 is sauter, not commonly available as Type1.
-    ((4 bold upright roman 17) . "cmbx17") 
-    ((3 bold upright roman 17) . "cmbx17")
-    
-    ((2 bold upright roman 14) . "cmbx14")
-    ((1 bold upright roman 12) . "cmbx12")
-    ((0 bold upright roman 10) . "cmbx10")
-    ((-1 bold upright roman 8) . "cmbx8")
-    ((-2 bold upright roman 7) . "cmbx7")
-    ((-3 bold upright roman 6) . "cmbx6")
-    ((-4 bold upright roman 5) . "cmbx5")
-    ((-5 bold upright roman 5) . "cmbx5")
-     
-     
-    ((2 bold italic roman 12) . "cmbxti12")
-    ((1 bold italic roman 12) . "cmbxti12")
-    ((0 bold italic roman 10) . "cmbxti10")
-
-    ((-1 bold italic roman 8) . "cmbxti8")
-    ((-2 bold italic roman 7) . "cmbxti7")
-    ((-3 bold italic roman 6) . "cmbxti6")
-    ((-4 bold italic roman 5) . "cmbxti5")
-    ((-5 bold italic roman 5) . "cmbxti5")
-     
-    ((4 medium upright typewriter 17) . "cmtt17")
-    ((3 medium upright typewriter 17) . "cmtt17")
-    ((2 medium upright typewriter 12) . "cmtt12")
-    ((1 medium upright typewriter 12) . "cmtt12")
-    ((0 medium upright typewriter 10) . "cmtt10")
-    ((-1 medium upright typewriter 8) . "cmtt8" )
-    ((-2 medium upright typewriter 7) . "cmtt7" )
-    ((-3 medium upright typewriter 6) . "cmtt6" )
-    ((-4 medium upright typewriter 5) . "cmtt5" )
-    ((-5 medium upright typewriter 5) . "cmtt5" )
-    
-    ((3 medium caps roman 12) . "cmcsc12")
-    ((2 medium caps roman 12) . "cmcsc12")
-    ((1 medium caps roman 12) . "cmcsc12")
-    ((0 medium caps roman 10) . "cmcsc10")
-    ((-1 medium caps roman 8) . "cmcsc8")
-    ((-2 medium caps roman 7) . "cmcsc7")
-    ((-3 medium caps roman 7) . "cmcsc7")
-
-    ((3 * * dynamic 19) . "feta-din19")
-    ((2 * * dynamic 19) . "feta-din19")
-    ((1 * * dynamic 17) . "feta-din17")
-    ((0 * * dynamic 14) . "feta-din14")
-    ((-1 * * dynamic 12) . "feta-din12")
-    ((-2 * * dynamic 9) . "feta-din9")
-    ((-3 * * dynamic 8) . "feta-din8")
-    ((-4 * * dynamic 7) . "feta-din7")
-    ((-5 * * dynamic 6) . "feta-din6")
-
-    ((2 * * music 26) . ("feta26" "parmesan26"))
-    ((1 * * music 23) . ("feta23" "parmesan23"))
-    ((0 * * music 20) . ("feta20" "parmesan20"))
-    ((-1 * * music 16) . ("feta16" "parmesan16"))
-    ((-2 * * music 13) . ("feta13" "parmesan13"))
-    ((-3 * * music 11) . ("feta11" "parmesan11"))
-    ((-4 * * music 11) . ("feta11" "parmesan11"))
-    
-    ((2 * * ancient 26) . ("feta26" "parmesan26"))
-    ((1 * * ancient 23) . ("feta23" "parmesan23"))
-    ((0 * * ancient 20) . ("feta20" "parmesan20"))
-    ((-1 * * ancient 16) . ("feta16" "parmesan16"))
-    ((-2 * * ancient 13) . ("feta13" "parmesan13"))
-    ((-3 * * ancient 11) . ("feta11" "parmesan11"))
-    ((-4 * * ancient 11) . ("feta11" "parmesan11"))
-
-    ((0 * * math 10) . "msam10")
-    ((-1 * * math 10) . "msam10")
-    ((-2 * * math 10) . "msam10")
-    ((-3 * * math 10) . "msam10")
-   ))
-
-;; 
-(define (change-relative-size font-desc decrement)
-  "return a FONT-DESCR with relative size decremented by DECREMENT"
-
-  (if (number? (car font-desc))
-      (cons (- (car font-desc) decrement) (cdr font-desc))
-      font-desc)
-  )
-
-(define (change-rhs-size font-desc from to )
-  (cons (car font-desc)
-       (regexp-substitute/global #f from (cdr font-desc) 'pre to 'post)))
-  
-
-(define (change-style-sheet-relative-size sheet x)
-  (map-alist-keys (lambda (descr) (change-relative-size descr  x)) sheet))
-
-
-;; make style sheet for each paper version.
-(define font-list-alist
-  (map-alist-vals (lambda (x) (change-style-sheet-relative-size
-                              paper20-style-sheet-alist x))
-                 '((paper11 . -3)
-                   (paper13 . -2)
-                   (paper16 . -1)
-                   (paper20 . 0)
-                   (paper23 . 1)
-                   (paper26 . 2)
-                   )))
-
-;;
-;; make a kludged up paper-19 style sheet. Broken by virtual fonts.
-;;
-(if #f
-    (set! font-list-alist
-      (cons
-       (cons
-       'paper19
-       (map (lambda (x) (change-rhs-size x "20" "19"))
-            paper20-style-sheet-alist))
-       font-list-alist)))
-
-(define-public (make-font-list sym)
+  '((#(* * braces) .
+     (10 . #((10.0 . ("feta-braces00"
+                     "feta-braces10"
+                     "feta-braces20"
+                     "feta-braces30"
+                     "feta-braces40"
+                     "feta-braces50"
+                     "feta-braces60"
+                     "feta-braces70"
+                     "feta-braces80")))))))
+
+(define-public (scale-font-list factor)
   (append size-independent-fonts
-         (cdr (assoc sym font-list-alist))))
-
-
-;;; ascii-script font init
-(define as-font-sheet-alist
-  '((as5 . (((* * * braces *) . ("as-braces9"))
-           ((* * * number *) . "as-number1")
-           ((0 * * music *) . ("as5"))
-           ((0 * * roman *) . "as-dummy")))
-    (as9 . (((* * * braces *) . ("as-braces9"))
-           ((0 medium upright number 10) . "as-number4")
-           ((* * * number 5) . "as-number1")
-           ((0 * * music *) . ("as9"))
-           ((0 * * roman *) . "as-dummy")))))
-
-(define-public (as-make-font-list sym)
-  (set! font-list-alist
-       (append font-list-alist as-font-sheet-alist))
-  (make-font-list sym))
-
-
-
+         (map (lambda (y) (scale-font-entry y factor))   paper20-font-vector)
+  ))
+    
+;
 
index cec78e35ee377b77959e27ed5a6b19856783d3fd..9ceb5333ed322b51231d33c066404b21a5db8127 100644 (file)
@@ -77,6 +77,8 @@
 (define-public DOUBLE-SHARP 4)
 (define-public SEMI-TONE 2)
 
+(define-public ZERO-MOMENT (ly:make-moment 0 1)) 
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; lily specific variables.
 (define-public default-script-alist '())
            handle
            (chain-assoc x (cdr alist-list))))))
 
+(define (chain-assoc-get x alist-list default)
+  (if (null? alist-list)
+      default
+      (let* ((handle (assoc x (car alist-list))))
+       (if (pair? handle)
+           (cdr handle)
+           (chain-assoc-get x (cdr alist-list) default)))))
+
 
 (define (map-alist-vals func list)
   "map FUNC over the vals of  LIST, leaving the keys."
index 5af90d22606c00012469bd194f4551a81b077257..c66215d17022a96a7d8ae127e508c38bb4e1f785 100644 (file)
@@ -711,10 +711,28 @@ Rest can contain a list of beat groupings
   m)
 
 (define-public toplevel-music-functions
-  (list check-start-chords
+  (list
+;;   check-start-chords ; ; no longer needed with chord syntax. 
        voicify-music
        (lambda (x) (music-map glue-mm-rest-texts x))
 ; switch-on-debugging
        ))
 
 
+
+
+;;;;;;;;;;;;;;;;;
+;; lyrics
+
+(define (apply-durations lyric-music durations) 
+  (define (apply-duration music)
+    (if (and (not (equal? (ly:music-length music) ZERO-MOMENT))
+            (ly:duration?  (ly:get-mus-property music 'duration)))
+       (begin
+         (ly:set-mus-property! music 'duration (car durations))
+         (set! durations (cdr durations))
+         )))
+
+  (music-map apply-duration lyric-music))
+
+
index 8b7d8e91c161f9828d8dcace3e755c1e327d30fc..1d4627aefd2be67aaad20d3be3a9bd3a97dd04cd 100644 (file)
@@ -104,12 +104,12 @@ for the reader.
 
 (define-public (finger-markup paper props . rest)
   (interpret-markup paper
-                   (cons (list '(font-relative-size . -3)
+                   (cons (list '(font-size . -4)
                                '(font-family . number))
                                props)
                    (car rest)))
 
-(define-public fontsize-markup (set-property-markup 'font-relative-size))
+(define-public fontsize-markup (set-property-markup 'font-size))
 (define-public magnify-markup (set-property-markup 'font-magnification))
 
 (define-public bold-markup
@@ -331,7 +331,7 @@ for DIR, you can obtain longer or shorter stems."
   "Syntax: \\super MARKUP. "
   (ly:molecule-translate-axis (interpret-markup
                               paper
-                              (cons '((font-relative-size . -2)) props) (car rest))
+                              (cons '((font-size . -3)) props) (car rest))
                              (* 0.5 (cdr (chain-assoc 'baseline-skip props)))
                              Y)
   )
@@ -347,7 +347,7 @@ for DIR, you can obtain longer or shorter stems."
   "Syntax: \\sub MARKUP."
   (ly:molecule-translate-axis (interpret-markup
                               paper
-                              (cons '((font-relative-size . -2)) props)
+                              (cons '((font-size . -3)) props)
                               (car rest))
                              (* -0.5 (cdr (chain-assoc 'baseline-skip props)))
                              Y)
@@ -365,10 +365,8 @@ for DIR, you can obtain longer or shorter stems."
   "Horizontal brackets around its single argument. Syntax \\hbracket MARKUP."  
   
   (let*
-      (
-       (th 0.1) ;; todo: take from GROB.
-       (m (interpret-markup paper props (car rest)))
-       )
+      ((th 0.1) ;; todo: take from GROB.
+       (m (interpret-markup paper props (car rest))) )
 
     (bracketify-molecule m X th (* 2.5 th) th)  
 ))
@@ -376,10 +374,8 @@ for DIR, you can obtain longer or shorter stems."
 (define-public (bracket-markup paper props . rest)
   "Vertical brackets around its single argument. Syntax \\bracket MARKUP."  
   (let*
-      (
-       (th 0.1) ;; todo: take from GROB.
-       (m (interpret-markup paper props (car rest)))
-       )
+      ((th 0.1) ;; todo: take from GROB.
+       (m (interpret-markup paper props (car rest))) )
 
     (bracketify-molecule m Y th (* 2.5 th) th)  
 ))
@@ -407,9 +403,8 @@ for DIR, you can obtain longer or shorter stems."
 (define-public (smaller-markup  paper props . rest)
   "Syntax: \\smaller MARKUP"
   (let*
-      (
-       (fs (cdr (chain-assoc 'font-relative-size props)))
-       (entry (cons 'font-relative-size (- fs 1)))
+      ((fs (chain-assoc-get 'font-size props 0))
+       (entry (cons 'font-size (- fs 1)))
        )
     (interpret-markup
      paper (cons (list entry) props)
@@ -419,9 +414,8 @@ for DIR, you can obtain longer or shorter stems."
 (define-public (bigger-markup  paper props . rest)
   "Syntax: \\bigger MARKUP"
   (let*
-      (
-       (fs (cdr (chain-assoc 'font-relative-size props)))
-       (entry (cons 'font-relative-size (+ fs 1)))
+      ((fs (chain-assoc-get 'font-size props 0))
+       (entry (cons 'font-size (+ fs 1)))
        )
   (interpret-markup
    paper (cons (list entry) props)
@@ -431,8 +425,7 @@ for DIR, you can obtain longer or shorter stems."
 (define-public (box-markup paper props . rest)
   "Syntax: \\box MARKUP"
   (let*
-      (
-       (th 0.1)
+      ((th 0.1)
        (pad 0.2)
        (m (interpret-markup paper props (car rest)))
        )
index f47c98bedd3a1068b54f7c7c8d99650247f2c6ab..e07436673866ba40d418f2cb2cce2be09385e257 100644 (file)
@@ -9,8 +9,7 @@
 
 ; The TabNoteHead stem attachment function.
 (define (tablature-stem-attachment-function style duration)
-  (cons 0.0 0.5) ;; UGH!
-)
+  (cons 0.0 0.5))
 
 ; The TabNoteHead molecule callback.
 ; Create a text molecule
@@ -30,9 +29,7 @@
       (list-ref tuning
                 (- string 1) ; remove 1 because list index starts at 0 and guitar string at 1.
                 )
-      )
-   )
-  )
+      ) ) ) 
 
 (define-public (hammer-molecule-callback grob)
   (let* ((note-collums (ly:get-grob-property grob 'note-columns))
@@ -59,9 +56,7 @@
         )
 
       (ly:molecule-combine-at-edge slur 1 1 text -0.6)
-      )
-    )
-  )
+      ) ) )
 
 
 
@@ -276,6 +271,5 @@ centered, X==1 is at the right, X == -1 is at the left."
      (if (equal? result #f)
         (ly:warn (string-append "Unknown bar glyph: `" glyph "'"))
         (index-cell (cdr result) dir))
-     )
-   )
+     ) )
      
index bd5a5df1f21a9466fd82e2f2e3aa586904d4a88b..bf42f7e22c17e6e50e460ecb29dda9f788d47c79 100644 (file)
   (string-append
    "%!PS-Adobe-3.0\n"
    "%%Creator: " creator generate "\n"))
-
 (define (header-end)
   (string-append
    ;; URG: now we can't use scm output without Lily
    "{ exch pop //systemdict /run get exec } "
    ;; ps-testing wreaks havoc when used with lilypond-book.
    ;;  -- is this still true with new modules system?
-   ;;   (if (defined? 'ps-testing) "\n /testing true def" "")
-   ;;   "\n /testing true def"
+;;   (if (defined? 'ps-testing) "\n /testing true def" "")
+  ;   "\n /testing true def"
    ))
 
 (define (lily-def key val)
index f14e40e329a5c0038e84013a10e021cd8202a1f5..b53b2f5e5fc1dfdc48b307452e14e45cfb7cac96 100644 (file)
@@ -1,12 +1,9 @@
-(use-modules (ice-9 regex)
-            (srfi srfi-1))
-
 
-;; should make module?
+(use-modules (ice-9 regex)
+            (srfi srfi-1)
+            (oop goops))
 
 "
-
-
 Todo: this is a quick hack; it makes more sense to define a GOOPS
 class of a documentnode (similar to how
 ; the documentation is generated.)
@@ -24,11 +21,110 @@ is then separated.
      <paperoutput>
      </paperoutput>
    </score>
-
-
-
 "
 
+(define-class <xml-node> ()
+  (name #:init-value "" #:accessor node-name #:init-keyword #:name)
+  (value #:init-value "" #:accessor node-value #:init-keyword #:value)
+  (attributes #:init-value '()
+             #:accessor node-attributes
+             #:init-keyword #:attributes)
+  (children #:init-value '()
+           #:accessor node-children
+           #:init-keyword #:children))
+
+(define node-names
+  '((NoteEvent . note)
+    (SequentialMusic . measure)
+
+    ;;ugh
+    (pitch . pitch)
+    (duration . duration)
+    (octave . octave)
+    (step . step)
+    ))
+
+(define (assoc-get-default key alist default)
+  "Return value if KEY in ALIST, else DEFAULT."
+  (let ((entry (assoc key alist)))
+    (if entry (cdr entry) default)))
+
+(define (musicxml-node->string node)
+  (let ((xml-name (assoc-get-default (node-name node) node-names #f)))
+  (string-append
+   (if xml-name (open-tag xml-name '() '()) "")
+   (if (equal? (node-value node) "")
+       (string-append
+       (if xml-name "\n" "")
+       (apply string-append (map musicxml-node->string (node-children node))))
+       (node-value node))
+   (if xml-name (close-tag xml-name) "")
+   (if xml-name "\n" ""))))
+
+(define (xml-node->string node)
+  (string-append
+   "\n"
+   (open-tag (node-name node) (node-attributes node) '())
+   (if (equal? (node-value node) "")
+       (string-append
+       (apply string-append (map xml-node->string (node-children node))))
+       (node-value node))
+   "\n"
+   (close-tag (node-name node))))
+
+(define (musicxml-duration->xml-node d)
+  (make <xml-node>
+    #:name 'duration
+    #:value (number->string (ash 1 (ly:duration-log d)))))
+
+(define (duration->xml-node d)
+  (make <xml-node>
+    #:name 'duration
+    ;; #:value (number->string (ash 1 (ly:duration-log d)))))
+    #:attributes `((log . ,(ly:duration-log d))
+                  (dots . ,(ly:duration-dot-count d))
+                  (numer . ,(car (ly:duration-factor d)))
+                  (denom . ,(cdr (ly:duration-factor d))))))
+
+(define (musicxml-pitch->xml-node p)
+  (make <xml-node>
+    #:name 'pitch
+    #:children
+    (list
+     (make <xml-node>
+       #:name 'step
+       #:value (list-ref  '("C" "D" "E" "F" "G" "A" "B")
+                         (ly:pitch-notename p)))
+     (make <xml-node>
+       #:name 'octave
+       #:value (number->string (ly:pitch-octave p))))))
+
+(define (pitch->xml-node p)
+  (make <xml-node>
+    #:name 'pitch
+    #:attributes `((octave . ,(ly:pitch-octave p))
+                  (notename . ,(ly:pitch-notename p))
+                  (alteration . ,(ly:pitch-alteration p)))))
+                              
+(define (music->xml-node music)
+  (let* ((name (ly:get-mus-property music 'name))
+        (e (ly:get-mus-property music 'element))
+        (es (ly:get-mus-property music 'elements))
+        (mprops (ly:get-mutable-properties music))
+        (d (ly:get-mus-property music 'duration))
+        (p (ly:get-mus-property music 'pitch))
+        (ignore-props '(origin elements duration pitch element)))
+    
+    (make <xml-node>
+      #:name name
+      #:children
+      (apply
+       append
+       (if (ly:pitch? p) (list (pitch->xml-node p)) '())
+       (if (ly:duration? d) (list (duration->xml-node d)) '())
+       (if (pair? es) (map music->xml-node es) '())
+       (if (ly:music? e) (list (music->xml-node e)) '())
+       '()))))
 
 (define (dtd-header)
   (string-append
@@ -87,27 +183,6 @@ is then separated.
 <!ATTLIST pitch octave ( -1 | -2 | 0 | 1 ) #REQUIRED >")
 
 
-
-
-(define (dump-duration d port)
- (display (open-tag 'duration
-           `((log . ,(ly:duration-log d))
-             (dots . ,(ly:duration-dot-count d))
-             (numer . ,(car (ly:duration-factor d)))
-             (denom . ,(cdr (ly:duration-factor d)))
-             )
-           '() ) port)
- (display  (close-tag 'duration) port))
-
-(define (dump-pitch p port)
- (display (open-tag 'pitch
-           `((octave . ,(ly:pitch-octave p))
-             (notename . ,(ly:pitch-notename p))
-             (alteration . ,(ly:pitch-alteration p))
-             )
-           '() ) port)
- (display  (close-tag 'pitch) port))
-
 ;; should use macro
 (define (assert x)
   (if x
@@ -152,45 +227,11 @@ is then separated.
 
   (string-append
    "<" (symbol->string tag)
-   (apply string-append
-         (map dump-attr (filter candidate? attrs)))
-   ">\n")
-   
-  )
-(define (close-tag name)
-  (string-append "</" (symbol->string name) ">\n")
-  )
-
-(define (music-to-xml-helper music port)
-   (let*
-       (
-       (name (ly:get-mus-property music 'name))
-       (e (ly:get-mus-property music 'element))
-       (es (ly:get-mus-property music 'elements))
-       (mprops (ly:get-mutable-properties music))
-       (p (ly:get-mus-property music 'pitch))
-       (d (ly:get-mus-property music 'duration))
-       (ignore-props '(origin elements duration pitch element))
-       )
+   (apply string-append (map dump-attr (filter candidate? attrs)))
+   ">"))
 
-     ;; As almost everything is music; <SequentialMusic> is
-     ;; probably better than <music type="SequentialMusic">?
-     
-     (display (open-tag 'music (cons `(type . ,name) mprops) ignore-props)
-             port)
-     (if (ly:duration? d)
-        (dump-duration d port))
-     (if (ly:pitch? p)
-        (dump-pitch p port))
-     (if (pair? es)
-        (map (lambda (x) (music-to-xml-helper x port)) es)
-        )
-
-     (if (ly:music? e)
-        (begin
-          (music-to-xml-helper e port)))
-     (display (close-tag 'music) port)
-     ))
+(define (close-tag name)
+  (string-append "</" (symbol->string name) ">"))
 
 (define-public (music-to-xml music port)
   "Dump XML-ish stuff to PORT."
@@ -200,5 +241,20 @@ is then separated.
   ;;  (display (dtd-header) port)
   
   (display (open-tag 'music '((type . score)) '()) port)
-  (music-to-xml-helper music port)
+  (display (xml-node->string (music->xml-node music)) port)
   (display (close-tag 'music) port))
+
+(define-public (music-to-musicxml music port)
+  "Dump MusicXML-ish stuff to PORT."
+
+  ;; dtd contains # -- This confuses tex during make web.
+  ;;
+  ;;  (display (dtd-header) port)
+
+  (define pitch->xml-node musicxml-pitch->xml-node)
+  (define duration->xml-node musicxml-duration->xml-node)
+  
+  (display (open-tag 'music '((type . score)) '()) port)
+  (display (musicxml-node->string (music->xml-node music)) port)
+  (display (close-tag 'music) port))
+
index ee781c5332d7e1265ad56e9fb142b234b04e298a..2f8184eed70bb6c00eaa8d47bae56a72f76878bd 100644 (file)
@@ -1603,13 +1603,19 @@ conversions.append (((1,9,8), conv, """dash-length -> dash-fraction"""))
 
 
 def conv (str):
-       if re.search ("up-to-staff", str) :
-               sys.stderr.write ("up-to-staff was removed. Use stem-end-position instead. ")
-               raise FatalConversionError ()
-       
+       def func(match):
+               return "#'font-size = #%d" % (2*string.atoi (match.group (1))) 
+               
+       str =re.sub (r"#'font-relative-size\s*=\s*#([0-9-]+)", func, str)
+       return str
+
+conversions.append (((2,1,1), conv, """font-relative-size -> font-size"""))
+
+def conv (str):
+       str =re.sub (r"ly:get-music-length", "ly:music-length", str)
        return str
 
-conversions.append (((2,0,1), conv, """dash-length -> dash-fraction"""))
+conversions.append (((2,1,2), conv, """ly:get-music-length -> ly:music-length"""))
 
 ################################
 #      END OF CONVERSIONS      
index b58a7e55ce2ba1a92530cfed9b8ce8db76e0e23f..8d3554e52c8252836a96c8759d10dd1a1ac6846b 100644 (file)
@@ -11,6 +11,7 @@ INSTALLATION_FILES=$(TEX_FILES)
 include $(depth)/make/stepmake.make
 
 $(outdir)/music-drawing-routines.ps: $(depth)/ps/music-drawing-routines.ps
-       -cp $< $@
+       rm -f $@
+       -ln $< $@
 
 all: $(INSTALLATION_FILES)