]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/global-context.cc (run_iterator_on_me): fix grace note
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 18 Mar 2004 00:09:44 +0000 (00:09 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 18 Mar 2004 00:09:44 +0000 (00:09 +0000)
nesting by initting measurePosition.

* lily/timing-translator.cc (initialize): do no init
measurePosition

* lily/include/music-output-def.hh (class Music_output_def): add
input_origin_ field.

* Documentation/user/changing-defaults.itely (Changing context
properties on the fly): new node.

* lily/include/ly-smobs.icc (free_smob): remove smobbed_self()
function. Only have smobbed_copy (), and do not provide
smobbed_copy() for non-simple smobs. Changes throughout.

33 files changed:
ChangeLog
Documentation/user/changing-defaults.itely
THANKS
VERSION
input/test/title-markup.ly
lily/accidental-engraver.cc
lily/auto-change-iterator.cc
lily/duration.cc
lily/global-context.cc
lily/global-translator.cc [deleted file]
lily/include/duration.hh
lily/include/ly-smobs.icc
lily/include/moment.hh
lily/include/music-output-def.hh
lily/include/paper-def.hh
lily/include/paper-line.hh
lily/include/pitch.hh
lily/include/smobs.hh
lily/include/spring.hh
lily/include/stencil.hh
lily/moment.cc
lily/note-collision.cc
lily/paper-book.cc
lily/paper-def.cc
lily/paper-line.cc
lily/parser.yy
lily/pitch.cc
lily/spring-smob.cc
lily/stencil.cc
lily/system.cc
lily/timing-translator.cc
scm/lily.scm
scm/output-tex.scm

index cc1871de76c0d37a1f5f92afda2e36895987f281..e44cc6877da5c69eb4326d829eca080eda633b1f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,34 @@
+2004-03-18  Han-Wen Nienhuys   <hanwen@xs4all.nl>
+
+       * lily/global-context.cc (run_iterator_on_me): fix grace note
+       nesting by initting measurePosition.
+
+       * lily/timing-translator.cc (initialize): do no init
+       measurePosition
+       
+       * lily/include/music-output-def.hh (class Music_output_def): add
+       input_origin_ field.
+
+       * Documentation/user/changing-defaults.itely (Changing context
+       properties on the fly): new node.
+
+       * lily/include/ly-smobs.icc (free_smob): remove smobbed_self()
+       function. Only have smobbed_copy (), and do not provide
+       smobbed_copy() for non-simple smobs. Changes throughout.
+
+2004-03-17  Han-Wen Nienhuys   <hanwen@xs4all.nl>
+
+       * lily/auto-change-iterator.cc (class Auto_change_iterator): add
+       start_moment_. Fix by Doug A. Linhardt.
+
 2004-03-16  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * lily/accidental-engraver.cc (acknowledge_grob): don't suppress
+       accidentals for harmonic notes.
+
+       * lily/note-collision.cc (check_meshing_chords): don't merge heads
+       fo different style. (Thanks to Doug Linhardt).
+
        * Documentation/user/changing-defaults.itely (Scheme tutorial):
        new node.
 
index 79a7c805b3dd10f49f90151fc05b700ed65f9107..d892ff97f5592557b70ea815e4a5d1f5a7b7e7f8 100644 (file)
@@ -21,9 +21,12 @@ There are X areas where the default settings may be changed:
 
 @itemize @bullet
 @item Output: changing the appearance of individual
-  objects
-@item Context: changing the translation from music events to
-  notation
+  objects. For example, changing stem directions, or the location of
+  subscripts.
+  
+@item Context: changing aspects of the translation from music events to
+  notation. For example, giving each staff a separate time signature. 
+  
 @item Global layout: changing the appearance of the spacing, line
   breaks and page dimensions.
 @end itemize
@@ -33,16 +36,15 @@ Then, there are separate systems for typesetting text (like
 discusses these.
 
 Internally, LilyPond uses Scheme (a LISP dialect) to provide
-infrastructure.  Since overriding layout decisions in effect
-accesses the program internals,  it is necessary to learn a (very
-small) subset of Scheme. That is why this chapter starts with
-a short tutorial on entering  numbers,  lists, strings and symbols in
-Scheme.
+infrastructure.  Overriding layout decisions in effect accesses the
+program internals, so it is necessary to learn a (very small) subset
+of Scheme. That is why this chapter starts with a short tutorial on
+entering numbers, lists, strings and symbols in Scheme.
 
 
 @menu
 * Scheme tutorial::             
-* Setting variables::           
+* Context ::                    
 * Fine tuning layout::          
 * Tuning output::               
 * Text markup::                 
@@ -165,16 +167,21 @@ The quote mark @code{'} prevents Scheme interpreter from substituting
 @code{twentyFour}.
 
 This syntax will be used very frequently, since many of the layout
-tweaks involve assigning (Scheme) values to variables, for example
+tweaks involve assigning (Scheme) values to internal variables, for
+example
 
 @example
-  \override Stem #'thickness = #2.5
+  \override Stem #'thickness = #2.6
 @end example
 
-This instruction adjusts the appearance of stems. The value @code{2.5}
+This instruction adjusts the appearance of stems. The value @code{2.6}
 is put into a the @code{thickness} variable of a @code{Stem}
 object. This makes stems almost twice as thick as their normal size.
+To distinguish between variables defined in input files (like
+@code{twentyFour} in the example above), and internal variables, we
+will call the latter ``properties.'' So, the stem object has a
+@code{thickness} property.
+
 Two-dimensional offsets (X and Y coordinates) as well as object sizes
 (intervals with a left and right point) are entered as @code{pairs}. A
 pair@footnote{In Scheme terminology, the pair is called @code{cons},
@@ -197,8 +204,8 @@ The two elements of a pair may be arbitrary values, for example
   #'("blah-blah" . 3.14159265)
 @end example
 
-A list is entered by enclosing its elements in parentheses, and
-adding a quote. . For example,
+A list is entered by enclosing its elements in parentheses, and adding
+a quote. For example,
 @example
   #'(1 2 3)
   #'(1 2 "string" #f)
@@ -210,102 +217,112 @@ and 2). For entering lists, use a quote @code{'} and for
 calculations, do not use a quote. 
 
 Inside a quoted list or pair, there is no need to quote anymore.  The
-following is a pair and a list of symbols respectively.
+following is a pair of symbols, a list of symbols and a list of lists
+respectively,
+
 @example
   #'(stem . head)
   #'(staff clef key-signature)
+  #'((1) (2))
 @end example
 
 
+@node Context 
+@section Context
+
+When music is printed, a lot of things notation elements must be added
+to the input, which is often bare bones.  For example, compare the
+input and output of the following example
+
+@lilypond[verbatim,relative=2]
+  cis4 cis2. g4
+@end lilypond
+
+The input is rather sparse, but in the output, bar lines, accidentals,
+clef and time signature are added. LilyPond @emph{interprets} the
+input. During this step, the musical information is inspected in time
+order, similar to reading a score from left to right. While reading,
+the program remembers where measure boundaries are, and what pitches
+need explicit accidentals. 
+
+This information can be present on several levels.  For example, the
+effect of an accidental is limited to a single stave, while a bar line
+must be synchronized across the entire score.  To match this
+hierarchy, LilyPond's interpretation step is hierarchical. Properties
+are maintained `interpretation contexts', like Voice, Staff and Score,
+and each context can have different @emph{properties}, variables that
+are contained in a context.
+
 @menu
-* Inline Scheme::               
+* Changing context properties on the fly ::  
+* context property defaults ::  
+* which properties to change::  
 @end menu
 
-@node Inline Scheme
-@subsection Inline Scheme
+@node Changing context properties on the fly 
+@subsection Changing context properties  on the fly
 
-Scheme expressions can be entered in the input file by entering a
-hash-sign (@code{#}).  The expression following the hash-sign is
-evaluated as Scheme. For example, the boolean value @var{true} is
-@code{#t} in Scheme, so for LilyPond @var{true} looks like @code{##t},
-and can be used in property assignments:
-@example
-  \set Staff.autoBeaming = ##f
-@end example
+Such variables can be changed during the interpretation step.
+This is achieved by  inserting the @code{\set} command in the music,
 
+@quotation
+  @code{\set }[@var{context}]@code{.}@var{prop}@code{ = #}@var{value} 
+@end quotation
 
-@node Setting variables
-@section Setting variables
+For example,
+@lilypond[verbatim,relative=2]
+  R1*2 
+  \set Score.skipBars = ##t
+  R1*2
+@end lilypond
 
-When the music is converted from notes to print it is interpreted
-in left-to-right order. This is similar to what happens when we read
-music. During this step context-sensitive information such as the
-accidentals to print, and where bar lines must be placed, are stored in
-variables. These variables are called @emph{context properties}.
-The properties can also be manipulated from input files. Consider this input:
-@example
-\set Staff.autoBeaming = ##f
-@end example 
+This command skips measures that have no notes. The result is that
+multi rests are condensed.  The value assigned is a Scheme object. In
+this case, it is @code{#t}, the boolean True value.
 
-@noindent
-It sets the property named @code{autoBeaming} in the current staff at
-this point in the music to @code{##f}, which means `false'. This
-property controls whether beams are printed automatically:
-@c
-@lilypond[relative=1,fragment,verbatim]
+If the @var{context} argument is left out, then the current
+bottom-most context (typically ChordNames, Voice or Lyrics) is used.
+In this example,
+
+@lilypond[verbatim,relative=2]
+  c8 c c c
+  \set autoBeaming = ##f
   c8 c c c
-  \set Staff.autoBeaming = ##f
-  c8 c c c  
 @end lilypond
 
 @noindent
-LilyPond includes a built-in programming language, namely, a dialect
-of Scheme.  The argument to @code{\set}, @code{##f}, is an
-expression in that language.  The first hash-mark signals that a piece
-of Scheme code follows. The second hash character is part of the
-boolean value true (@code{#t}).  Values of other types may be
-entered as follows:
-@itemize @bullet
-@item a string, enclosed in double quotes, for example,
-@example
-  \set Staff.instrument = #"French Horn"
-@end example
-@item a boolean: either @code{#t} or @code{#f}, for true and false
-respectively, e.g.
-@example
-  \set autoBeaming = ##f
-  \set Score.skipBars = ##t
-@end example
+the @var{context} argument to @code{\set} is left out, and the current
+@internalsref{Voice} is used.  Contexts are hierarchical, so if a
+bigger context was specified, for example @code{Staff}, then the
+change would apply to all Voices in the current stave.
 
-@item a number, such as
-@example
-  \set Score.currentBarNumber = #20
-@end example
+There is also an @code{\unset} command,
+@quotation
+  @code{\set }[@var{context}]@code{.}@var{prop}
+@end quotation
+
+@noindent
+which removes the definition of @var{prop}. This command only removes
+definitions  set in
+@var{context}. in
 
-@item a symbol, which is introduced by a quote character, as in 
 @example
-  \set Staff.crescendoSpanner = #'dashed-line
+  \set staff.autobeaming = ##f
+  \unset voice.autobeaming
 @end example
 
-@item a pair, which is also introduced by a quote character, like in
-the following statements, which set properties to the pairs (-7.5, 6) 
-and (3, 4) respectively:
+@noindent
+the current voice does not have the property, and the definition at
+staff level remains intact.
 
-@example
-  \set Staff.minimumVerticalExtent = #'(-7.5 . 6)
-  \set Staff.timeSignatureFraction = #'(3 . 4)
-@end example
+@node context property defaults 
+@subsection context property defaults
 
-@item a list, which is also introduced by a quote character. In the
-following example, the @code{breakAlignOrder} property is set to a
-list of symbols:
-@example
-  \set Score.breakAlignOrder = 
- #'(left-edge time-signature key-signatures)
-@end example
 
 
-@end itemize
+@node which properties to change
+@subsection which properties to change
+
 
 There are many different properties.  Not all of them are listed in
 this manual. However, the program reference lists them all in the
diff --git a/THANKS b/THANKS
index f1b6588dff825b5b9c5def1ba120f25ddfd39445..5662f687c0b44a9bbdd16fcb32232bb898e3e105 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -21,6 +21,7 @@ Dave Symonds
 David Bobroff
 Darius
 Delma Avers
+Doug Linhardt
 Edward Sanford Sutton
 Eric Wurbel
 Erik Sandberg
diff --git a/VERSION b/VERSION
index 11e9092e6912fce9ed65a76f3b1673f696d43499..b5127802c36f3313917dea9a175659ecc04f9c53 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,5 +2,5 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=2
 MINOR_VERSION=1
 PATCH_LEVEL=31
-MY_PATCH_LEVEL=
+MY_PATCH_LEVEL=hwn1
 
index a1b999f0cdda4c656719f0bac3a31cc2db2181ce..17ce4ee7e45b7f924cf39836772a8c0984eba22b 100644 (file)
@@ -78,7 +78,7 @@ spaceTest = \markup { "two space chars" }
 
 \score {
     \context Staff \notes \relative c' {
-       \repeat unfold 35 { a b c d \break }
+       \repeat unfold 135 { a b c d \break }
        c1
     }
 }
index 51c95b99c5a11280a4ecc1e599faf009da1ffc18..52b5c13e02cd5727cbfe50e4274f8f4299028f07 100644 (file)
@@ -439,7 +439,13 @@ Accidental_engraver::acknowledge_grob (Grob_info info)
   if (note
       && note->is_mus_type ("note-event")
       && Rhythmic_head::has_interface (info.grob_)
-      && !gh_equal_p (info.grob_->get_property ("style"), ly_symbol2scm ("harmonic"))
+#if 0
+      /*
+       todo: make tunable.
+       */
+           && !gh_equal_p (info.grob_->get_property ("style"),
+                          ly_symbol2scm ("harmonic"))
+#endif
       )
     {
       Accidental_entry entry ;
index ad5d5437b1fe7a4fac1657e10f140b731d0fe529..69b2d890bb7d48a829e6f3082c6cfd6faf05f7e7 100644 (file)
@@ -28,6 +28,7 @@ private:
   SCM split_list_;
   Direction where_dir_;
   void change_to (Music_iterator* , SCM, String);
+  Moment start_moment_;
 };
 
 
@@ -93,9 +94,10 @@ Auto_change_iterator::process (Moment m)
   for (; gh_pair_p (split_list_); split_list_ = gh_cdr (split_list_))
     {
       splitm = unsmob_moment (gh_caar (split_list_));
-      if (*splitm > now)
+      if ((*splitm + start_moment_) > now)
        break ;
 
+      *splitm += start_moment_;
       SCM tag = gh_cdar (split_list_);
       Direction d = to_dir  (tag);
       
@@ -121,6 +123,7 @@ Auto_change_iterator::construct_children ()
 {
   Music_wrapper_iterator::construct_children ();
   split_list_ =  get_music ()->get_property ("split-list");
+  start_moment_ = get_outlet ()->now_mom ();
 }
 
 IMPLEMENT_CTOR_CALLBACK (Auto_change_iterator);
index 06149d48b6021f430686edc0f7dfb22b9d272040..a85bf11093728113a995f4233a83aac1facf2c21 100644 (file)
@@ -220,13 +220,6 @@ LY_DEFINE (compression_factor, "ly:duration-factor",
   return gh_cons (gh_int2scm (r.num ()), gh_int2scm (r.den ()));
 }
 
-SCM
-Duration::smobbed_copy () const
-{
-  Duration *p = new Duration (*this);
-  return p->smobbed_self ();
-}
-
 int
 Duration::duration_log () const
 {
index 5c273a1893679a76d6565f4455e06dd187d1adb2..53d60a549d90766aca4791a147cee7c4d94a17df 100644 (file)
@@ -127,6 +127,16 @@ Global_context::run_iterator_on_me (Music_iterator * iter)
       if (w.main_part_.is_infinity ())
        break ;
       
+      if (first)
+        {
+         /*
+           Need this to get grace notes at start of a piece correct.
+          */
+          first = false;
+          set_property ("measurePosition", w.smobbed_copy ());
+        }
+
+
       prepare (w);
 
       if (iter->ok ())
@@ -148,7 +158,6 @@ Global_context::run_iterator_on_me (Music_iterator * iter)
        }
       
       one_time_step ();
-      first = false;
     }
 }
 
diff --git a/lily/global-translator.cc b/lily/global-translator.cc
deleted file mode 100644 (file)
index e69de29..0000000
index e20e28a5c84292588791ce909d94340ad86b2486..6d8667febbf83ac7bcf69cb514406fd92dc8b817 100644 (file)
@@ -32,7 +32,6 @@ public:
 
   static int compare (Duration const&, Duration const&);
 
-  SCM smobbed_copy () const;
   DECLARE_SCHEME_CALLBACK (less_p, (SCM a, SCM b));
   DECLARE_SIMPLE_SMOBS (Duration,);
 
index 3875b2c4a18617bd2c7f4343dcd0dec60e687053..7e93c837f3638902448296c88229e3daddec0735 100644 (file)
@@ -31,7 +31,7 @@ ADD_SCM_INIT_FUNC (init_type_ ## CL, init_type_ ## CL)
 
 
 
-#define IMPLEMENT_SIMPLE_SMOBS(CL)                             \
+#define IMPLEMENT_BASE_SMOBS(CL)                               \
 scm_t_bits CL::smob_tag_;                                       \
 SCM                                                            \
 CL::smob_p (SCM s)                                             \
@@ -51,14 +51,6 @@ CL::init_smobs ()                                            \
   scm_set_smob_print (smob_tag_, CL::print_smob);               \
   scm_set_smob_equalp (smob_tag_, CL::equal_p);                 \
 }                                                              \
-SCM CL::smobbed_self () const                                  \
-{                                                              \
-  SCM s;                                                       \
-  s = gh_cons (SCM_PACK (CL::smob_tag_), SCM_PACK (this));     \
-  scm_gc_register_collectable_memory ((CL*)this, sizeof (CL), #CL " smob");                            \
-                                                               \
-  return s;                                                    \
-}                                                              \
 size_t                                                         \
 CL::free_smob (SCM ses)                                                \
 {                                                              \
@@ -69,8 +61,22 @@ CL::free_smob (SCM ses)                                              \
 }\
 ADD_SCM_INIT_FUNC (CL, CL::init_smobs)
 
+
+#define IMPLEMENT_SIMPLE_SMOBS(CL)                             \
+IMPLEMENT_BASE_SMOBS(CL);\
+SCM CL::smobbed_copy () const                                  \
+{                                                              \
+  CL * ptr  = new CL (*this);\
+  SCM s;                                                       \
+  s = gh_cons (SCM_PACK (CL::smob_tag_), SCM_PACK (ptr));      \
+  scm_gc_register_collectable_memory ((CL*)this, sizeof (CL), #CL " smob"); \
+                                                               \
+  return s;                                                    \
+}                                                              \
+
+
 #define IMPLEMENT_SMOBS(CL)                                                    \
-IMPLEMENT_SIMPLE_SMOBS (CL)                                                    \
+IMPLEMENT_BASE_SMOBS (CL)                                                      \
 SCM                                                                            \
 CL::smobify_self ()                                                            \
 {                                                                              \
index 1cfd6a88ec937e16589b5ad3a58ed36663376415..b735ce4c4d967c4d42b46f50832a44afd5ef7812 100644 (file)
@@ -46,7 +46,6 @@ public:
   /*
     Deliver a copy of THIS as a smobified SCM
    */
-  SCM smobbed_copy () const;
   String to_string () const;
   static int compare (Moment const&, Moment const&);
   
index 9bab78f80f54e284fb31ae13681d4e3b735a0b0e..53c9bdcf65ac870b5c9635654fb645595da94906 100644 (file)
 #include "lily-guile.hh"
 #include "virtual-methods.hh"
 #include "smobs.hh"
+#include "input.hh"
 
 /**
   Definition of how to output lilypond.
  */
-class Music_output_def  
+class Music_output_def   
 {
 public:
   Scheme_hash_table * translator_tab_;
-
+  Input input_origin_;
+  
   SCM scope_;
   SCM scaled_fonts_;
   
index 06b9761e7978243f0c805b3da08c25581ce6f2db..71f0ad1ccea2ee562065c3dae28cff7dc7279a8d 100644 (file)
@@ -65,8 +65,6 @@ public:
   /* JUNKME   */
   Real get_realvar (SCM symbol) const;
   
-  SCM smobbed_copy () const;
-  
   friend int yyparse (void*);
 };
 
index 6dd51fa6306144a77650df248f3225dbcbc59efd..d0372d04fc78916b0389092a19c9dfa54f072fca 100644 (file)
@@ -17,13 +17,12 @@ class Paper_line
   SCM stencils_;
   Offset dim_;
   bool is_title_;
-  DECLARE_SIMPLE_SMOBS (Paper_line,);
+  DECLARE_SMOBS (Paper_line,);
   
 public:
   Paper_line (Offset, SCM, bool = true);
 
   Offset dim () const;
-  SCM smobbed_copy () const;
   SCM stencils () const;
   bool is_title () const;
 };
index 8a7f276aba7f454aaec6689e45b16e8afd88653f..db31415fad37d9420cceaa223bf3c97a805486e3 100644 (file)
@@ -61,7 +61,6 @@ public:
   int quartertone_pitch () const; 
   String to_string () const;
 
-  SCM smobbed_copy () const;
   DECLARE_SCHEME_CALLBACK (less_p, (SCM a, SCM b));
   DECLARE_SIMPLE_SMOBS (Pitch,);
 };
index c0155ee1fd771f3aef54c179dda33dcbd4437d37..c9e96ae34aba8caf74aa3a9e03366b2bba2373a5 100644 (file)
 */
 
 #define DECLARE_SIMPLE_SMOBS(CL,dummy) \
-protected: \
+public: \
+       SCM smobbed_copy () const; \
+DECLARE_BASE_SMOBS(CL)
+
+
+#define DECLARE_BASE_SMOBS(CL) \
        friend class Non_existant_class ; \
-       SCM smobbed_self () const; \
 private:\
        static scm_t_bits smob_tag_;                            \
        static SCM mark_smob (SCM);                             \
@@ -122,7 +126,7 @@ private:
 
 
 #define DECLARE_SMOBS(CL,dummy)                                        \
-       DECLARE_SIMPLE_SMOBS (CL,dammy) \
+       DECLARE_BASE_SMOBS (CL) \
 protected:\
        virtual ~CL ();\
        SCM unprotected_smobify_self ();\
index 951f61f29d653274eb921e024780ba8cf76d93fe..0decf664f7c57509747bd15b52a8870c0926a517 100644 (file)
@@ -23,7 +23,6 @@ struct Spring_smob
   
   DECLARE_SIMPLE_SMOBS(Spring_smob,dummy);
 public:
-  SCM smobbed_copy () const;
   Spring_smob();
 };
 DECLARE_UNSMOB(Spring_smob, spring);
index 8f10fd6ba3627e3055a2513848dd35da9515d20a..41f495e9982c5935f08c278a694533e999a3fda5 100644 (file)
@@ -53,7 +53,6 @@ public:
   Stencil ();
   
   Offset origin () const;
-  SCM smobbed_copy () const;
   SCM get_expr () const;
 
   /**
index 03bd7df4e1df6a9a25555789aa8d93b66a859ceb..57fc8b65352df592feab2def87fa51928bc006e3 100644 (file)
@@ -23,12 +23,6 @@ Moment::mark_smob (SCM)
 }
 
 
-SCM
-Moment::smobbed_copy () const
-{
-  Moment * m = new Moment (*this);
-  return m->smobbed_self ();
-}
 
 
 int
index 1432c27564c9c7a843ef6f09704d376f766b693e..3da3de58c95234d1ab52efb57a5d286b631558e2 100644 (file)
@@ -71,6 +71,13 @@ check_meshing_chords (Grob *me,
   // FIXME: what's this?
   bool merge_possible = (ups[0] >= dps[0]) && (ups.top () >= dps.top ());
 
+
+
+  /* Do not merge notes typeset in different style. */
+  if ( !gh_equal_p (nu->get_property ("style"),
+                    nd->get_property ("style") ) )
+    merge_possible = false;
+  
   int upball_type = Note_head::get_balltype (nu);
   int dnball_type = Note_head::get_balltype (nd);
   
index 83653b6804325b4b72129c04ab40fe93235061e0..edb4396d2d6cc29fe7d485b63231a8126c9192cd 100644 (file)
@@ -29,8 +29,8 @@ stencil2line (Stencil* stil, bool is_title = false)
     z = scm_permanent_object (ly_offset2scm (Offset (0, 0)));
   Offset dim = Offset (stil->extent (X_AXIS).length (),
                       stil->extent (Y_AXIS).length ());
-  Paper_line pl (dim, scm_cons (stil->smobbed_copy (), SCM_EOL), is_title);
-  return pl.smobbed_copy ();
+  Paper_line * pl = new Paper_line (dim, scm_cons (stil->smobbed_copy (), SCM_EOL), is_title);
+  return pl->self_scm ();
 }
 
 /* Simplistic page interface */
@@ -100,13 +100,13 @@ Page::Page (Paper_def *paper, int number)
   SCM make_header = scm_primitive_eval (ly_symbol2scm ("make-header"));
   SCM make_footer = scm_primitive_eval (ly_symbol2scm ("make-footer"));
 
-  header_ = scm_call_2 (make_header, paper_->smobbed_copy (),
+  header_ = scm_call_2 (make_header, paper_->self_scm (),
                        scm_int2num (number_));
   // FIXME: why does this (generates Stencil) not trigger font load?
   if (get_header ())
     get_header ()->align_to (Y_AXIS, UP);
     
-  footer_ = scm_call_2 (make_footer, paper_->smobbed_copy (),
+  footer_ = scm_call_2 (make_footer, paper_->self_scm (),
                        scm_int2num (number_));
   if (get_footer ())
     get_footer ()->align_to (Y_AXIS, UP);
@@ -284,14 +284,14 @@ Paper_book::init ()
   SCM scopes = get_scopes (0);
 
   SCM make_tagline = scm_primitive_eval (ly_symbol2scm ("make-tagline"));
-  tagline_ = scm_call_2 (make_tagline, paper->smobbed_copy (), scopes);
+  tagline_ = scm_call_2 (make_tagline, paper->self_scm (), scopes);
   Real tag_height = 0;
   if (Stencil *s = unsmob_stencil (tagline_))
     tag_height = s->extent (Y_AXIS).length ();
   height_ += tag_height;
 
   SCM make_copyright = scm_primitive_eval (ly_symbol2scm ("make-copyright"));
-  copyright_ = scm_call_2 (make_copyright, paper->smobbed_copy (), scopes);
+  copyright_ = scm_call_2 (make_copyright, paper->self_scm (), scopes);
   Real copy_height = 0;
   if (Stencil *s = unsmob_stencil (copyright_))
     copy_height = s->extent (Y_AXIS).length ();
index 198cd00e6ed4adab5f7bc6bc5d1b944b062c01ed..fec208899a676bb6ae415848de2a559550dba678 100644 (file)
@@ -149,11 +149,4 @@ unsmob_paper (SCM x)
 {
   return dynamic_cast<Paper_def*> (unsmob_music_output_def (x));
 }
-
-SCM
-Paper_def::smobbed_copy () const
-{
-  Paper_def *p = new Paper_def (*this);
-  return p->smobbed_self ();
-}
   
index e4da3cb548337bba2cf5120c3466e0f1c67b4d18..38572f48b7ee7a3eeee4a7308f6b3ff81b4dfbe9 100644 (file)
@@ -14,6 +14,7 @@ Paper_line::Paper_line (Offset o, SCM stencils, bool is_title)
   dim_ = o;
   stencils_ = stencils;
   is_title_ = is_title;
+  smobify_self ();
 }
 
 Offset
@@ -49,13 +50,10 @@ Paper_line::print_smob (SCM, SCM port, scm_print_state*)
   return 1;
 }
 
-SCM
-Paper_line::smobbed_copy () const
+Paper_line::~Paper_line ()
 {
-  Paper_line *line = new Paper_line (*this);
-  return line->smobbed_self ();
 }
 
-IMPLEMENT_SIMPLE_SMOBS (Paper_line);
+IMPLEMENT_SMOBS (Paper_line);
 IMPLEMENT_TYPE_P (Paper_line, "ly:paper-line?");
 IMPLEMENT_DEFAULT_EQUAL_P (Paper_line);
index ef4ee306327af2ba0631b00e3f12cc6c4e54945f..2760ec2ae650f07a66d2bdd09921424a06493b9d 100644 (file)
@@ -684,12 +684,15 @@ music_output_def_head:
 
 
 music_output_def_body:
-       music_output_def_head '{' { 
+       music_output_def_head '{' {
+               $$ = $1;
+               $$->input_origin_. set_spot (THIS->here_input ());
                
        }
        | music_output_def_head '{' MUSIC_OUTPUT_DEF_IDENTIFIER         {
                scm_gc_unprotect_object ($1->self_scm ());
                Music_output_def * o =  unsmob_music_output_def ($3);
+               o->input_origin_.set_spot (THIS->here_input ());
                $$ = o;
                THIS->lexer_->remove_scope ();
                THIS->lexer_->add_scope (o->scope_);
index 415adef5b998171e837d1cb0d14985975102e69b..1867a0b532b20514436e3f0622a82c85d4758326 100644 (file)
@@ -396,12 +396,6 @@ LY_DEFINE (ly_pitch_diff, "ly:pitch-diff",
   return interval (*r, *p).smobbed_copy ();
 }
 
-SCM
-Pitch::smobbed_copy ()const
-{
-  Pitch *p = new Pitch (*this);
-  return p->smobbed_self ();
-}
 
 int
 Pitch::get_octave ()const
index 502fc13f713e46334e53bc98076abbb8727f86ac..591953b0359cf6c175a22c400490f1b8e84cad92 100644 (file)
@@ -39,9 +39,3 @@ Spring_smob::equal_p (SCM a , SCM b)
   return a==b? SCM_BOOL_T : SCM_BOOL_F;
 }
 
-SCM
-Spring_smob::smobbed_copy ()const
-{
-  Spring_smob *  p = new Spring_smob (*this);
-  return p->smobbed_self ();
-}
index 1a6f21e104071939c049219c50db32a98dc26574..fade2d75ea0d55a86cd2c35677e3fa71dc586d1e 100644 (file)
 
 #include "ly-smobs.icc"
 
-SCM
-Stencil::smobbed_copy () const
-{
-  Stencil *s = new Stencil (*this);
-  return s->smobbed_self ();
-}
 
 Offset
 Stencil::origin () const
index 0434a75fcda25d21efa64f347d6243a53b45b7e4..42285df9133664648168eb730d2d731302dae4b0 100644 (file)
@@ -430,8 +430,8 @@ System::get_line ()
 
   Interval x (extent (this, X_AXIS));
   Interval y (extent (this, Y_AXIS));
-  Paper_line pl (Offset (x.length (), y.length ()), stencils);
-  return pl.smobbed_copy ();
+  Paper_line *pl = new Paper_line (Offset (x.length (), y.length ()), stencils);
+  return pl->self_scm ();
 }
 
 Link_array<Item> 
index 85bffc00b68b252df5a0b06522e5df954c936423..6c79df545523a4fbc9d3d922a404b2146f71563e 100644 (file)
@@ -55,7 +55,10 @@ Timing_translator::initialize ()
 
   daddy_context_->set_property ("timeSignatureFraction",
                                gh_cons (gh_int2scm (4), gh_int2scm (4)));
-  daddy_context_->set_property ("measurePosition", Moment (Rational (0)).smobbed_copy ());
+  /*
+    Do not init measurePosition; this should be done from global
+    context.
+   */
   daddy_context_->set_property ("measureLength", Moment (Rational (1)).smobbed_copy ());
   daddy_context_->set_property ("beatLength", Moment (Rational (1,4)).smobbed_copy ());
 }
index cc54d9c9617fc1a053da13ef19c725d57f61f0af..6cdc3656c841d64a84d049e204bd9d822afcfb37 100644 (file)
@@ -7,7 +7,7 @@
 
 ;;; Library functions
 
-
+(set-debug-cell-accesses! #t)
 (use-modules (ice-9 regex)
             (ice-9 safe)
             (oop goops)
@@ -371,9 +371,17 @@ L1 is copied, L2 not.
             (scm output-sodipodi)
             (scm output-pdftex))
 
+
+(define output-tex-module
+  (make-module 1021 (list (resolve-interface '(scm new-output-tex)))))
+
+(define (new-tex-output-expression expr port)
+  (display (eval expr output-tex-module) port))
+
 (define output-alist
   `(
     ("tex" . ("TeX output. The default output form." ,tex-output-expression))
+    ("safetex" . ("TeX output. The default output form." ,new-tex-output-expression))
     ("scm" . ("Scheme dump: debug scheme stencil expressions" ,write))
     ("sketch" . ("Bare bones Sketch output." ,sketch-output-expression))
     ("sodipodi" . ("Bare bones Sodipodi output." ,sodipodi-output-expression))
index 41d48ef03bcdfbe6ccd9f08c009a67918638098c..afaa04021b8668a492e3d0d90986ce687e66d89a 100644 (file)
@@ -28,6 +28,7 @@
   (display (eval expr output-ps) port))
 
 ;;; Output interface entry
+
 (define-public (tex-output-expression expr port)
   (display (eval expr this-module) port ))