]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.3.73
authorfred <fred>
Tue, 26 Mar 2002 23:24:50 +0000 (23:24 +0000)
committerfred <fred>
Tue, 26 Mar 2002 23:24:50 +0000 (23:24 +0000)
146 files changed:
Documentation/faq.texi
Documentation/regression-test.tely
flower/include/input.hh
flower/include/source-file.hh
flower/input.cc
input/minimal.ly [new file with mode: 0644]
lily/align-note-column-engraver.cc
lily/auto-beam-engraver.cc
lily/axis-group-engraver.cc
lily/axis-group-interface.cc
lily/bar-engraver.cc
lily/bar-number-engraver.cc
lily/beam-engraver.cc
lily/break-align-engraver.cc
lily/breathing-sign-engraver.cc
lily/change-iterator.cc
lily/chord-name-engraver.cc
lily/chord-tremolo-engraver.cc
lily/chord-tremolo-iterator.cc
lily/clef-engraver.cc
lily/collision-engraver.cc
lily/command-request.cc
lily/debug.cc
lily/dot-column-engraver.cc
lily/dynamic-engraver.cc
lily/engraver-group-engraver.cc
lily/engraver.cc
lily/extender-engraver.cc
lily/folded-repeat-iterator.cc
lily/gourlay-breaking.cc
lily/hyphen-engraver.cc
lily/identifier.cc
lily/include/chord-tremolo-iterator.hh
lily/include/command-request.hh
lily/include/engraver.hh
lily/include/folded-repeat-iterator.hh
lily/include/hara-kiri-engraver.hh
lily/include/identifier.hh
lily/include/input-smob.hh [new file with mode: 0644]
lily/include/item.hh
lily/include/lily-guile.hh
lily/include/local-key-item.hh
lily/include/ly-smobs.icc
lily/include/lyric-combine-music-iterator.hh
lily/include/lyric-combine-music.hh
lily/include/molecule.hh
lily/include/music-iterator.hh
lily/include/music-list.hh
lily/include/music-sequence.hh [new file with mode: 0644]
lily/include/music-wrapper-iterator.hh
lily/include/music-wrapper.hh
lily/include/music.hh
lily/include/output-property.hh
lily/include/paper-outputter.hh
lily/include/paper-score.hh
lily/include/repeated-music.hh
lily/include/request-chord-iterator.hh
lily/include/score-element.hh
lily/include/score.hh
lily/include/sequential-music-iterator.hh
lily/include/simultaneous-music-iterator.hh
lily/include/spanner.hh
lily/include/translation-property.hh
lily/include/translator-group.hh
lily/include/unfolded-repeat-iterator.hh
lily/input-smob.cc [new file with mode: 0644]
lily/instrument-name-engraver.cc
lily/item.cc
lily/key-engraver.cc
lily/key-performer.cc
lily/lexer.ll
lily/line-group-group-engraver.cc
lily/line-number-engraver.cc
lily/local-key-engraver.cc
lily/local-key-item.cc
lily/lyric-combine-music-iterator.cc
lily/lyric-combine-music.cc
lily/lyric-engraver.cc
lily/mark-engraver.cc
lily/multi-measure-rest-engraver.cc
lily/music-iterator.cc
lily/music-list.cc
lily/music-sequence.cc
lily/music-wrapper-iterator.cc
lily/music-wrapper.cc
lily/music.cc
lily/my-lily-parser.cc
lily/note-heads-engraver.cc
lily/note-name-engraver.cc
lily/output-property-engraver.cc
lily/output-property.cc
lily/paper-def.cc
lily/paper-outputter.cc
lily/paper-score.cc
lily/parser.yy
lily/performer-group-performer.cc
lily/piano-pedal-engraver.cc
lily/piano-pedal-performer.cc
lily/property-iterator.cc
lily/relative-octave-music.cc
lily/repeat-engraver.cc
lily/repeated-music.cc
lily/request-chord-iterator.cc
lily/request-iterator.cc
lily/rest-collision-engraver.cc
lily/rest-engraver.cc
lily/rhythmic-column-engraver.cc
lily/score-element.cc
lily/score-engraver.cc
lily/score.cc
lily/script-column-engraver.cc
lily/script-engraver.cc
lily/separating-line-group-engraver.cc
lily/sequential-music-iterator.cc
lily/simultaneous-music-iterator.cc
lily/slur-engraver.cc
lily/spacing-engraver.cc
lily/span-bar-engraver.cc
lily/span-dynamic-performer.cc
lily/spanner.cc
lily/staff-symbol-engraver.cc
lily/stem-engraver.cc
lily/system-start-delimiter-engraver.cc
lily/text-engraver.cc
lily/tie-engraver.cc
lily/tie-performer.cc
lily/time-scaled-music-iterator.cc
lily/time-signature-engraver.cc
lily/timing-translator.cc
lily/translation-property.cc
lily/translator-group.cc
lily/tuplet-engraver.cc
lily/unfolded-repeat-iterator.cc
ly/init.ly
mf/feta-nummer-code.mf [new file with mode: 0644]
mf/feta-nummer.mf
mf/feta-nummer10.mf
mf/feta-nummer12.mf
mf/feta-nummer14.mf [new file with mode: 0644]
mf/feta-nummer3.mf
mf/feta-nummer4.mf
mf/feta-nummer5.mf
mf/feta-nummer6.mf
mf/feta-nummer7.mf
mf/feta-nummer8.mf
scm/lily.scm

index aa35683a343ff4f11766f5dd0308b0a72a3857e6..ae735e482b25965f83ce8e1b7c3a13a8238dc42f 100644 (file)
@@ -2,16 +2,9 @@
 @setfilename faq.info
 @settitle FAQ - GNU LilyPond FAQs
 
-@node Top, , Windows32, (dir)
+@node Top, , , (dir)
 @top
 @menu
-* FAQ - GNU LilyPond FAQs::       FAQ - GNU LilyPond FAQs
-@end menu
-
-
-
-@node FAQ - GNU LilyPond FAQs, Miscellaneous, , Top
-@menu
 * Miscellaneous::                 Miscellaneous
 * Installing::                    Installing
 * Documentation::                 Documentation
@@ -26,7 +19,7 @@
 @chapter FAQ - GNU LilyPond FAQs
 
 
-@node Miscellaneous, Installing, FAQ - GNU LilyPond FAQs, FAQ - GNU LilyPond FAQs
+@node Miscellaneous, ,,top
 @section Miscellaneous
 
 @subsubsection HELP! I'm stuck!
@@ -37,7 +30,7 @@ directly.
 
 Note: relative paths are meant to be relative to the source directory
 
-@node Installing, Documentation, Miscellaneous, FAQ - GNU LilyPond FAQs
+@node Installing,, ,top
 @section Installing
 
 
@@ -88,21 +81,23 @@ Metafont when you run TeX.  Check your TeX installation, or ask
 your local TeX guru.  The supplied @file{.afm} files are intended to
 be used by LilyPond, not by any other programs.
 
-@node Documentation, Language- mudela, Installing, FAQ - GNU LilyPond FAQs
+@node Documentation,, ,top
 @section Documentation
 
 @subsubsection What a sober website/manual you have there!
 
-LilyPond development is moving quite fast, documentation will often lag
-a bit behind.  But don't hesitate to point out inaccuracies. Whip up
-your mail reader and write to the mailing list.
+LilyPond development is moving fast, so the documentation will often be out
+of date.  But don't hesitate to point out inaccuracies. Whip up your
+mail reader and write to the mailing list.
 
 @subsubsection Please take me off your mailing list, I get  so much mail!
 
 Don't ask Han-wen, don't ask David. Instead, read about
 @uref{../../index.html#mailing-lists,  the mailing lists} here.
 
-@node Language- mudela, Do you support -, Documentation, FAQ - GNU LilyPond FAQs
+
+
+@node Language- mudela,, ,top
 @section Language: mudela
 
 @subsubsection Why do I have to type the accidentals to the note if I
@@ -150,7 +145,7 @@ of (x,y) positions and symbols.  You can only sensibly do TeX stuff in
 the symbol string.  You can access the symbol string easily for some
 symbols (notably lyrics and @code{^"text"} commands).
 
-@node Do you support -,  How do I -, Language- mudela, FAQ - GNU LilyPond FAQs
+@node Do you support -,, ,top
 @section Do you support ...
 
 @subsubsection Do you support pop songs (chords, single staff, lyrics)?
@@ -183,7 +178,7 @@ No.
 
 Yes. See @file{input/test/grace.ly}.
 
-@node How do I -, Development, Do you support -, FAQ - GNU LilyPond FAQs
+@node How do I -,, ,top
 @section How do I ....
 
 @subsubsection How do I change the TeX layout?
@@ -324,7 +319,7 @@ will do the trick for you:
 @end  example
 
 
-@node Development, Running, How do I -, FAQ - GNU LilyPond FAQs
+@node Development,, ,top
 @section Development
 
 @subsubsection Could you implement feature XXXX? It is really easy, just extend the syntax to allow YYYY!
@@ -398,9 +393,63 @@ end
 
 Upgrade/downgrade to 4.17.
 
-@node Running, Copyright, Development, FAQ - GNU LilyPond FAQs
+@node Running,, ,top
 @section Running
 
+@subsubsection Correcting errors is so tedious. Is there a better way?
+
+As of 1.3.73, lilypond provides support for the xdvi @code{src:}
+special. This can be used with Xdvik (22.16 or better) and xdvi (22.28
+or better) to go to the place in the input that corresponds to a symbol
+in the output.
+
+lilypond:
+
+Decide if you want column positioning, and edit @file{lily.scm}
+according to the comments at the function @code{define-origin}.
+
+emacs:
+
+Put this in @file{~/.emacs}:
+@example
+(server-start)
+@end example
+
+For column positioning, apply @uref{this
+patch,http://www.cs.uu.nl/~hanwen/software/emacsclient-column} to
+@code{emacsclient.c} and @code{server.el}. Stick the compiled
+emacsclient into a bin directory, and put @code{server.el} into a elisp
+directory (eg. @file{~/usr/share/emacs/}). Add the following to your
+@file{.emacs} init file, before invoking server-start.
+@example
+(setq load-path (cons (concat (getenv "HOME") "/usr/share/emacs")
+ load-path))
+@end example
+
+Xdvik:
+
+Warning: @uref{Xdvik,ftp://ftp.cs.uu.nl/pub/tex-archive/dviware/xdvik/},
+which is shipped with most TeX distributions, doesn't work very well for
+src specials. You're better off using plain xdvi.
+@example
+       xdvi -srcmode -srcvisibility output.dvi
+@end example
+
+Click control-mouse button 2 for making emacs jump to the appropriate place.
+
+For column positioning you must install this @uref{patch,
+http://www.cs.uu.nl/~hanwen/software/xdvik-src} to make Xdvik emit
+column numbers. Add the command line option @code{-srceditorcommand
+"emacsclient --no-wait +%l:%c %f"}
+
+Xdvi
+
+@uref{Xdvi,ftp://ftp.math.berkeley.edu/pub/Software/TeX/xdvi.tar.gz} has
+better support for src specials. Apply @uref{this patch,
+http://www.cs.uu.nl/~hanwen/software/xdvi-src}. When viewing,
+control-mousebutton 1 will take you to the correct line/column. 
+
+
 @subsubsection I use dvilj4, and there are lots of warning messages for the printing
 
 You should use dvips and ghostscript to print the @code{dvi} output: the
@@ -492,7 +541,7 @@ The MIDI output was originally put in as a proof that MIDI could be
 done, and as a method of proof"reading" the input.  The MIDI support
 is by no means finished.  Patches appreciated.
 
-@node Copyright, Windows32, Running, FAQ - GNU LilyPond FAQs
+@node Copyright,, ,top
 @section Copyright
 
 @subsubsection What is Urtext?  Critical Edition?
@@ -646,7 +695,7 @@ for a summary of copyright relative to old music, also for the
 expert forum for such subsubsections.
 
 
-@node Windows32, Top, Copyright, FAQ - GNU LilyPond FAQs
+@node Windows32,, ,top
 @section Windows32
 
 @subsubsection I downloaded the windows32 port, and it doesn't match the website!
index 9cdf84384116c188709400d8ea5db45a08b662ea..0e745b244f1b4717ed311193e4ce320d58da7eb4 100644 (file)
@@ -287,7 +287,6 @@ between note and accidentals is less than between the notes with the
 same value.  Clef changes also get extra space, but not as much as
 barlines.
 
-
 Even if a line is very tightly spaced, there will still be room
 between prefatory matter and the following notes.  The space after the
 prefatory is very rigid.  In contrast, the space before the barline
@@ -380,6 +379,9 @@ also created on a clef change.
 
 @mudelafile{keys.ly}
 
+
+
+
 @ignore
 @c the input file is too long and does not test for specific bugs
 
index 44f2bb90dadc038405894dac4b5f7d970eee6781..a9baf330b341ce01636052048f5e62207c79142a 100644 (file)
@@ -28,6 +28,13 @@ public:
   Input spot () const;
   String location_str () const;
   String line_number_str () const;
+
+
+  String file_str ()const;
+  int line_number ()const;
+  int column_number ()const;
+
+  
   Input (Source_file*, char const*);
   Input ();
 };
index 26c0b021f4c954c32c18f876846f541e72c8eb73..f8a3e4a0369b467f3839957353ae565dea70115e 100644 (file)
@@ -54,7 +54,7 @@ public:
   // only used in binary-source-file, currently
 
 
-protected:
+public:
   Slice line_slice (char const* pos_ch_C) const;
   String line_str (char const* pos_ch_C) const;
   int column_i (char const* pos_ch_C) const;
index 7483606ba073c8579a060625d7cfe20f2eab79b3..1ec7fb942805602a2fbc13526bc3138295de66e5 100644 (file)
@@ -37,11 +37,9 @@ Input::set_spot (Input const &i)
 }
 
 /*
-  Produce almost GNU-compliant error message.  Lily used to be rather
-  GNU-compliant in this too, but correcting mudela is such a breeze if 
-  you('re edidor) know(s) the error column too (there's no GNU standard
-  on columns, is there?).
-
+  Produce GNU-compliant error message.  Correcting mudela is such a
+  breeze if you('re edidor) know(s) the error column too
+  
   Format:
 
     [file:line:column:][warning:]message
@@ -114,3 +112,33 @@ Input::line_number_str () const
   else
     return "?";
 }
+
+String
+Input::file_str () const
+{
+  if (source_file_l_)
+    return source_file_l_->name_str ();
+  else
+    return "";
+}
+
+
+int
+Input::line_number () const
+{
+  if (source_file_l_)
+    return source_file_l_->line_i (defined_ch_C_);
+  else
+    return 0;
+
+}
+
+int
+Input::column_number () const
+{
+  if (source_file_l_)
+    return source_file_l_->column_i (defined_ch_C_);
+  else
+    return 0;
+
+}
diff --git a/input/minimal.ly b/input/minimal.ly
new file mode 100644 (file)
index 0000000..b654a3a
--- /dev/null
@@ -0,0 +1,9 @@
+
+
+\score{ \sequential {\clef bass ; }
+\paper { \translator { \type Score_engraver ; \name "Score";  }
+       linewidth =1.5\cm;
+
+} 
+
+}
index 05a51c710b0fb1b2bdca95d123838b4d7ae9d0a8..75fb5b94e310a4569ff68d822ed413a5cc3b7330 100644 (file)
@@ -51,7 +51,7 @@ Align_note_column_engraver::do_creation_processing ()
   Side_position::set_direction (align_item_p_, LEFT);
   
   // needed  for setting font size.
-  announce_element (Score_element_info (align_item_p_, 0));
+  announce_element (align_item_p_, 0);
 }
 
 void
index 316cc56f621593855cfd8049c3a30633c667020a..2b753524355b15c24cd883d0b44ad93bc4beea3f 100644 (file)
@@ -254,7 +254,7 @@ Auto_beam_engraver::create_beam_p ()
       Beam::add_stem (beam_p,(*stem_l_arr_p_)[i]);
     }
   
-  announce_element (Score_element_info (beam_p, 0));
+  announce_element (beam_p, 0);
 
   return beam_p;
 }
index 25ed6142d980c7841a6a8ed0507ffc06c111970a..ca6f5fb359fe8c6544102647ce32c4705d97edb8 100644 (file)
@@ -6,13 +6,33 @@
   (c) 1999--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
  */
 
-#include "axis-group-engraver.hh"
 #include "spanner.hh"
 #include "paper-column.hh"
 #include "axis-group-interface.hh"
-
+#include "engraver.hh"
 #include "engraver-group-engraver.hh"
 
+/**
+   Put stuff in a Spanner with an Axis_group_interface.
+   Use as last element of a context. 
+ */
+class Axis_group_engraver : public Engraver
+{
+protected:
+  Spanner *staffline_p_;
+  Link_array<Score_element> elts_;
+  virtual void do_creation_processing();
+  virtual void do_removal_processing();
+  virtual void acknowledge_element (Score_element_info);
+  virtual void process_acknowledged ();
+  virtual Spanner* get_spanner_p () const;
+public:
+  VIRTUAL_COPY_CONS(Translator);
+  Axis_group_engraver ();
+};
+
+ADD_THIS_TRANSLATOR(Axis_group_engraver);
+
 Axis_group_engraver::Axis_group_engraver ()
 {
   staffline_p_ = 0;
@@ -29,7 +49,7 @@ Axis_group_engraver::do_creation_processing ()
   Pointer_group_interface (it, "bounded-by-me").add_element (staffline_p_);  
   staffline_p_->set_bound(LEFT,it);
 
-  announce_element (Score_element_info (staffline_p_, 0));
+  announce_element (staffline_p_, 0);
 }
 
 Spanner*
@@ -91,4 +111,38 @@ Axis_group_engraver::process_acknowledged ()
   elts_.clear ();
 }
 
-ADD_THIS_TRANSLATOR(Axis_group_engraver);
+
+////////////////////////////////////////////////////////
+
+// maybenot sucsh a good idea after all.
+
+#include "hara-kiri-group-spanner.hh"
+#include "rhythmic-head.hh"
+
+class Hara_kiri_engraver : public Axis_group_engraver
+{
+protected:
+  virtual Spanner*get_spanner_p ()const;
+  virtual void acknowledge_element (Score_element_info);
+public:
+  VIRTUAL_COPY_CONS(Translator);
+};
+
+Spanner*
+Hara_kiri_engraver::get_spanner_p () const
+{
+  Spanner * sp = new Spanner (get_property ("basicHaraKiriVerticalGroupspannerProperties"));
+  Hara_kiri_group_spanner::set_interface (sp);
+  return sp;
+}
+
+void
+Hara_kiri_engraver::acknowledge_element (Score_element_info i)
+{
+  Axis_group_engraver::acknowledge_element (i);
+  if (Rhythmic_head::has_interface (i.elem_l_))
+    {
+      Hara_kiri_group_spanner::add_interesting_item (staffline_p_, i.elem_l_);
+    }
+}
+ADD_THIS_TRANSLATOR(Hara_kiri_engraver);
index 83f391c976e426b452cdf77a650c80b3c02a93c9..943c74a7ba2583cbc9238b2bf0a851183318d268 100644 (file)
@@ -126,5 +126,4 @@ Axis_group_interface::set_interface (Score_element*me)
     {
       me->set_interface (ly_symbol2scm ("axis-group-interface"));      
     }
-  me->set_elt_property ("elements", SCM_EOL);
 }
index 3451841d663c42de5537a248c35bedb481ff5906..dfa4d906fa9dfc66cd546c9ef023315ccd44a930 100644 (file)
@@ -37,7 +37,7 @@ Bar_engraver::create_bar ()
          bar_p_->set_elt_property ("glyph", default_type); // ugh
        }
 
-      announce_element (Score_element_info (bar_p_, 0));
+      announce_element (bar_p_, 0);
     }
 }
 
index 5b29f4a19f86190a6af6e03f33cabe0d96d47f4d..facf059ace39a0a9d27e3053f0d52539a9992780 100644 (file)
@@ -25,7 +25,6 @@ protected:
   Protected_scm staffs_;
 
 protected:
-  virtual void do_creation_processing ();
   virtual void do_pre_move_processing ();
   virtual void acknowledge_element (Score_element_info);
   void create_items();
@@ -62,10 +61,6 @@ Bar_number_engraver::Bar_number_engraver ()
   staffs_ = SCM_EOL;
 }
 
-void
-Bar_number_engraver::do_creation_processing ()
-{
-}
 
 
                                               
@@ -130,6 +125,6 @@ Bar_number_engraver::create_items ()
     }
 
 
-  announce_element (Score_element_info (text_p_, 0));
+  announce_element (text_p_, 0);
 }
 
index 1678dff784e836a482386ef3e6b60b5bbe13f4d9..5574830c37faeed33ca6735e8b6768f55d2900c3 100644 (file)
@@ -72,7 +72,7 @@ Beam_engraver::do_try_music (Music *m)
 
       if (d == STOP && !beam_p_)
        {
-         m->warning (_ ("can't find start of beam"));
+         m->origin ()->warning  (_ ("can't find start of beam"));
          return false;
        }
       reqs_drul_[d ] = c;
@@ -88,7 +88,7 @@ Beam_engraver::do_process_music ()
   if (reqs_drul_[STOP])
     {
       if (!beam_p_)
-       reqs_drul_[STOP]->warning (_("can't find start of beam"));
+       reqs_drul_[STOP]->origin ()->warning (_("can't find start of beam"));
       prev_start_req_ =0;
       finished_beam_p_ = beam_p_;
       finished_beam_info_p_ = beam_info_p_;
@@ -117,7 +117,7 @@ Beam_engraver::do_process_music ()
     {
       if (beam_p_)
        {
-         reqs_drul_[START]->warning (_ ("already have a beam"));
+         reqs_drul_[START]->origin ()->warning (_ ("already have a beam"));
          return;
        }
 
@@ -135,7 +135,7 @@ Beam_engraver::do_process_music ()
       
       /* urg, must copy to Auto_beam_engraver too */
  
-      announce_element (Score_element_info (beam_p_, reqs_drul_[START]));
+      announce_element (beam_p_, reqs_drul_[START]);
     }
 }
 
@@ -174,7 +174,7 @@ Beam_engraver::do_removal_processing ()
   typeset_beam ();
   if (beam_p_)
     {
-      prev_start_req_->warning (_ ("unterminated beam"));
+      prev_start_req_->origin ()->warning (_ ("unterminated beam"));
       finished_beam_p_ = beam_p_;
       finished_beam_info_p_ = beam_info_p_;
       typeset_beam ();
@@ -209,7 +209,7 @@ Beam_engraver::acknowledge_element (Score_element_info info)
            {
              String s = _ ("stem must have Rhythmic structure");
              if (info.req_l_)
-               info.req_l_->warning (s);
+               info.req_l_->origin ()->warning (s);
              else
                ::warning (s);
          
@@ -218,8 +218,8 @@ Beam_engraver::acknowledge_element (Score_element_info info)
 
          if (rhythmic_req->duration_.durlog_i_<= 2)
            {
-             rhythmic_req->warning (_ ("stem doesn't fit in beam"));
-             prev_start_req_->warning (_ ("beam was started here"));
+             rhythmic_req->origin ()->warning (_ ("stem doesn't fit in beam"));
+             prev_start_req_->origin ()->warning (_ ("beam was started here"));
              /*
                don't return, since
 
index cd8c9a1b81d5e51f261a54995b5a89fd089ac1ea..3ca38f7db74572d81620e40948ca48b7c5a10a02 100644 (file)
@@ -98,7 +98,7 @@ Break_align_engraver::acknowledge_element (Score_element_info inf)
        {
          align_l_ = new Item (get_property ("basicBreakAlignProperties"));
          Break_align_item::set_interface (align_l_);
-         announce_element (Score_element_info (align_l_,0));
+         announce_element (align_l_,0);
 
          SCM edge_sym = ly_symbol2scm ("Left_edge_item");
          Item * edge = new Item (get_property ("leftEdgeBasicProperties"));
@@ -113,7 +113,7 @@ Break_align_engraver::acknowledge_element (Score_element_info inf)
          
          align_l_->set_elt_property ("group-center-element", edge->self_scm_);
 
-         announce_element (Score_element_info(edge, 0));
+         announce_element (edge, 0);
          column_alist_ = scm_assoc_set_x (column_alist_, edge_sym, edge->self_scm_);
        }
 
@@ -135,7 +135,7 @@ Break_align_engraver::acknowledge_element (Score_element_info inf)
 
          group->set_elt_property ("break-align-symbol", align_name);
          group->set_parent (align_l_, Y_AXIS);
-         announce_element (Score_element_info (group, 0));
+         announce_element (group, 0);
          column_alist_ = scm_assoc_set_x (column_alist_, align_name, group->self_scm_);
        }
       Axis_group_interface::add_element (group, item_l);
index 1088b39d33378f20393b89d8ae62c6d27255761b..2a19cdb4abdf8927002af3c24677cc19085464fe 100644 (file)
@@ -18,7 +18,7 @@ TODO:
 #include "musical-request.hh"
 #include "command-request.hh"
 #include "engraver-group-engraver.hh"
-#include "local-key-item.hh"
+#include "item.hh"
 #include "engraver.hh"
 #include "command-request.hh"
 
@@ -67,7 +67,7 @@ Breathing_sign_engraver::do_process_music()
 
       Breathing_sign::set_interface (breathing_sign_p_);
 
-      announce_element (Score_element_info (breathing_sign_p_, breathing_sign_req_l_));
+      announce_element (breathing_sign_p_, breathing_sign_req_l_);
     }
 }
 
index f860c6977349ff9b3235345069729021e6cf04b5..08fdc53271e210e0e76cd7445982bbbd397763ba 100644 (file)
@@ -28,7 +28,7 @@ Change_iterator::error (String reason)
     + report_to_l ()->type_str_ + " = `"
     + report_to_l ()->id_str_ + "': ";
   warning (warn2);
-  t->warning (warn1);
+  t->origin ()->warning (warn1);
 }
 
 /*
index 3e82a773508c26e4ab030dd7aa78f0a8b2b82f6e..41a452f76e1612f538155aa07edd1342881e54e8 100644 (file)
@@ -113,7 +113,7 @@ Chord_name_engraver::do_process_music ()
   if (chord.bass_b_)
     chord_name_p_->set_elt_property ("bass", chord.bass_pitch_.to_scm ());
 
-  announce_element (Score_element_info (chord_name_p_, 0));
+  announce_element (chord_name_p_, 0);
 }
 
 void
index 87fdecbce89e1540b40204bd0454b5e6dc5af58c..63626bd0227cead1ca1466383f7e07b8f4d6b532 100644 (file)
@@ -101,7 +101,7 @@ Chord_tremolo_engraver::do_process_music ()
       SCM smp = get_property ("measurePosition");
       Moment mp =  (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
       beam_start_location_ = mp;
-      announce_element (Score_element_info (beam_p_, repeat_));
+      announce_element (beam_p_, repeat_);
     }
 }
 
@@ -112,7 +112,7 @@ Chord_tremolo_engraver::do_removal_processing ()
   typeset_beam ();
   if (beam_p_)
     {
-      repeat_->warning (_ ("unterminated chord tremolo"));
+      repeat_->origin ()->warning (_ ("unterminated chord tremolo"));
       finished_beam_p_ = beam_p_;
       typeset_beam ();
     }
@@ -171,7 +171,7 @@ Chord_tremolo_engraver::acknowledge_element (Score_element_info info)
            {
              String s = _ ("stem must have Rhythmic structure");
              if (info.req_l_)
-               info.req_l_->warning (s);
+               info.req_l_->origin ()->warning (s);
              else
                ::warning (s);
            }
index c74c8be464f778777232f29fe483643c311abfa6..1fe1425527b42af1ef9a1e547c1fd6a7d9853ccc 100644 (file)
   this is culled from various other iterators, but sharing code by subclassing proved to be too difficult.
  */
 
+#include "input.hh"
 #include "chord-tremolo-iterator.hh"
 #include "repeated-music.hh"
 
 void
 Chord_tremolo_iterator::construct_children ()
 {
-  Repeated_music const* rep = dynamic_cast<Repeated_music const*> (music_l_);
+  Repeated_music * rep = dynamic_cast<Repeated_music*> (music_l_);
   factor_  = Moment (1, rep->repeats_i_);
-  child_iter_p_ = get_iterator_p (rep->repeat_body_p_);
+  child_iter_p_ = get_iterator_p (rep->body ());
 }
 
 Chord_tremolo_iterator::Chord_tremolo_iterator()
@@ -38,7 +39,7 @@ Chord_tremolo_iterator::do_process_and_next (Moment m)
       if (yeah)
        set_translator (yeah->report_to_l ());
       else
-       music_l_->warning ( _("no one to print a tremolos"));
+       music_l_->origin ()->warning ( _("no one to print a tremolos"));
     }
 
   child_iter_p_->process_and_next  (factor_ * m);
@@ -63,7 +64,7 @@ Chord_tremolo_iterator::~Chord_tremolo_iterator ()
 }
 
 Music_iterator*
-Chord_tremolo_iterator::try_music_in_children (Music const *m) const
+Chord_tremolo_iterator::try_music_in_children (Music  *m) const
 {
   return child_iter_p_->try_music (m);
 }
index b9813a1aa9a3351ecae6dee47f01ae485820cdd1..5d287e38a8d2dee44abf0ab218d0f84023a6a6f6 100644 (file)
@@ -164,7 +164,7 @@ Clef_engraver::do_try_music (Music * r_l)
     {
       clef_req_l_ = cl;
       if (!set_type (cl->clef_str_))
-       cl->error (_ ("unknown clef type"));
+       cl->origin ()->warning (_ ("unknown clef type"));
 
       return true;
     }
@@ -179,7 +179,7 @@ Clef_engraver::create_clef()
   if (!clef_p_)
     {
       Item *c= new Item ( current_settings_);
-      announce_element (Score_element_info (c, clef_req_l_));
+      announce_element (c, clef_req_l_);
 
       Staff_symbol_referencer::set_interface (c);
       
@@ -198,7 +198,7 @@ Clef_engraver::create_clef()
       g->add_offset_callback (Side_position::centered_on_parent, X_AXIS);
       g->set_elt_property ("direction", gh_int2scm (octave_dir_));
       octavate_p_ = g;
-      announce_element (Score_element_info (octavate_p_, clef_req_l_));
+      announce_element (octavate_p_, clef_req_l_);
     }
 }
 
index 9b3218de78922fd0eadd0c253a7270bba2d842d3..fc0d97cc9866bb6e96e1bbc8a20a506fca7621c2 100644 (file)
@@ -40,7 +40,7 @@ Collision_engraver::process_acknowledged ()
       Axis_group_interface::set_interface (col_p_);
       Axis_group_interface::set_axes (col_p_, X_AXIS, Y_AXIS);
 
-      announce_element (Score_element_info (col_p_,0));
+      announce_element (col_p_,0);
     }
   
   for (int i=0; i< note_column_l_arr_.size (); i++)
index 92143f8a5554482515790b60b4a088bb21ad7870..bc919f63e75c489b421bcb9616990f801976ee63 100644 (file)
@@ -105,16 +105,16 @@ bool
 Key_change_req::do_equal_b (Request const * req) const
 {
   Key_change_req const * k = dynamic_cast<Key_change_req const*> (req);
-  return k && scm_equal_p (pitch_alist_, k->pitch_alist_);
+  return k && scm_equal_p (get_mus_property ("pitch-alist"), k->get_mus_property ("pitch-alist"));
 }
 
 
-
 void
 Key_change_req::transpose (Musical_pitch p)
 {
   SCM newlist = SCM_EOL;
-  for (SCM s = pitch_alist_; gh_pair_p (s); s = gh_cdr (s))
+  SCM pa = get_mus_property ("pitch-alist");
+  for (SCM s = pa; gh_pair_p (s); s = gh_cdr (s))
     {
       SCM k = gh_caar (s);
 
@@ -141,7 +141,7 @@ Key_change_req::transpose (Musical_pitch p)
        }
     }
 
-  pitch_alist_ = newlist;
+  set_mus_property ("pitch-alist", newlist);
 }
 
 Break_req::Break_req ()
@@ -149,10 +149,10 @@ Break_req::Break_req ()
 }
 
 
-
 bool
 Mark_req::do_equal_b (Request const * r) const
 {
   Mark_req const * other = dynamic_cast<Mark_req const*> (r);
-  return other && scm_equal_p (other->mark_label_,  mark_label_);
+  return other && scm_equal_p (other->get_mus_property ("mark-label"),
+                              get_mus_property ("mark-label"));
 }
index e3aad9a4aaa24713affeda8befc5459e1ccacc3a..44f120101d1c0ac003b41019dc57fd5d2e7cfe13 100644 (file)
@@ -1,6 +1,6 @@
 /*   
   debug.cc --  implement debugging routines
-  
+
   source file of the GNU LilyPond music typesetter
   
   (c) 1996--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
index 35ca2c3cc48e22d1e7c02721f5f1caebfebfd155..935d3f3e65e28375bb2ce9870c03b36cbe4e77c4 100644 (file)
@@ -56,7 +56,7 @@ Dot_column_engraver::acknowledge_element (Score_element_info info)
          Dot_column::set_interface (dotcol_p_);
          Side_position::set_axis (dotcol_p_, X_AXIS);
          Side_position::set_direction (dotcol_p_, RIGHT);      
-         announce_element (Score_element_info (dotcol_p_, 0));
+         announce_element (dotcol_p_, 0);
        }
 
       Dot_column::add_head (dotcol_p_, info.elem_l_);
index f0390d479853df753d537b69ad890d2f99005158..c57c5332657d662ee5742947f1cf201be12666e9 100644 (file)
@@ -123,9 +123,8 @@ Dynamic_engraver::do_process_music ()
          Side_position::set_axis (line_spanner_, Y_AXIS);
          Axis_group_interface::set_interface (line_spanner_);
          Axis_group_interface::set_axes (line_spanner_, Y_AXIS, Y_AXIS);
-         announce_element (Score_element_info
-                           (line_spanner_,
-                            text_req_l_ ? text_req_l_ : accepted_spanreqs_drul_[START]));
+         announce_element (line_spanner_,
+                            text_req_l_ ? text_req_l_ : accepted_spanreqs_drul_[START]);
 
        }
     }
@@ -174,14 +173,14 @@ Dynamic_engraver::do_process_music ()
 
       text_p_->add_offset_callback (Side_position::aligned_on_self,
                                    Y_AXIS);
-      announce_element (Score_element_info (text_p_, text_req_l_));
+      announce_element (text_p_, text_req_l_);
     }
 
   if (accepted_spanreqs_drul_[STOP])
     {
       if (!cresc_p_)
        {
-         accepted_spanreqs_drul_[STOP]->warning
+         accepted_spanreqs_drul_[STOP]->origin ()->warning
            (_ ("can't find start of (de)crescendo"));
        }
       else
@@ -198,7 +197,7 @@ Dynamic_engraver::do_process_music ()
     {
       if (current_cresc_req_)
        {
-         accepted_spanreqs_drul_[START]->warning
+         accepted_spanreqs_drul_[START]->origin ()->warning
            (current_cresc_req_->span_dir_ == 1
             ?
             _ ("already have a crescendo")
@@ -267,7 +266,7 @@ Dynamic_engraver::do_process_music ()
          cresc_p_->set_elt_property ("self-alignment-Y", gh_int2scm (0));
          cresc_p_->add_offset_callback
            (Side_position::aligned_on_self, Y_AXIS);
-         announce_element (Score_element_info (cresc_p_, accepted_spanreqs_drul_[START]));
+         announce_element (cresc_p_, accepted_spanreqs_drul_[START]);
        }
     }
 }
@@ -287,7 +286,7 @@ Dynamic_engraver::do_removal_processing ()
     {
       typeset_element (cresc_p_ );
       finished_cresc_p_ = cresc_p_;
-      current_cresc_req_->warning (_ ("unterminated (de)crescendo"));
+      current_cresc_req_->origin ()->warning (_ ("unterminated (de)crescendo"));
     }
   if (line_spanner_)
     {
index db7a7d79dd2b5f1557ff7c79d4da4a7d638e237c..c12283e8e43166bd1770bc5d01c1a1efc0bc0c28 100644 (file)
@@ -23,6 +23,7 @@ Engraver_group_engraver::announce_element (Score_element_info info)
   Engraver::announce_element (info);
 }
 
+
 void
 Engraver_group_engraver::do_announces()
 {
@@ -32,17 +33,12 @@ Engraver_group_engraver::do_announces()
        trg->do_announces ();
     }
 
-  Request dummy_req;
-
   while (announce_info_arr_.size ())
     {
       for (int j =0; j < announce_info_arr_.size(); j++)
        {
          Score_element_info info = announce_info_arr_[j];
          
-         if (!info.req_l_)
-           info.req_l_ = &dummy_req;
-
          for (Cons<Translator> *p = trans_p_list_.head_; p; p = p->next_)
            {
              if (!dynamic_cast <Engraver_group_engraver *> (p->car_))
index 7ef5dda44f2edc40560e39078272707ab2b5fb34..896c206f1214c40494f22ce54ccdb830d3f58405 100644 (file)
 
 
 void
-Engraver::announce_element (Score_element_info i)
+Engraver::announce_element (Score_element_info inf)
 {
-  Score_element *  e = i.elem_l_;
+  daddy_grav_l()->announce_element (inf);
+}
 
+void
+Engraver::announce_element (Score_element* e, Music *m)
+{
   if (e->get_elt_property ("interfaces") == SCM_EOL)
     Group_interface (e, "interfaces").add_thing (ly_symbol2scm (e->name()));
+
+  if (m && m->origin ()->location_str ().length_i ())
+    {
+      e->set_elt_property ("origin", m->get_mus_property ("origin"));
+    }
   
+  Score_element_info i (e, m);
   if (!i.origin_trans_l_)
     i.origin_trans_l_ = this;
   daddy_grav_l()->announce_element (i);
 }
+
+
  
 void
 Engraver::typeset_element (Score_element*p)
index 21a246d71319fe1d1f79aed87457dd997861b643..db813f141a1509f5187864a4982916a7be08fc20 100644 (file)
@@ -95,7 +95,7 @@ Extender_engraver::do_removal_processing ()
 {
   if (extender_p_)
     {
-      req_l_->warning (_ ("unterminated extender"));
+      req_l_->origin ()->warning (_ ("unterminated extender"));
       extender_p_->set_bound(RIGHT, unsmob_element (get_property ("currentCommandColumn")));
     }
 }
@@ -107,7 +107,7 @@ Extender_engraver::do_process_music ()
     {
       if (!last_lyric_l_)
        {
-         req_l_->warning (_ ("Nothing to connect extender to on the left.  Ignoring extender request."));
+         req_l_->origin ()->warning (_ ("Nothing to connect extender to on the left.  Ignoring extender request."));
          return;
        }
       
@@ -115,7 +115,7 @@ Extender_engraver::do_process_music ()
       extender_p_->set_extent_callback (Score_element::point_dimension_callback, Y_AXIS);
 
       Lyric_extender (extender_p_).set_textitem  (LEFT, last_lyric_l_);
-      announce_element (Score_element_info (extender_p_, req_l_));
+      announce_element (extender_p_, req_l_);
     }
 }
 
index 1083b8fa692cbb1f29c8e5e69324d5b601aae628..38241b8cf413cb1e6fc7b3fb06b16a646300a893 100644 (file)
@@ -45,8 +45,8 @@ Folded_repeat_iterator::next_moment () const
 void
 Folded_repeat_iterator::construct_children ()
 {
-  Repeated_music const *  mus = dynamic_cast<Repeated_music const*> (music_l_);
-  main_iter_p_ = get_iterator_p (mus->repeat_body_p_);
+  Repeated_music  *  mus = dynamic_cast<Repeated_music*> (music_l_);
+  main_iter_p_ = get_iterator_p (mus->body ());
   if (!main_iter_p_->ok())
     {
       leave_body ();
@@ -61,7 +61,7 @@ Folded_repeat_iterator::do_process_and_next (Moment m)
     {
       bool success = try_music (music_l_);
       if (!success)
-       music_l_->warning ( _("no one to print a repeat brace"));
+       music_l_->origin ()->warning ( _("no one to print a repeat brace"));
     }
   
   if (main_iter_p_)
@@ -90,36 +90,30 @@ Folded_repeat_iterator::do_process_and_next (Moment m)
 void
 Folded_repeat_iterator::leave_body ()
 {
-  Repeated_music const *  mus = dynamic_cast<Repeated_music const*> (music_l_);
+  Repeated_music *  mus = dynamic_cast<Repeated_music *> (music_l_);
   delete main_iter_p_;
   main_iter_p_ = 0;
-  main_length_mom_ +=  mus->repeat_body_p_->length_mom ();
+  main_length_mom_ +=  mus->body ()->length_mom ();
 }
 
 void
 Folded_repeat_iterator::enter_alternative ()
 {
-  Repeated_music const *  mus = dynamic_cast<Repeated_music const*> (music_l_);  
-  if (mus->alternatives_p_)
+  Repeated_music *  mus = dynamic_cast<Repeated_music *> (music_l_);  
+  if (mus->alternatives ())
     {
       Simultaneous_music_iterator * s = new Simultaneous_music_iterator;
       s->separate_contexts_b_ = true;
-      s->init_translator (mus->alternatives_p_, report_to_l ());
+      s->init_translator (mus->alternatives (), report_to_l ());
   
       alternative_iter_p_ = s;
       alternative_iter_p_->construct_children ();
     }
 }
 
-void
-Folded_repeat_iterator::do_print () const
-{
-#ifndef NPRINT
-#endif
-}
 
 Music_iterator*
-Folded_repeat_iterator::try_music_in_children (Music const* m) const
+Folded_repeat_iterator::try_music_in_children (Music * m) const
 {
   if (main_iter_p_)
     {
index 192ece0a69c9642c51a56b04fed0b3ad03894f42..b442cca427624fd373f484fb8b329f22a0c76eb2 100644 (file)
@@ -136,7 +136,7 @@ Gourlay_breaking::do_solve () const
 
   /* do the last one */
   if  (break_idx % HAPPY_DOTS_I)
-       progress_indication (String ("[") + to_str (break_idx) + "]");    
+    progress_indication (String ("[") + to_str (break_idx) + "]");    
 
 
   progress_indication ("\n");
index 9625b16f02f83ab931a19a4ad1f7747bc60fd0f1..79fbe31f7f0674384b65d8b9003bfdb1961cdcd1 100644 (file)
@@ -87,7 +87,7 @@ Hyphen_engraver::do_removal_processing ()
 {
   if (hyphen_p_)
     {
-      req_l_->warning (_ ("unterminated hyphen"));
+      req_l_->origin ()->warning (_ ("unterminated hyphen"));
       hyphen_p_->set_bound(RIGHT, unsmob_element (get_property ("currentCommandColumn")));
     }
 }
@@ -99,14 +99,14 @@ Hyphen_engraver::do_process_music ()
     {
       if (!last_lyric_l_)
        {
-         req_l_->warning (_ ("Nothing to connect hyphen to on the left.  Ignoring hyphen request."));
+         req_l_->origin ()->warning (_ ("Nothing to connect hyphen to on the left.  Ignoring hyphen request."));
          return;
        }
       
       hyphen_p_ = new Spanner (get_property ("basicHyphenSpannerProperties"));
       hyphen_p_->set_extent_callback (Score_element::point_dimension_callback,Y_AXIS);
       Hyphen_spanner (hyphen_p_).set_textitem  (LEFT, last_lyric_l_);
-      announce_element (Score_element_info (hyphen_p_, req_l_));
+      announce_element (hyphen_p_, req_l_);
     }
 }
 
index c82598ed5eb8748394ae202d67917eddeb278703..41b5e049f958b330db1fdf99e6e8fb44b5b39fd6 100644 (file)
@@ -16,7 +16,6 @@
 #include "identifier.hh"
 #include "my-lily-lexer.hh"
 #include "debug.hh"
-#include "request.hh"
 #include "translator-group.hh"
 #include "ly-smobs.icc"
 
@@ -83,8 +82,6 @@ Class ## _identifier::do_print () const { \
 
 
 DEFAULT_PRINT(Translator_group);
-DEFAULT_PRINT(Music);
-DEFAULT_PRINT(Request);
 DEFAULT_PRINT(Score);
 DEFAULT_PRINT(Music_output_def);
 
@@ -97,8 +94,6 @@ Class ## _identifier::do_str () const { \
 
 
 DUMMY_STR(Translator_group);
-DUMMY_STR(Music);
-DUMMY_STR(Request);
 DUMMY_STR(Score);
 DUMMY_STR(Music_output_def);
 DUMMY_STR(Duration);
@@ -156,12 +151,8 @@ Class ## _identifier::Class ## _identifier (Class ## _identifier const &s) \
 
 IMPLEMENT_ID_CLASS(Duration);
 IMPLEMENT_ID_CLASS(Translator_group);
-IMPLEMENT_ID_CLASS(Music);
 IMPLEMENT_ID_CLASS(Score);
-IMPLEMENT_ID_CLASS(Request);
 IMPLEMENT_ID_CLASS(Music_output_def);
-VIRTUAL_ACCESSOR(Music);
-VIRTUAL_ACCESSOR(Request);
 VIRTUAL_ACCESSOR(Translator_group);
 VIRTUAL_ACCESSOR(Music_output_def);
 DEFAULT_ACCESSOR(Duration);
index 9100bce3199ae30510b307bca8e6a0561b1a6074..9cd632985da7c724a5cce2adb25f4fe0178db855 100644 (file)
@@ -27,7 +27,7 @@ protected:
   virtual bool ok () const;
   virtual void do_print () const;
   virtual void do_process_and_next (Moment) ;
-  virtual Music_iterator *try_music_in_children (Music const *) const;
+  virtual Music_iterator *try_music_in_children (Music *) const;
 };
 
 
index 845598a3ad96cf0fa273356cb743b46647a288c1..759332508114cde9805964bb9da768dee0caa67d 100644 (file)
@@ -26,8 +26,9 @@ protected:
 
 class Mark_req : public Request {
 public:
-  Protected_scm mark_label_;
-protected:
+  SCM mark_label ();
+
+
   virtual bool do_equal_b (Request const*) const;
   VIRTUAL_COPY_CONS(Music);
 };
@@ -102,8 +103,8 @@ class Breathing_sign_req : public Request {
 class Key_change_req  : public Request
 {
 public:
-  Protected_scm pitch_alist_;
-
+  SCM pitch_alist ();
+  
 protected:
   VIRTUAL_COPY_CONS(Music);
   void transpose (Musical_pitch  d);
index 2c3ef7afd6e344de5c50d2c800c2361bb6811f2d..3c20037f7e357140c0436f0301fa30de00f79871 100644 (file)
 class Engraver : public virtual Translator {
     
   friend class Engraver_group_engraver;
-
 protected:
-    
-
   /// utility
   Paper_def * paper_l() const;
   /**
     Invoke walker method to typeset element. Default: pass on to daddy.
     */
   virtual void typeset_element (Score_element*elem_p);
-
-    
   /**
     take note of item/spanner
     put item in spanner. Adjust local key; etc.
@@ -52,7 +47,8 @@ protected:
   /**
     Announce element. Default: pass on to daddy. Utility
     */
-  virtual void announce_element (Score_element_info);
+  virtual void announce_element (Score_element*, Music*);
+  virtual void announce_element (Score_element_info);  
 public:
   VIRTUAL_COPY_CONS(Translator);
   Engraver_group_engraver * daddy_grav_l() const;
@@ -60,8 +56,6 @@ public:
     override other ctor
    */
   Engraver () {}
-
-  
 };
 
 
index 499b7b4be88d292049f483a7b5ac1f451e2b145d..e26bac173e0c862c758540efd04e85e003fe2718 100644 (file)
@@ -34,9 +34,8 @@ protected:
   void enter_alternative ();
   void leave_body ();
   
-  virtual void do_print () const;
   virtual void do_process_and_next (Moment);
-  virtual Music_iterator *try_music_in_children (Music const *) const;
+  virtual Music_iterator *try_music_in_children (Music *) const;
 };
 #endif /* FOLDED_REPEAT_ITERATOR_HH */
 
index 93eeb8feb7f160a206ef26a0110ce35c4410d97a..0c1d70778e0c1a60035f96049ee76faf0749bbb6 100644 (file)
 
 #include "axis-group-engraver.hh"
 
-class Hara_kiri_engraver : public Axis_group_engraver
-{
-protected:
-  virtual Spanner*get_spanner_p ()const;
-  virtual void acknowledge_element (Score_element_info);
-public:
-  VIRTUAL_COPY_CONS(Translator);
-};
-
 #endif /* HARA_KIRI_ENGRAVER_HH */
index cb9b8b6fdf1151a6037660bfde791ded4ab7acc5..750c49089a4d555328d397516b27d25cfd4e0e43 100644 (file)
@@ -16,9 +16,7 @@
 
 
 class Translator_group_identifier;
-class Music_identifier;
 class Output_def_identifier;
-class Request_identifier;
 class Score_identifier;
 class Duration_identifier;
 
@@ -49,9 +47,7 @@ struct Identifier : public Input {
   void error (String) const;
   String str () const;
   IDACCESSOR(Translator_group)
-  IDACCESSOR(Music)
   IDACCESSOR(Music_output_def)
-  IDACCESSOR(Request)
   IDACCESSOR(Score)
   IDACCESSOR(Duration)
   VIRTUAL_COPY_CONS(Identifier);
@@ -77,9 +73,7 @@ struct Class ## _identifier : Identifier {\
 
 DECLARE_ID_CLASS(Translator_group);
 DECLARE_ID_CLASS(Duration);
-DECLARE_ID_CLASS(Music);
 DECLARE_ID_CLASS(Score);
-DECLARE_ID_CLASS(Request);
 DECLARE_ID_CLASS(Music_output_def);
 
 Identifier * unsmob_identifier (SCM);
diff --git a/lily/include/input-smob.hh b/lily/include/input-smob.hh
new file mode 100644 (file)
index 0000000..87d63c5
--- /dev/null
@@ -0,0 +1,22 @@
+/*   
+  input-smob.hh -- declare input smob
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#ifndef INPUT_SMOB_HH
+#define INPUT_SMOB_HH
+
+#include "input.hh"
+#include "lily-guile.hh"
+
+SCM make_input (Input spot);
+Input *unsmob_input (SCM);
+
+extern Input dummy_input_global;
+
+#endif /* INPUT_SMOB_HH */
+
index 3a84af0defbb943c485354605c6e0b64e7cd3eb2..85c58aa4a9d971f41090472164bb6df0f18d84b4 100644 (file)
@@ -56,6 +56,7 @@ public:
 protected:
   virtual void discretionary_processing ();
   void copy_breakable_items();
+  virtual SCM do_derived_mark ();
 };
 
 
index 3dc1f64f16c06f53d1ca5cf268b76066488075a5..be8a39ff6f19a0284a26f655af288f39e689e525 100644 (file)
@@ -79,11 +79,11 @@ void add_scm_init_func (void (*)());
 
 
 #define MAKE_SCHEME_CALLBACK(TYPE, FUNC) \
-static SCM TYPE ## _ ## FUNC ## _scm;\
+static SCM TYPE ## _ ## FUNC ## _proc;\
 void                                                           \
 TYPE ## _ ## FUNC ## _init_functions ()                                        \
 {                                                              \
-  TYPE ## _ ## FUNC ## _scm = gh_new_procedure1_0 (#TYPE "::" #FUNC, \
+  TYPE ## _ ## FUNC ## _proc = gh_new_procedure1_0 (#TYPE "::" #FUNC, \
   (SCM(*)(...))TYPE :: FUNC);                          \
 }                                                              \
                                                                \
index fb2c190ece096e3ca60755f11df651a1b7e4d88d..e1f45bd305cf56f67e64bc6db31e1d01a9eb82a7 100644 (file)
@@ -8,47 +8,17 @@
 #define LOCALKEYITEM_HH
 
 
-#include "item.hh"
 #include "array.hh"
 #include "musical-pitch.hh"
 
-
-
-struct Local_key_cautionary_tuple
-{
-  Musical_pitch pitch_;
-  bool cautionary_b_;
-  bool natural_b_;
-
-  Local_key_cautionary_tuple ()
-  {
-    cautionary_b_ = false;
-    natural_b_ = false;
-  }
-  static int compare (Local_key_cautionary_tuple const&s1, Local_key_cautionary_tuple const&s2)
-  {
-    return Musical_pitch::compare (s1.pitch_, s2.pitch_);
-  }
-};
-
-/**
-  Accidentals which can be different for each octave.
-
-  TODO: schemify me!
- */
-class Local_key_item : public Item
+class Local_key_item
 {
-  Array<Local_key_cautionary_tuple> accidental_arr_;
-
-  static Molecule accidental (Score_element*me, int,bool,bool) ;
+  static Molecule parenthesize (Score_element*me, Molecule) ;
 public:
-  Local_key_item (SCM );
-   static SCM brew_molecule (SCM);
-  
-  void add_pitch (Musical_pitch, bool cautionary, bool natural);
-
-  static SCM before_line_breaking (SCM);
+  static SCM brew_molecule (SCM);
+  static void add_pitch (Score_element*me, Musical_pitch, bool cautionary, bool natural);
   static bool has_interface (Score_element*);
+  static void set_interface (Score_element*);  
 };
 
 
index d496d25bc91c0d421cf972d1b2bf30dec3d65a35..8a8648e6a558610bf10244f72acebeab0f2c75e6 100644 (file)
@@ -10,6 +10,7 @@
 #ifndef LY_SMOBS_ICC
 #define LY_SMOBS_ICC
 
+#include "smobs.hh"
 
 
 #define IMPLEMENT_UNSMOB(CL, name)             \
index 73b7c925a8b31c3100429b281c81877d10128c5a..226499611007851125a2d1a1e224bd1209331c2f 100644 (file)
@@ -22,7 +22,7 @@ protected:
   virtual void construct_children ();
   virtual Moment next_moment () const;
   virtual void do_process_and_next (Moment);
-  virtual Music_iterator *try_music_in_children (Music const*) const;
+  virtual Music_iterator *try_music_in_children (Music *) const;
 
   virtual bool ok () const;
   virtual void do_print () const;
index 16a60a60c00cfc5d422532384c499b557f9ccb84..a4a47c2a43941b4b9255c85002b0c0ad7578c5ea 100644 (file)
 
 class Lyric_combine_music : public Music
 {
-  Music * music_p_;
-  Music * lyrics_p_;
 public:
   Music * music_l () const;
   Music * lyrics_l () const;
   
   Lyric_combine_music (Music*, Music*);
-
   virtual void transpose (Musical_pitch);
   virtual void do_print () const;
-  
   VIRTUAL_COPY_CONS(Music);
-  Lyric_combine_music (Lyric_combine_music const&);
   virtual Moment length_mom () const;
-  virtual ~Lyric_combine_music ();
   virtual Musical_pitch to_relative_octave (Musical_pitch);
   virtual void compress (Moment);
 };
index 548085bcff912bfc8228d17e1b1b8a9c183c7506..898cb6373219e7b98c53c189532ef8265311040e 100644 (file)
@@ -37,6 +37,8 @@
     Empty molecules have empty dimensions.  If add_at_edge is used to
     init the molecule, we assume that
     DIMENSIONS = (Interval(0,0),Interval(0,0)
+
+    TODO: go full smob with Molecule.
     
 */
 class Molecule {
index 754525578a271fc1f82654b84c9131fccb74e3d2..561e9c11eba025a2e57110a7b5cdb398854e98c1 100644 (file)
@@ -28,7 +28,7 @@ class Music_iterator {
   Interpretation_context_handle handle_;
 
 protected:
-  Music const * music_l_;
+  Music  * music_l_;
 
   /// ugh. JUNKME
   bool first_b_;
@@ -47,7 +47,7 @@ protected:
   /**
     Get an iterator for MUS, inheriting the translation unit from THIS.
    */
-  Music_iterator* get_iterator_p (Music const*mus) const;
+  Music_iterator* get_iterator_p (Music *mus) const;
 
   /** Do the actual move.  This should be overriden in derived
     classes.  It is called by #process_and_next#, the public interface 
@@ -55,7 +55,7 @@ protected:
   virtual void do_process_and_next (Moment until);
 
 
-  virtual Music_iterator* try_music_in_children (Music const *) const;
+  virtual Music_iterator* try_music_in_children (Music  *) const;
   
 public:
 
@@ -63,7 +63,7 @@ public:
      Do the reporting.  Will try MUSIC_L_ in its own translator first,
      then its children. Returns the iterator that succeeded
   */
-  Music_iterator *  try_music (Music const *) const;
+  Music_iterator *  try_music (Music  *) const;
 
   /**
     The translation unit that we this iterator is reporting  to now.
@@ -75,8 +75,8 @@ public:
   /** Get an iterator matching the type of MUS, and use TRANS to find
     an accompanying translation unit
    */
-  static Music_iterator* static_get_iterator_p (Music const* mus);
-  void init_translator (Music const *, Translator_group *); 
+  static Music_iterator* static_get_iterator_p (Music * mus);
+  void init_translator (Music  *, Translator_group *); 
 
   Music_iterator();
     
index 386cf49fae7130de6239087cbc43d558b04082d7..6abf926c4da30080348a8e10d9a12373fec09590 100644 (file)
 #ifndef Music_sequence_HH
 #define Music_sequence_HH
 
-#include "music.hh"
-#include "cons.hh"
-
-
-class Music_list : public Cons_list<Music> , public Input
-{
-public:
-  Musical_pitch do_relative_octave (Musical_pitch, bool); 
-  void add_music (Music*);
-  Music_list (Music_list const&);
-  Music_list ();
-};
-
-
-/**
-  Music can be a list of other "Music" elements
- */
-class Music_sequence : public Music
-{
-public:
-  Music_list * music_p_list_p_;
-
-  Music_sequence (Music_sequence const&);
-  Music_sequence (Music_list *l_p);
-  
-  VIRTUAL_COPY_CONS(Music);
-
-  Musical_pitch do_relative_octave (Musical_pitch p, bool b);
-  virtual void transpose (Musical_pitch );
-  virtual void compress (Moment);
-  void add_music (Music *music_p);
-  int length_i () const;
-  Moment cumulative_length () const;
-  Moment maximum_length () const;
-  virtual ~Music_sequence ();
-  
-protected:
-  virtual Musical_pitch to_relative_octave (Musical_pitch);
-  virtual void do_print() const;
-};
+#include "music-sequence.hh"
 
 /**
   Simultaneous_music is a list of music-elements which happen simultaneously
@@ -58,15 +19,12 @@ protected:
 class Simultaneous_music : public Music_sequence
 {
 public:
-  
   VIRTUAL_COPY_CONS(Music);
-  
-  Simultaneous_music(Music_list *);
+  Simultaneous_music(SCM);
   virtual Musical_pitch to_relative_octave (Musical_pitch);
   virtual Moment length_mom () const;
 };
 
-
 /**
   The request is a collection of Requests. A note that you enter in mudela is 
   one Request_chord, one syllable of lyrics is one Request_chord
@@ -75,12 +33,10 @@ class Request_chord : public Simultaneous_music
 {
 public:
   VIRTUAL_COPY_CONS(Music);
-  
   virtual Musical_pitch to_relative_octave (Musical_pitch);
-  Request_chord();
+  Request_chord(SCM list);
 };
 
-
 /**
   Sequential_music is a list of music-elements which are placed behind each other.
  */
@@ -88,8 +44,8 @@ class Sequential_music : public Music_sequence
 {
 public:
   VIRTUAL_COPY_CONS(Music);
-
-  Sequential_music(Music_list*);
+  Sequential_music(SCM);
   virtual Moment length_mom () const;
 };
+
 #endif // Music_sequence_HH
diff --git a/lily/include/music-sequence.hh b/lily/include/music-sequence.hh
new file mode 100644 (file)
index 0000000..736d4ab
--- /dev/null
@@ -0,0 +1,40 @@
+
+
+/*   
+  music-sequence.hh -- declare 
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#ifndef MUSIC_SEQUENCE_HH
+#define MUSIC_SEQUENCE_HH
+#include "music.hh"
+/**
+  Music can be a list of other "Music" elements
+ */
+class Music_sequence : public Music
+{
+public:
+  Music_sequence (SCM h);
+
+  SCM music_list () const;
+  void append_music (Music *);
+  VIRTUAL_COPY_CONS(Music);
+
+  Musical_pitch do_relative_octave (Musical_pitch p, bool b);
+  virtual void transpose (Musical_pitch );
+  void truncate (int k);
+  virtual void compress (Moment);
+  int length_i () const;
+  Moment cumulative_length () const;
+  Moment maximum_length () const;
+  
+protected:
+  virtual Musical_pitch to_relative_octave (Musical_pitch);
+  virtual void do_print() const;
+
+};
+#endif
index 97bbe2abc14ce685f75e732d6ca5356753a5a8b4..8200709e52f4d803b08c4c7d44b69220c85a0296 100644 (file)
@@ -31,7 +31,7 @@ public:
 protected:
   virtual void do_print () const;
   virtual void do_process_and_next (Moment) ;
-  virtual Music_iterator *try_music_in_children (Music const *) const;
+  virtual Music_iterator *try_music_in_children (Music *) const;
 
   Music_iterator *child_iter_p_;
 };
index 95d7f0bd84dde133dc280f7aee93170e3aedecb0..76987deac5827e9dadaa45efe388fdb664105cc5 100644 (file)
   */
 class Music_wrapper : public Music
 {
-  Music * element_p_;
 public:
   Music_wrapper (Music*);
-  Music * element_l () const;
+  Music * element () const;
   virtual void transpose (Musical_pitch);
   virtual void do_print () const;
   
   VIRTUAL_COPY_CONS(Music);
-  Music_wrapper (Music_wrapper const&);
   virtual Moment length_mom () const;
-  virtual ~Music_wrapper ();
   virtual Musical_pitch to_relative_octave (Musical_pitch);
   virtual void compress (Moment);
 };
index ce355795d97dba423846a152a5f270d647932bee..2eee399d18de24bc6be327c4a755bfdeac18fe31 100644 (file)
 #define MUSIC_HH
 
 #include "virtual-methods.hh"
-#include "input.hh"
 #include "minterval.hh"
 #include "lily-proto.hh"
 #include "string.hh"
+#include "smobs.hh"
 
 /** Music is anything that has duration and supports both time compression and
   transposition.
   @see Music_sequence
 
   */
-class Music:public Input {
+class Music {
 public:
+  DECLARE_SMOBS;
+  SCM immutable_property_alist_;
+  SCM mutable_property_alist_;
+  Input *origin () const; 
+  void set_spot (Input);  
+  
+  SCM get_mus_property (const char*) const;
+  SCM get_mus_property (SCM) const;
+  void set_mus_property (const char * , SCM val);
+  void set_immutable_mus_property (const char * , SCM val);
+  void set_immutable_mus_property (SCM key, SCM val);  
+  void set_mus_property (SCM , SCM val);  
+  void set_mus_pointer (const char*, SCM val);
+  SCM remove_mus_property (const char* nm);
+
+  virtual SCM do_derived_mark ();
   virtual Musical_pitch to_relative_octave (Musical_pitch);
 
   /// The duration of this piece of music
   virtual Moment length_mom () const;
 
-  virtual ~Music(){}
+  virtual ~Music();
   void print() const;
   /// Transpose, with the interval central C to #p#
   virtual void transpose (Musical_pitch p);
@@ -43,12 +60,14 @@ public:
   /// Scale the music in time by #factor#.
   virtual void compress (Moment factor);
   VIRTUAL_COPY_CONS(Music);
-  
+  Music (Music const &m);
   Music();
 protected:
   virtual void do_print() const;
 };
 
+
+Music * unsmob_music (SCM);
 #endif // MUSIC_HH
 
 
index f266642eb23e3d5e18a99c07da0ca690ff5ad94f..8590868d81664b5e4ccda4b4892efd6845a4310a 100644 (file)
 #include "music.hh"
 #include "protected-scm.hh"
 
+
+/*
+  
+props:
+
+  relevant stuff: the predicate, the symbol, the value
+
+ */
 class Output_property : public Music
 {
 public:
   Output_property(SCM, SCM, SCM);
-
-  /**
-    relevant stuff: the predicate, the symbol, the value
-   */
-  Protected_scm pred_sym_val_list_;
 };
 
 #endif /* OUTPUT_PROPERTY_HH */
index ff9846cfbf543b277086dcfd479523cc2b2ea9fc..a0660f80321d9d726d268b82b722cca3a49a8ad6 100644 (file)
  */
 class Paper_outputter
 {
-#if 0
-  Protected_scm molecules_;
-  SCM last_cons_;
-#endif
-  
   bool verbatim_scheme_b_;
   Paper_stream * stream_p_;
 public:
index 41823001cb112781092b6d753fbcc1ad6a451365..31914b2c206176575f6a94a100cf5a6d978f219e 100644 (file)
@@ -38,8 +38,6 @@ public:
   int find_col_idx (Paper_column const *) const;
 
   Link_array<Item> broken_col_range (Item const*,Item const*) const;
-    
-    
   void typeset_line (Line_of_score*);
     
 protected:
index 4f373f59584e65443431ad64056458ee6114e17f..cb9b9b57604558839f5bc70dcb5b5420577dc1b9 100644 (file)
 */
 class Repeated_music : public Music
 {
+  Music * repeat_body_p_;
+  Music_sequence * alternatives_p_;
 public:
+
+  Music * body () const;
+  Music_sequence * alternatives () const;
   String type_;
   
   bool fold_b_;
@@ -58,10 +63,6 @@ public:
 
   /// how often do we repeat?
   int repeats_i_;
-
-  Music * repeat_body_p_;
-  Music_sequence * alternatives_p_;
-
   virtual Musical_pitch to_relative_octave (Musical_pitch);
 
   /// The duration of this piece of music
@@ -79,7 +80,6 @@ public:
 
   Repeated_music (Music*, int , Music_sequence*);
   Repeated_music (Repeated_music const&);
-  ~Repeated_music ();
 protected:
   virtual void do_print() const;
 };
index fb9b38e0428d6b6c9b37710dd9950fc04bddcb06..bc092479927baf886341bc77d9a2ed54c52cf6b1 100644 (file)
@@ -22,7 +22,6 @@ class Request_chord_iterator : public Music_iterator {
    */
   Moment elt_length_mom_;
   bool last_b_;
-  Cons<Music>* cursor_;
 
 public:
   Request_chord_iterator ();
index eaf4e3cebded55e30e53613213337fadae3da9db..7ce14c8cc1aef7a8e6d650fd2fc918db2e23a87f 100644 (file)
@@ -131,7 +131,7 @@ public:
   virtual void do_break_processing ();
   virtual Score_element *find_broken_piece (Line_of_score*) const;
   virtual void discretionary_processing ();
-  virtual void do_derived_mark ();
+  virtual SCM do_derived_mark ();
 
   Molecule get_molecule () const;
   void suicide ();
index 7be4e5c20b3a38ea3926cc3a5bb512eaa7479989..b7515dc32abfcebdf7d6a5bc5e4ec426be1d0f40 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "input.hh"
 #include "lily-proto.hh"
+#include "protected-scm.hh"
 #include "parray.hh"
 
 /// the total music def of one movement
@@ -19,7 +20,7 @@ class Score: public Input {
 public:
   /// paper_, staffs_ and commands_ form the problem definition.
   Link_array<Music_output_def> def_p_arr_;
-  Music * music_p_;
+  Protected_scm music_;
   Scope * header_p_;
 
   int errorlevel_i_;
index 0d2565abf5dc3536b01e4afad8395a773ca3fa2c..79f493fa8724d02ba34321300383245f4e943291 100644 (file)
@@ -28,13 +28,13 @@ public:
 protected:
   virtual void do_print() const;
   virtual void do_process_and_next (Moment);
-  virtual Music_iterator *try_music_in_children (Music const*) const;
+  virtual Music_iterator *try_music_in_children (Music *) const;
 
 
 private:
   Moment here_mom_;
 
-  Cons<Music> *cursor_;
+  SCM cursor_;
   Music_iterator * iter_p_;
 
   /*
index 96ec9147602aefee7c6f6471f09521df8a5bb4b4..6c4008a95b619682a50f72b28dab0fde8ba7a28d 100644 (file)
@@ -29,7 +29,7 @@ public:
 protected:
   virtual void do_print () const;
   virtual void do_process_and_next (Moment);
-  virtual Music_iterator *try_music_in_children (Music const*) const;
+  virtual Music_iterator *try_music_in_children (Music *) const;
 
 
 private:
index dd5a61b21b06e6336a8575d856e0efb866658d40..165ed99efe23b04b27c93ec9b2bc7965d416c7cb 100644 (file)
@@ -34,7 +34,10 @@ class Spanner : public  Score_element {
 
 public:
   Link_array<Spanner> broken_into_l_arr_;
+
+  // todo: move to somewhere else.
   Real get_broken_left_end_align () const;
+  
   // TODO: make virtual and do this for Items as well.
   Interval_t<int> spanned_rank_iv ();
   void set_bound (Direction d, Score_element*);
@@ -48,7 +51,7 @@ public:
 
   static int compare (Spanner * const &,Spanner * const &);
   virtual Score_element* find_broken_piece (Line_of_score*) const;
-  virtual void do_derived_mark ();
+  virtual SCM do_derived_mark ();
 protected:
   void set_my_columns ();
   VIRTUAL_COPY_CONS(Score_element);
index aecce178f22fb87cbfadd05f5d62f675c0a9bc61..ffb2968a2967d98c039def18451b14f642131dd2 100644 (file)
 #define TRANSLATION_PROPERTY_HH
 
 #include "music.hh"
-#include "protected-scm.hh"
 
 
 /**
-  Set a property of Translator 
- */
+  Set a property of Translator
+
+  value -- the value to set
+  symbol -- the symbol to set.
+
+*/
 class Translation_property : public Music
 {
 public:
-  String var_str_;
-  Protected_scm value_;
-  
   VIRTUAL_COPY_CONS(Music);
-  
-protected:
-  virtual void do_print () const;
 };
 
 #endif // PROPERTY_HH
index 8ceac15def10e694993daea1f0a0fe637b1d95a1..5bb0d08e28d5ec260f9370ec5f1efd13580df7aa 100644 (file)
@@ -40,6 +40,7 @@ protected:
 public:
   SCM get_property (SCM name_sym) const;
   void set_property (String var_name, SCM value);
+  void set_property (SCM var_sym, SCM value);  
   Translator_group *where_defined (SCM name_sym) const;
 
   String id_str_;
index 9008f3042098f35581f1f6cd053622ae6bcbfd1b..97a649a10a54f3e025050a163f4f4a651061df97 100644 (file)
@@ -39,7 +39,7 @@ public:
   Music_iterator * current_iter_p_;
   
   /// pointer to the alternative that will be processed next.
-  Cons<Music> *alternative_cons_l_;
+  SCM alternative_cons_;
   ~Unfolded_repeat_iterator();
   Unfolded_repeat_iterator ();
 
@@ -48,7 +48,7 @@ protected:
   virtual void construct_children ();
   virtual Moment next_moment () const;
   virtual void do_process_and_next (Moment);
-  virtual Music_iterator *try_music_in_children (Music const*) const;
+  virtual Music_iterator *try_music_in_children (Music *) const;
 
   virtual bool ok () const;
   virtual void next_element ();
diff --git a/lily/input-smob.cc b/lily/input-smob.cc
new file mode 100644 (file)
index 0000000..ead1b74
--- /dev/null
@@ -0,0 +1,76 @@
+/*   
+  input-smob.cc --  implement Input smob
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#include "input.hh"
+#include "input-smob.hh"
+#include "string.hh"
+#include "ly-smobs.icc"
+
+static long input_tag;
+
+
+static
+SCM mark_smob (SCM)
+{
+  return SCM_EOL;
+}
+
+static int
+print_smob (SCM s, SCM port, scm_print_state *)
+{
+  String str = "#<location" +  unsmob_input (s)->location_str () + ">";
+  scm_puts (str.ch_C(), port);
+  return 1;
+}
+
+static
+scm_sizet free_smob (SCM s)
+{
+  delete unsmob_input (s);
+  return 0;
+}
+
+static
+void start_input_smobs()
+{
+  input_tag
+    = scm_make_smob_type_mfpe ("input", 0,
+                              mark_smob, free_smob,
+                              print_smob, 0);
+}
+
+SCM
+make_input (Input ip)
+{
+  Input * nip =  new Input (ip);
+  SCM z;
+  
+  SCM_NEWCELL(z);
+  SCM_SETCAR (z, (SCM)input_tag);
+  SCM_SETCDR (z, (SCM)nip);
+                               // fixme: done_malloc
+  return z;
+}
+
+Input *                                                
+unsmob_input (SCM s)
+{
+  if (SCM_IMP (s))
+    return 0;
+  if ((long)SCM_CAR(s) == input_tag) // ugh.
+    return (Input*) SCM_CDR(s);
+  else                                         
+    return 0;                                  
+}
+
+
+ADD_SCM_INIT_FUNC(input, start_input_smobs);
+
+
+Input dummy_input_global;
index 8b65565b943c539794d8f881ad93be02c68814c4..26520d46e3346d6d270f474a09c6fc5d3f5d0e0e 100644 (file)
@@ -64,7 +64,7 @@ Instrument_name_engraver::create_text (SCM txt)
       if (delim_)
        text_->set_parent (delim_, Y_AXIS);
 
-      announce_element (Score_element_info (text_,0));
+      announce_element (text_,0);
     }
 }
 
index 4e995bfd775c9c5fd03bd8cab90d40cba06020f7..d9531c6dfb100eeb69c759b34ffaa4ce7c4d09c5 100644 (file)
@@ -149,6 +149,12 @@ Item::handle_prebroken_dependencies ()
   /*
     Can't do this earlier, because try_visibility_lambda () might set
     the elt property transparent, which would then be copied.
+
+    TODO:
+
+    handle visibility-lambda the item itself iso. breakstatusdir, so
+    the function can do more complicated things.
+    
   */
   SCM vis = get_elt_property ("visibility-lambda");
   if (gh_procedure_p (vis))
@@ -170,3 +176,12 @@ Item::handle_prebroken_dependencies ()
     }
 }
 
+SCM
+Item::do_derived_mark ()
+{
+  if (broken_to_drul_[LEFT])
+    scm_gc_mark (broken_to_drul_[LEFT]->self_scm_);
+  if (broken_to_drul_[RIGHT])
+    scm_gc_mark (broken_to_drul_[RIGHT]->self_scm_);
+  return SCM_EOL;
+}
index 9208f26ab3850017d7965c0f5c0a5b7535ef8704..9f1b66d1a6822835e3a121080ea387197a36ec01 100644 (file)
@@ -9,7 +9,7 @@
 #include "key-item.hh"
 #include "command-request.hh"
 #include "musical-request.hh"
-#include "local-key-item.hh"
+#include "item.hh"
 #include "bar.hh"
 #include "timing-translator.hh"
 #include "staff-symbol-referencer.hh"
@@ -65,6 +65,7 @@ Key_engraver::create_key (bool def)
       item_p_->set_elt_property ("new-accidentals", get_property ("keySignature"));
 
       Staff_symbol_referencer::set_interface (item_p_);
+      Key_item::set_interface (item_p_);
 
       SCM prop = get_property ("keyOctaviation");
       bool multi = to_boolean (prop);
@@ -72,7 +73,7 @@ Key_engraver::create_key (bool def)
       if (multi)
        item_p_->set_elt_property ("multi-octave", gh_bool2scm (multi));
       
-      announce_element (Score_element_info (item_p_,keyreq_l_));
+      announce_element (item_p_,keyreq_l_);
     }
 
   if (!def)
@@ -137,10 +138,11 @@ Key_engraver::do_pre_move_processing ()
 void
 Key_engraver::read_req (Key_change_req const * r)
 {
-  if (r->pitch_alist_ == SCM_UNDEFINED)
+  SCM p = r->get_mus_property ("pitch-alist");
+  if (p == SCM_UNDEFINED)
     return;
 
-  SCM n = scm_list_copy (r->pitch_alist_);
+  SCM n = scm_list_copy (p);
   SCM accs = SCM_EOL;
   for (SCM s = get_property ("keyAccidentalOrder");
        gh_pair_p (s); s = gh_cdr (s))
index b55210a4487d60e37f598f9e37f47e2acf81b4a2..79fdac637e6468d4ed7882c82a072b88f93921df 100644 (file)
@@ -26,7 +26,7 @@ Key_performer::~Key_performer ()
 void
 Key_performer::do_process_music ()
 {
-  if (key_req_l_ && key_req_l_->pitch_alist_ != SCM_UNDEFINED)
+  if (key_req_l_ && key_req_l_->get_mus_property ("pitch-alist") != SCM_UNDEFINED)
     {
       audio_p_ = new Audio_key (); // *key_req_l_->key_);
       Audio_element_info info (audio_p_, key_req_l_);
index 7178826d35fb44977c709f744847bbb84d0acf39..9be2c940854c4aa06e5984c719e1828054bf8a11 100644 (file)
@@ -137,9 +137,9 @@ HYPHEN              --
        String s (YYText ()+1);
        s = s.left_str (s.index_last_i ('"'));
        DEBUG_OUT << "#version `" << s << "'\n";
+       yy_pop_state ();
        if (!valid_version_b (s))
                return INVALID;
-       yy_pop_state ();
 }
 <version>.     {
        LexerError ("No quoted string found after \\version");
@@ -477,9 +477,14 @@ My_lily_lexer::scan_escaped_word (String str)
        } else if (gh_number_p (sid)) {
                yylval.scm = sid;
                return NUMBER_IDENTIFIER;
+       } else if (Music * mus =unsmob_music (sid)) {
+               yylval.scm = sid;
+               
+               return dynamic_cast<Request*> (mus) ? REQUEST_IDENTIFIER : MUSIC_IDENTIFIER;
        }
 
 
+
        Identifier * id = unsmob_identifier (sid);
        if (id) {
                yylval.id = id;
index 908396dbe85d9b50b0fc012670d51b18f12d2c64..53c61f40c3d0c92284bffa464007463a9e18dd45 100644 (file)
@@ -52,7 +52,7 @@ Line_group_engraver_group::do_creation_processing()
   staffline_p_->set_bound(LEFT,it);
   Pointer_group_interface (it, "bounded-by-me").add_element (staffline_p_);
   
-  Engraver::announce_element (Score_element_info (staffline_p_,0));
+  Engraver::announce_element (staffline_p_,0);
 }
 
 void
index 2811792adb5687dae6cf3b8cdef6def9536c1cce..476ade7070aecbdbf9b818098a329c0bb0aa9068 100644 (file)
@@ -43,14 +43,17 @@ Line_number_engraver::process_acknowledged ()
       text_item_p_->set_parent (interesting_[0].elem_l_, Y_AXIS);
 
 
-      announce_element (Score_element_info (text_item_p_, 0));
+      announce_element (text_item_p_, 0);
     }
 }
 
 void
 Line_number_engraver::acknowledge_element (Score_element_info inf)
 {
-  if (Note_head::has_interface (inf.elem_l_))
+  if (!inf.req_l_)
+    return ;
+  
+  if ( Note_head::has_interface (inf.elem_l_))
     {
       interesting_.push (inf);
       support_.push (inf.elem_l_);
@@ -73,7 +76,7 @@ Line_number_engraver::do_pre_move_processing ()
          if (i)
            s += ",";
          
-         s += interesting_[i].req_l_->line_number_str ();
+         s += interesting_[i].req_l_->origin ()->line_number_str ();
          
        }
 
index 2067092594fb7ab094f0e0afd95575e22b95fec1..07fd651e14d01defb6b9d8f163dba769f0d34b44 100644 (file)
@@ -7,7 +7,7 @@
 #include "musical-request.hh"
 #include "command-request.hh"
 #include "local-key-item.hh"
-#include "key-item.hh"
+#include "item.hh"
 #include "tie.hh"
 #include "rhythmic-head.hh"
 #include "timing-translator.hh"
@@ -25,7 +25,7 @@
    (FIXME).
  */
 struct Local_key_engraver : Engraver {
-  Local_key_item *key_item_p_;
+  Item *key_item_p_;
 protected:
   VIRTUAL_COPY_CONS(Translator);
   virtual void do_process_music();
@@ -97,12 +97,13 @@ Local_key_engraver::process_acknowledged ()
            {
              if (!key_item_p_) 
                {
-                 key_item_p_ = new Local_key_item (get_property ("basicLocalKeyProperties"));
+                 key_item_p_ = new Item(get_property ("basicLocalKeyProperties"));
+                 Local_key_item::set_interface (key_item_p_);
                  Side_position::set_axis (key_item_p_, X_AXIS);
                  Side_position::set_direction (key_item_p_, LEFT);
                  Staff_symbol_referencer::set_interface (key_item_p_);
                         
-                 announce_element (Score_element_info (key_item_p_, 0));
+                 announce_element (key_item_p_, 0);
                }
 
              
@@ -110,14 +111,18 @@ Local_key_engraver::process_acknowledged ()
                sign (prev_acc) * (prev_acc - a) == 1
                && abs(prev_acc) == 2;
 
-             key_item_p_->add_pitch (note_l->pitch_,
-                                     note_l->cautionary_b_,
-                                     extra_natural);
+             Local_key_item::add_pitch (key_item_p_, note_l->pitch_,
+                                        note_l->cautionary_b_,
+                                        extra_natural);
              Side_position::add_support (key_item_p_,support_l);
            }
          
          if (!forget)
            {
+             /*
+               not really really correct if there are more than one
+               noteheads with the same notename.
+              */
              localsig = scm_assoc_set_x (localsig, gh_cons (gh_int2scm (o),
                                                             gh_int2scm (n)),
                                          gh_int2scm (a)); 
@@ -141,10 +146,8 @@ Local_key_engraver::process_acknowledged ()
 
   
   
-  daddy_trans_l_->set_property ("localKeySignature",  localsig);
+      daddy_trans_l_->set_property ("localKeySignature",  localsig);
     }
-  /*
-   */
   
   if (key_item_p_ && grace_align_l_)
     {
@@ -218,16 +221,20 @@ Local_key_engraver::do_process_music()
   Moment mp =  (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
 
   SCM sig = get_property ("keySignature");
-  if (!mp)
-    {
-      if (!to_boolean (get_property ("noResetKey")))
-       daddy_trans_l_->set_property ("localKeySignature",  ly_deep_copy (sig));
-    }
-  else if (last_keysig_ != sig) 
+
+  /*
+    Detect key sig changes. If we haven't found any, check if at start
+    of measure, and set localKeySignature anyhow.  */
+  if (last_keysig_ != sig) 
     {
       daddy_trans_l_->set_property ("localKeySignature",  ly_deep_copy (sig));
       last_keysig_ = sig;
     }
+  else if (!mp)
+    {
+      if (!to_boolean (get_property ("noResetKey")))
+       daddy_trans_l_->set_property ("localKeySignature",  ly_deep_copy (sig));
+    }
 }
 
 
index 9cc338a48a5180f7e1e0b3ac751f139506c1ea21..6ef1dfba8a7f1b83f601742b61b7ba2f213bdb95 100644 (file)
 #include "rhythmic-head.hh"
 #include "misc.hh"
 
+SCM
+pitch_less  (SCM p1, SCM p2)
+{
+  for (int i = 3; i--; p1 = gh_cdr (p1), p2 = gh_cdr (p2))
+    {
+      if (scm_less_p (gh_car (p1), gh_car (p2)))
+       return SCM_BOOL_T;
+      if (gh_car (p1) != gh_car (p2))
+       return SCM_BOOL_F;
+    }
+  return SCM_BOOL_T;
+}
+
+SCM pitch_less_proc;
+
+
 void
-Local_key_item::add_pitch (Musical_pitch p, bool cautionary, bool natural)
+init_pitch_funcs ()
 {
-  for (int i=0; i< accidental_arr_.size(); i++)
-    if (!Musical_pitch::compare (p, accidental_arr_[i].pitch_))
-      return;
-         /* maybe natural (and cautionary) should be modif. nonetheless? */
-
-  Local_key_cautionary_tuple t;
-  t.pitch_ = p;
-  t.cautionary_b_ = cautionary;
-  t.natural_b_ = natural;
-  accidental_arr_.push (t);
+  pitch_less_proc = gh_new_procedure2_0 ("pitch-less", &pitch_less);
 }
 
-MAKE_SCHEME_CALLBACK(Local_key_item,before_line_breaking);
+ADD_SCM_INIT_FUNC(pitch,init_pitch_funcs);
 
-SCM
-Local_key_item::before_line_breaking (SCM smob)
+
+void
+Local_key_item::add_pitch (Score_element*me, Musical_pitch p, bool cautionary, bool natural)
 {
-  Local_key_item* me = dynamic_cast<Local_key_item*>(unsmob_element (smob));
-  me->accidental_arr_.sort (Local_key_cautionary_tuple::compare);
-  return SCM_UNSPECIFIED;
+  SCM acs = me->get_elt_property ("accidentals");
+  SCM pitch = p.to_scm ();
+  SCM opts = SCM_EOL;
+  if (cautionary)
+    opts = gh_cons (ly_symbol2scm ("cautionary"), opts);
+  if (natural)
+    opts = gh_cons (ly_symbol2scm ("natural"), opts);
+
+  pitch = gh_append2 (pitch, opts);
+  acs = scm_merge_x (acs, gh_cons (pitch, SCM_EOL), pitch_less_proc);
+
+  me->set_elt_property ("accidentals", acs);
 }
 
 Molecule
-Local_key_item::accidental (Score_element*me, int j, bool cautionary, bool natural) 
+Local_key_item::parenthesize (Score_element*me, Molecule m)
 {
-  Molecule m (me->lookup_l ()->afm_find (String ("accidentals-") + to_str (j)));
-  if (natural)
-    {
-      Molecule prefix = me->lookup_l ()->afm_find (String ("accidentals-0"));
-      m.add_at_edge(X_AXIS, LEFT, Molecule(prefix), 0);
-    }
-  if (cautionary) 
-    {
-      Molecule open = me->lookup_l ()->afm_find (String ("accidentals-("));
-      Molecule close = me->lookup_l ()->afm_find (String ("accidentals-)"));
-      m.add_at_edge(X_AXIS, LEFT, Molecule(open), 0);
-      m.add_at_edge(X_AXIS, RIGHT, Molecule(close), 0);
-    }
-  
+  Molecule open = me->lookup_l ()->afm_find (String ("accidentals-("));
+  Molecule close = me->lookup_l ()->afm_find (String ("accidentals-)"));
+  m.add_at_edge(X_AXIS, LEFT, Molecule(open), 0);
+  m.add_at_edge(X_AXIS, RIGHT, Molecule(close), 0);
+
   return m;
 }
 
 /*
-  UGH. clean me up
+  UGH. clean me, revise placement routine (See Ross & Wanske;
+  accidental placement is more complicated than this.
  */
 
 MAKE_SCHEME_CALLBACK(Local_key_item,brew_molecule);
 SCM
 Local_key_item::brew_molecule (SCM smob)
 {
-  Local_key_item* lki = dynamic_cast<Local_key_item*>(unsmob_element (smob));
-  Score_element* me = lki;
+  Score_element* me = unsmob_element (smob);
   
   Molecule mol;
 
@@ -76,10 +84,13 @@ Local_key_item::brew_molecule (SCM smob)
   Molecule octave_mol;
   bool oct_b = false;
   int lastoct = -100;
-  
-  for  (int i = 0; i < lki->accidental_arr_.size(); i++) 
+
+  SCM accs = me->get_elt_property ("accidentals");
+  for  (SCM s = accs;
+       gh_pair_p (s); s = gh_cdr (s))
     {
-      Musical_pitch p (lki->accidental_arr_[i].pitch_);
+      Musical_pitch p (gh_car (s));
+      
       // do one octave
       if (p.octave_i_ != lastoct) 
        {
@@ -99,12 +110,20 @@ Local_key_item::brew_molecule (SCM smob)
       Real dy = (gh_number_p (c0) ? gh_scm2int (c0) : 0 + p.notename_i_)
        * note_distance;
       
-      Molecule m (accidental (me,p.accidental_i_,
-                             lki->accidental_arr_[i].cautionary_b_,
-                             lki->accidental_arr_[i].natural_b_));
+      Molecule acc (me->lookup_l ()->afm_find (String ("accidentals-")
+                                              + to_str (p.accidental_i_)));
+      
+      if (scm_memq (ly_symbol2scm ("natural"), gh_car (s)) != SCM_BOOL_F)
+       {
+         Molecule prefix = me->lookup_l ()->afm_find (String ("accidentals-0"));
+         acc.add_at_edge(X_AXIS, LEFT, Molecule(prefix), 0);
+       }
+
+      if (scm_memq (ly_symbol2scm ("cautionary"), gh_car (s)) != SCM_BOOL_F)
+       acc = parenthesize (me, acc);
 
-      m.translate_axis (dy, Y_AXIS);
-      octave_mol.add_at_edge (X_AXIS, RIGHT, m, 0);
+      acc.translate_axis (dy, Y_AXIS);
+      octave_mol.add_at_edge (X_AXIS, RIGHT, acc, 0);
     }
 
   if (oct_b)
@@ -115,7 +134,7 @@ Local_key_item::brew_molecule (SCM smob)
       octave_mol = Molecule ();
     }
   
- if (lki->accidental_arr_.size()) 
+ if (gh_pair_p (accs))
     {
       Drul_array<SCM> pads;
 
@@ -142,13 +161,13 @@ Local_key_item::brew_molecule (SCM smob)
   return mol.create_scheme();
 }
 
-Local_key_item::Local_key_item (SCM s)
-  : Item (s)
-{
-  
-}
 bool
 Local_key_item::has_interface (Score_element*m)
 {
   return m && m->has_interface (ly_symbol2scm ("accidentals-interface"));
 }
+void
+Local_key_item::set_interface (Score_element*m)
+{
+  m->set_interface (ly_symbol2scm ("accidentals-interface"));
+}
index fe73d4f62e35156920eb8fbedb96536bc64f4a5f..c422d79e63d3618b63796c0295aca63e17bc35ff 100644 (file)
 #include "lyric-combine-music.hh"
 #include "musical-request.hh"
 
-Busy_playing_req busy_req;
-Melisma_req melisma_start_req;
-Melisma_req melisma_stop_req;
-Melisma_playing_req melisma_playing_req;
-
+/*
+  Ugh, why static?
+ */
+Busy_playing_req *busy_req;
+Melisma_req *melisma_start_req;
+Melisma_req *melisma_stop_req;
+Melisma_playing_req * melisma_playing_req;
 
 Lyric_combine_music_iterator::Lyric_combine_music_iterator ()
 {
-  melisma_start_req.span_dir_ = START;
-  melisma_stop_req.span_dir_ = STOP;
+  if (!busy_req)
+    {
+      busy_req = new Busy_playing_req;
+      melisma_playing_req = new Melisma_playing_req;
+      melisma_stop_req = new Melisma_req;
+      melisma_start_req = new Melisma_req;      
+    }
+  melisma_start_req->span_dir_ = START;
+  melisma_stop_req->span_dir_ = STOP;
   
   music_iter_p_ =0;
   lyric_iter_p_ =0;
@@ -65,19 +74,20 @@ Lyric_combine_music_iterator::do_process_and_next (Moment m)
   
   music_iter_p_->process_and_next (m);
 
-  bool busy = try_music (&busy_req);
+  bool busy = try_music (busy_req);
   if (busy)
     {
-      bool melisma_b = try_music (&melisma_playing_req);
+      bool melisma_b = try_music (melisma_playing_req);
       if (!melisma_b)
        {
          if (lyric_iter_p_->ok ())
            {
+             // FIXME
 #if 0                          // devise a new way for this
              if (melisma_b && !melisma_started_b_)
-               lyric_iter_p_->try_music (&melisma_start_req);
+               lyric_iter_p_->try_music (melisma_start_req);
              else if (melisma_started_b_)
-               lyric_iter_p_->try_music (&melisma_stop_req);
+               lyric_iter_p_->try_music (melisma_stop_req);
 #endif
              
              Moment m= lyric_iter_p_->next_moment ();
@@ -86,8 +96,6 @@ Lyric_combine_music_iterator::do_process_and_next (Moment m)
        }
     }
   
-
-  
   Music_iterator::do_process_and_next (m);
 }
 
@@ -98,7 +106,7 @@ Lyric_combine_music_iterator::~Lyric_combine_music_iterator ()
 }
 
 Music_iterator*
-Lyric_combine_music_iterator::try_music_in_children (Music const *m) const
+Lyric_combine_music_iterator::try_music_in_children (Music *m) const
 {
   Music_iterator * i =  music_iter_p_->try_music (m);
   if (i)
index 5676d4cff0d48cf30d456650b98d3ca350da7ddd..d6e42d2cbced0d83353e119fbf25710115e6ffce 100644 (file)
 
 Lyric_combine_music::Lyric_combine_music (Music * m, Music * l)
 {
-  music_p_ = m;
-  lyrics_p_ = l;
+  set_mus_property ("music", m->self_scm_);
+  set_mus_property ("lyrics", l->self_scm_);  
 }
 
-Lyric_combine_music::~Lyric_combine_music ()
-{
-  delete music_p_;
-  delete lyrics_p_;
-}
-
-Lyric_combine_music::Lyric_combine_music (Lyric_combine_music const&s)
-  : Music (s)
-{
-  music_p_ = s.music_p_ ? s.music_p_->clone ():0;
-  lyrics_p_ = s.lyrics_p_ ? s.lyrics_p_->clone ():0;
-}
 
 void
 Lyric_combine_music::transpose (Musical_pitch p)
 {
-  music_p_->transpose (p);
-  lyrics_p_->transpose (p);
+  music_l ()->transpose (p);
+  lyrics_l () ->transpose (p);
 }
 
 void
 Lyric_combine_music::do_print () const  
 {
-  music_p_->print();
-  lyrics_p_->print ();
+  music_l ()->print();
+  lyrics_l () ->print ();
 }
 
 Moment
 Lyric_combine_music::length_mom () const
 {
-  return music_p_->length_mom ();
+  return music_l ()->length_mom ();
 }
 
 Musical_pitch
 Lyric_combine_music::to_relative_octave (  Musical_pitch p )
 {
-  p = music_p_->to_relative_octave (p);
-  return lyrics_p_->to_relative_octave (p);
+  p = music_l ()->to_relative_octave (p);
+  return lyrics_l () ->to_relative_octave (p);
 }
 
 void
 Lyric_combine_music::compress (Moment m)
 {
-  music_p_->compress (m);
+  music_l ()->compress (m);
 }
 
 Music*
 Lyric_combine_music::music_l () const
 {
-  return music_p_;
+  return unsmob_music (get_mus_property ("music"));
 }
 
 Music*
 Lyric_combine_music::lyrics_l () const
 {
-  return lyrics_p_;
+  return unsmob_music (get_mus_property ("lyrics"));
 }
index 9f142dc891d68b01b821a73c9c93a59d63035ea9..3108ca01a4c3c7b8f55effdb44db7f1c6811c2a7 100644 (file)
@@ -53,7 +53,7 @@ Lyric_engraver::do_process_music()
       */
       text_p_->translate_axis (paper_l()->get_var ("quartwidth")/2, X_AXIS);
       
-      announce_element (Score_element_info (text_p_, req_l_));
+      announce_element (text_p_, req_l_);
     }
 }
 
index 9a9b96e245d8d239732b9606ce1983ea96dcd381..6b37780158ebaf01594677c936093b670a93a6cc 100644 (file)
@@ -123,7 +123,7 @@ Mark_engraver::create_items (Request *rq)
     }
 
   
-  announce_element (Score_element_info (text_p_, rq));
+  announce_element (text_p_, rq);
 }
 
 
@@ -161,9 +161,11 @@ Mark_engraver::do_process_music ()
       /*
        automatic marks.
        */
-      SCM m = (mark_req_l_->mark_label_ == SCM_UNDEFINED)
-       ? get_property ("rehearsalMark")
-       : SCM(mark_req_l_->mark_label_);
+      
+      SCM m = mark_req_l_->get_mus_property ("label");
+      if (gh_string_p (m)) 
+       m =  get_property ("rehearsalMark");
+;
       
       if (gh_number_p (m))
        {
index 214ea14fc2405eba94251d32e7ecf4bb95f10750..d6a34e326866f05b14efcc701979e22250800554 100644 (file)
@@ -115,7 +115,7 @@ Multi_measure_rest_engraver::do_process_music ()
       Multi_measure_rest::set_interface (mmrest_p_);
       Staff_symbol_referencer::set_interface (mmrest_p_);
 
-      announce_element (Score_element_info (mmrest_p_, busy_span_req_l_));
+      announce_element (mmrest_p_, busy_span_req_l_);
       start_measure_i_
        = gh_scm2int (get_property ("currentBarNumber"));
     }
index 1ad45da5238e29a404f5cb51923948a5069098cd..d3a92834e74dc7ef23d39849747f97f67978765b 100644 (file)
@@ -122,33 +122,33 @@ Music_iterator::ok() const
 }
 
 Music_iterator*
-Music_iterator::static_get_iterator_p (Music const *m)
+Music_iterator::static_get_iterator_p (Music  *m)
 {
   Music_iterator * p =0;
 
   /* It would be nice to do this decentrally, but the order of this is
      significant.  */
-  if (dynamic_cast<Request_chord  const *> (m))
+  if (dynamic_cast<Request_chord   *> (m))
     p = new Request_chord_iterator;
-  else if (dynamic_cast<Lyric_combine_music const*> (m))
+  else if (dynamic_cast<Lyric_combine_music *> (m))
     p = new Lyric_combine_music_iterator;
-  else if (dynamic_cast<Simultaneous_music  const *> (m)) 
+  else if (dynamic_cast<Simultaneous_music   *> (m)) 
     p =  new Simultaneous_music_iterator;
-  else if (dynamic_cast<Sequential_music  const *> (m)) 
+  else if (dynamic_cast<Sequential_music   *> (m)) 
     p =  new Sequential_music_iterator;
-  else if (dynamic_cast<Translation_property  const *> (m))
+  else if (dynamic_cast<Translation_property   *> (m))
     p = new Property_iterator;
-  else if (dynamic_cast<Change_translator  const *> (m))
+  else if (dynamic_cast<Change_translator   *> (m))
     p = new Change_iterator;
-  else if (dynamic_cast<Time_scaled_music  const *> (m))
+  else if (dynamic_cast<Time_scaled_music   *> (m))
     p = new Time_scaled_music_iterator;
-  else if (dynamic_cast<Grace_music const*> (m))
+  else if (dynamic_cast<Grace_music *> (m))
     p = new Grace_iterator;
-  else if (dynamic_cast<Auto_change_music const*> (m))
+  else if (dynamic_cast<Auto_change_music *> (m))
     p = new Auto_change_iterator;
-  else if (dynamic_cast<Music_wrapper  const *> (m))
+  else if (dynamic_cast<Music_wrapper   *> (m))
     p = new Music_wrapper_iterator;
-  else if (Repeated_music const * n = dynamic_cast<Repeated_music const *> (m))
+  else if (Repeated_music  * n = dynamic_cast<Repeated_music  *> (m))
     {
       if (n->type_ == "tremolo")
        p = new Chord_tremolo_iterator;
@@ -167,10 +167,10 @@ Music_iterator::static_get_iterator_p (Music const *m)
 }
 
 void
-Music_iterator::init_translator (Music const *m, Translator_group  *report_l)
+Music_iterator::init_translator (Music  *m, Translator_group  *report_l)
 {
   music_l_ = m;
-  if (Context_specced_music const * csm =dynamic_cast<Context_specced_music const*>(m))
+  if (Context_specced_music  * csm =dynamic_cast<Context_specced_music *>(m))
     {
       Translator_group* a =report_l->
        find_create_translator_l (csm->translator_type_str_, csm->translator_id_str_);
@@ -185,7 +185,7 @@ Music_iterator::init_translator (Music const *m, Translator_group  *report_l)
 
 
 Music_iterator*
-Music_iterator::get_iterator_p (Music const*m) const
+Music_iterator::get_iterator_p (Music *m) const
 {
   Music_iterator*p = static_get_iterator_p (m);
   p->init_translator (m, report_to_l());
@@ -200,7 +200,7 @@ Music_iterator::Music_iterator()
 }
 
 Music_iterator*
-Music_iterator::try_music (Music const *m) const
+Music_iterator::try_music (Music  *m) const
 {
   bool b = report_to_l ()->try_music ((Music*)m); // ugh
   Music_iterator * it = b ? (Music_iterator*) this : 0;        // ugh
@@ -210,7 +210,7 @@ Music_iterator::try_music (Music const *m) const
 }
 
 Music_iterator*
-Music_iterator::try_music_in_children (Music const *  ) const
+Music_iterator::try_music_in_children (Music  *  ) const
 {
   return 0;
 }
index 5824cc7ada243450c1e00f4372f003ac4827b840..4df9c53da4b360a252f51cd826c8bf48cdfb860c 100644 (file)
@@ -21,25 +21,18 @@ Simultaneous_music::length_mom () const
   return maximum_length ();
 }
 
-
-void
-Music_sequence::compress (Moment m)
-{
-  for (Cons<Music> *i = music_p_list_p_->head_; i;  i = i->next_)
-    i->car_->compress (m);
-}
-
-Simultaneous_music::Simultaneous_music(Music_list *p)
-  : Music_sequence (p)
+Simultaneous_music::Simultaneous_music(SCM head)
+  : Music_sequence (head)
 {
 
 }
 
-Sequential_music::Sequential_music(Music_list *p)
-  : Music_sequence (p)
+Sequential_music::Sequential_music(SCM head)
+  : Music_sequence (head)
 {
 }
 
+
 Moment
 Sequential_music::length_mom () const
 {
@@ -52,57 +45,18 @@ Simultaneous_music::to_relative_octave (Musical_pitch p)
   return do_relative_octave (p, true);
 }
 
-
-
-
-Musical_pitch 
-Music_list::do_relative_octave (Musical_pitch last, bool ret_first)
-{
-  Musical_pitch retval;
-  int count=0;
-  for (Cons<Music> *i = head_; i ; i = i->next_)
-    {
-      last = i->car_->to_relative_octave (last);
-      if (!count ++ )
-       retval = last;
-    }
-
-  if (!ret_first)
-    retval = last;
-  
-  return retval;
-}
-
-
-Music_list::Music_list (Music_list const &s)
-  : Cons_list<Music> (s), Input (s)
+Request_chord::Request_chord(SCM s)
+  : Simultaneous_music (s)
 {
-  Cons_list<Music>::init ();
-  clone_killing_cons_list (*this, s.head_);
 }
 
-
-void
-Music_list::add_music (Music*m_p)
-{
-  if (!m_p)
-    return;
-
-  append (new Killing_cons<Music> (m_p, 0));
-}
-
-Request_chord::Request_chord()
-  : Simultaneous_music (new Music_list)
-{
-}
-
-
 Musical_pitch
 Request_chord::to_relative_octave (Musical_pitch last)
 {
-  for (Cons<Music> *i = music_p_list_p_->head_; i ; i = i->next_)
-    {
-      if (Melodic_req *m= dynamic_cast <Melodic_req *> (i->car_))
+   for (SCM s = music_list (); gh_pair_p (s);  s = gh_cdr (s))
+     {
+       Music * mus = unsmob_music (gh_car (s));
+      if (Melodic_req *m= dynamic_cast <Melodic_req *> (mus))
        {
          Musical_pitch &pit = m->pitch_;
          pit.to_relative_octave (last);
@@ -113,11 +67,4 @@ Request_chord::to_relative_octave (Musical_pitch last)
 }
 
 
-Music_list::Music_list ()
-{
-}
 
-Music_sequence::~Music_sequence ()
-{
-  delete music_p_list_p_;
-}
index 9d5801d2f2299cc04fc51d13734e139202521331..aa3bc2eb352b91c5a7b818f993a8927462d554a8 100644 (file)
 #include "debug.hh"
 #include "musical-pitch.hh"
 
-Music_sequence::Music_sequence (Music_sequence const&s)
-  : Music (s)
+
+void
+Music_sequence::truncate (int k)
 {
-  music_p_list_p_ = new Music_list (*s.music_p_list_p_);
-}
+  SCM l = get_mus_property ("list");
+  if (k == 0)
+    {
+      l = SCM_EOL;
+    }
+  else
+    {
+      SCM s = l;
+      k--;
+      for (; gh_pair_p (s) && k--; s = gh_cdr (s))
+       ;
 
+      if (gh_pair_p (s))
+       {
+         gh_set_cdr_x (s, SCM_EOL);
+       }
+    }
+  set_mus_property ("list", l);
+}
 
+SCM
+Music_sequence::music_list ()const
+{
+  return get_mus_property ("list");
+}
 
-Music_sequence::Music_sequence(Music_list *mlist_p)
+/*
+  Ugh this sucks. Linear. do not use.
+ */
+void
+Music_sequence::append_music (Music *m)
+{
+  set_mus_property ("list",
+                   gh_append2( music_list(), gh_cons (m->self_scm_, SCM_EOL)));
+}
+Music_sequence::Music_sequence(SCM h)
 {
-  music_p_list_p_ = mlist_p;
+  set_mus_property ("list", h);
 }
 
 void
 Music_sequence::transpose (Musical_pitch rq)
 {
-  for (Cons<Music> *i = music_p_list_p_->head_; i;  i = i->next_)
-    i->car_->transpose (rq);    
+  for (SCM s = music_list (); gh_pair_p (s);  s = gh_cdr (s))
+    unsmob_music (gh_car (s))->transpose (rq);    
 }
 
 void
 Music_sequence::do_print() const
 {
 #ifndef NPRINT
-  for (Cons<Music> *i = music_p_list_p_->head_; i;  i = i->next_)  
-    i->car_->print();
+  for (SCM s = music_list (); gh_pair_p (s);  s = gh_cdr (s))
+    unsmob_music (gh_car (s))->print();
 #endif 
 }
 
 
-void
-Music_sequence::add_music (Music *m_p)
-{
-  music_p_list_p_->add_music (m_p);
-}
 
 Moment
 Music_sequence::cumulative_length () const
 {
   Moment last=0;
-  for (Cons<Music> *i = music_p_list_p_->head_; i;  i = i->next_)
-    {
-      last += i->car_->length_mom ();
-    }
+  for (SCM s = music_list (); gh_pair_p (s);  s = gh_cdr (s))
+    last += unsmob_music (gh_car (s))->length_mom ();
   return  last;
 }
 
@@ -68,19 +92,40 @@ Moment
 Music_sequence::maximum_length () const
 {
   Moment dur = 0;
-  for (Cons<Music> *i = music_p_list_p_->head_; i;  i = i->next_)
-    dur = dur >? i->car_->length_mom ();
+  for (SCM s = music_list (); gh_pair_p (s);  s = gh_cdr (s))
+    dur = dur >? unsmob_music (gh_car (s))->length_mom ();
 
   return dur;
 }
 int
 Music_sequence::length_i () const
 {
-  return cons_list_size_i (music_p_list_p_->head_);
+  return scm_ilength (music_list ());
 }
 
 Musical_pitch
-Music_sequence::do_relative_octave (Musical_pitch p, bool b)
+Music_sequence::do_relative_octave (Musical_pitch p, bool ret_first)
+{
+  Musical_pitch retval;
+  int count=0;
+
+  Musical_pitch last = p;
+  for (SCM s = music_list (); gh_pair_p (s);  s = gh_cdr (s))
+    {
+      last = unsmob_music (gh_car (s))->to_relative_octave (last);
+      if (!count ++ )
+       retval = last;
+    }
+
+  if (!ret_first)
+    retval = last;
+  
+  return retval;
+}
+
+void
+Music_sequence::compress (Moment m)
 {
-  return music_p_list_p_->do_relative_octave (p, b);  
+  for (SCM s = music_list (); gh_pair_p (s);  s = gh_cdr (s))
+    unsmob_music (gh_car (s))->compress (m);
 }
index 69429384dc2dea2385afb37ec423a9c4915fd75d..af658cf72a5905d6345810cd0925f7bc0cb12328 100644 (file)
@@ -28,7 +28,7 @@ void
 Music_wrapper_iterator::construct_children ()
 {
   child_iter_p_ =
-    get_iterator_p (dynamic_cast<Music_wrapper const*> (music_l_)->element_l ());
+    get_iterator_p (dynamic_cast<Music_wrapper const*> (music_l_)->element ());
 }
 
 Music_wrapper_iterator::~Music_wrapper_iterator ()
@@ -59,7 +59,7 @@ Music_wrapper_iterator::next_moment () const
 
 
 Music_iterator*
-Music_wrapper_iterator::try_music_in_children (Music const *m) const
+Music_wrapper_iterator::try_music_in_children (Music *m) const
 {
   return child_iter_p_->try_music (m);
 }
index 26807805e71bdf126af74db09b02a1b9f89a6f5b..59d3c43441064334e4aad394820672088ab82254 100644 (file)
 
 #include "music-wrapper.hh"
 
-Music_wrapper::~Music_wrapper ()
-{
-  delete element_p_;
-}
-
-Music_wrapper::Music_wrapper (Music_wrapper const&s)
-  : Music (s)
-{
-  element_p_ = (s.element_p_)?s.element_p_->clone ():0;
-}
-
 
 void
 Music_wrapper::do_print () const
 {
-  element_p_->print ();
+  element ()->print ();
 }
 
-
 void
 Music_wrapper::transpose (Musical_pitch p)
 {
-  if (element_p_)
-    element_p_-> transpose (p);
+  if (element ())
+    element ()-> transpose (p);
 }
 
 
 Music_wrapper::Music_wrapper(Music*p)
 {
-  element_p_ = p;
+  set_mus_property ("element", p->self_scm_);
 }
 
-
-
 Moment
 Music_wrapper::length_mom () const
 {
-  return element_p_->length_mom ();
+  return element ()->length_mom ();
 }
 
 Musical_pitch
 Music_wrapper::to_relative_octave (Musical_pitch p)
 {
-  return element_p_->to_relative_octave (p);
+  return element ()->to_relative_octave (p);
 }
 
 
 Music*
-Music_wrapper::element_l () const
+Music_wrapper::element () const
 {
-  return element_p_;
+  return unsmob_music (get_mus_property ("element"));
 }
 
 void
 Music_wrapper::compress (Moment m)
 {
-  element_l ()->compress (m);
+  element ()->compress (m);
 }
index 4b1f84245887a9e0febd029b14f7c9cc113872de..536082211ea68e117c587f2a1c4716d0229aebda 100644 (file)
@@ -6,13 +6,57 @@
   (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
+#include "input-smob.hh"
 #include "music.hh"
 #include "music-list.hh"
 #include "debug.hh"
 #include "musical-pitch.hh"
+#include "ly-smobs.icc"
+
+SCM
+ly_deep_mus_copy (SCM m)
+{
+  if (unsmob_music (m))
+    {
+      return unsmob_music (m)->clone ()->self_scm_;
+    }
+  else if (gh_pair_p (m))
+    {
+      return gh_cons (ly_deep_copy (gh_car (m)), ly_deep_copy (gh_cdr (m)));
+    }
+  else
+    return m;
+}
+
+
+Music::Music (Music const &m)
+{
+  self_scm_ = SCM_EOL;
+  immutable_property_alist_ = m.immutable_property_alist_;
+  SCM c =ly_deep_mus_copy (m.mutable_property_alist_);
+  mutable_property_alist_ = c;
+
+  smobify_self ();
+
+  set_spot (*m.origin ());
+}
+
 
 Music::Music()
 {
+  self_scm_ = SCM_EOL;
+  immutable_property_alist_ = SCM_EOL;
+  mutable_property_alist_ = SCM_EOL;
+  smobify_self ();
+}
+
+SCM
+Music::mark_smob (SCM m)
+{
+  Music * mus = SMOB_TO_TYPE (Music, m);
+  scm_gc_mark (mus->immutable_property_alist_);
+  scm_gc_mark (mus->mutable_property_alist_);
+  return mus->do_derived_mark ();
 }
 
 void    
@@ -31,17 +75,13 @@ Music::length_mom () const
   return 0;
 }
 
-void
-Music::print() const
+int
+Music::print_smob(SCM s, SCM p, scm_print_state*)
 {
-#ifndef NPRINT
-  if (! flower_dstream)
-    return ;
-  DEBUG_OUT << classname(this) << "{";
-  
-  do_print();
-  DEBUG_OUT << "}\n";
-#endif
+  scm_puts ("#<Music ", p);
+  scm_puts (classname(unsmob_music (s)),p);
+  scm_puts (">",p);
+  return 1;
 }
 
 Musical_pitch
@@ -56,3 +96,102 @@ Music::transpose (Musical_pitch )
 {
 }
 
+
+IMPLEMENT_UNSMOB(Music,music);
+IMPLEMENT_SMOBS(Music);
+
+/****************************/
+
+SCM
+Music::get_mus_property (const char *nm) const
+{
+  SCM sym = ly_symbol2scm (nm);
+  return get_mus_property (sym);
+}
+
+SCM
+Music::get_mus_property (SCM sym) const
+{
+  SCM s = scm_sloppy_assq(sym, mutable_property_alist_);
+  if (s != SCM_BOOL_F)
+    return gh_cdr (s);
+
+  s = scm_sloppy_assq (sym, immutable_property_alist_);
+  return (s == SCM_BOOL_F) ? SCM_EOL : gh_cdr (s); 
+}
+
+/*
+  Remove the value associated with KEY, and return it. The result is
+  that a next call will yield SCM_EOL (and not the underlying
+  `basic' property.
+*/
+SCM
+Music::remove_mus_property (const char* key)
+{
+  SCM val = get_mus_property (key);
+  if (val != SCM_EOL)
+    set_mus_property (key, SCM_EOL);
+  return val;
+}
+
+void
+Music::set_mus_property (const char* k, SCM v)
+{
+  SCM s = ly_symbol2scm (k);
+  set_mus_property (s, v);
+}
+
+void
+Music::set_immutable_mus_property (const char*k, SCM v)
+{
+  SCM s = ly_symbol2scm (k);
+  set_immutable_mus_property (s, v);
+}
+
+void
+Music::set_immutable_mus_property (SCM s, SCM v)
+{
+  immutable_property_alist_ = gh_cons (gh_cons (s,v), mutable_property_alist_);
+  mutable_property_alist_ = scm_assq_remove_x (mutable_property_alist_, s);
+}
+void
+Music::set_mus_property (SCM s, SCM v)
+{
+  mutable_property_alist_ = scm_assq_set_x (mutable_property_alist_, s, v);
+}
+
+void
+Music::set_spot (Input ip)
+{
+   set_mus_property ("origin", make_input (ip));
+}
+
+
+
+Input*
+Music::origin () const
+{
+  Input *ip = unsmob_input (get_mus_property ("origin"));
+  return ip ? ip : & dummy_input_global; 
+}
+
+SCM
+Music::do_derived_mark ()
+{
+  return SCM_EOL;
+}
+
+void
+Music::print ()const
+{
+}
+
+void
+Music::do_smobify_self ()
+{
+}
+
+Music::~Music ()
+{
+  
+}
index dbdbeabd1824026315dc3ddaae0a07a91bb851f5..3e4bbb602b96b022c0b277055689e60b2369b915 100644 (file)
@@ -106,8 +106,6 @@ My_lily_parser::get_chord (Musical_pitch tonic,
                           Musical_pitch* bass_p,
                           Duration d)
 {
-  Simultaneous_music*v = new Request_chord;
-  v->set_spot (here_input ());
 
   /*
     UARGAUGRAGRUAUGRUINAGRAUGIRNA
@@ -120,22 +118,22 @@ My_lily_parser::get_chord (Musical_pitch tonic,
 
   Tonic_req* t = new Tonic_req;
   t->pitch_ = tonic;
-  v->add_music (t);
 
+  SCM l = SCM_EOL;
   //urg
   if (chord.inversion_b_
       && Chord::find_notename_i (&chord.pitch_arr_, chord.inversion_pitch_) > 0)
     {
       Inversion_req* i = new Inversion_req;
       i->pitch_ = chord.inversion_pitch_;
-      v->add_music (i);
+      l = gh_cons (i->self_scm_, l);
     }
 
   if (chord.bass_b_)
     {
       Bass_req* b = new Bass_req;
       b->pitch_ = chord.bass_pitch_;
-      v->add_music (b);
+      l = gh_cons (b->self_scm_, l);      
     }
 
   Array<Musical_pitch> pitch_arr = chord.to_pitch_arr ();
@@ -145,9 +143,12 @@ My_lily_parser::get_chord (Musical_pitch tonic,
       Note_req* n = new Note_req;
       n->pitch_ = p;
       n->duration_ = d;
-      v->add_music (n);
+      l = gh_cons (n->self_scm_, l);
     }
 
+  Simultaneous_music*v = new Request_chord (l);
+  v->set_spot (here_input ());
+
   return v;
 }
 
index 39b1cf6b13816d569e70d71010baef80a359a598..5378672633ed823268ba4a3735ade126a9358508 100644 (file)
@@ -111,14 +111,13 @@ Note_heads_engraver::do_process_music()
 
          d->set_parent (note_p, Y_AXIS);
          d->add_offset_callback (Dots::quantised_position_callback, Y_AXIS);
-         announce_element (Score_element_info (d,0));
+         announce_element (d,0);
          dot_p_arr_.push (d);
        }
 
       note_p->set_elt_property("staff-position",  gh_int2scm (note_req_l->pitch_.steps ()));
 
-      Score_element_info itinf (note_p,note_req_l);
-      announce_element (itinf);
+      announce_element (note_p,note_req_l);
       note_p_arr_.push (note_p);
     }
 }
index c46007a16f364dbc7f4c220efd0e28b6f3c15da0..095f18cd6082dba027dd9b17559e861a7f26c92c 100644 (file)
@@ -48,7 +48,7 @@ Note_name_engraver::do_process_music ()
     {
       Item * t = new Item (get_property ("basicNoteNameProperties"));
       t->set_elt_property ("text", ly_str02scm ( s.ch_C()));
-      announce_element (Score_element_info (t, req_l_arr_[0]));
+      announce_element (t, req_l_arr_[0]);
       texts_.push (t);
     }
 }
index ebbb40b6b62c5987ba1cdf60a61edda5ece3839c..40036ec0af177d3055ea5382bda806b5c7894461 100644 (file)
@@ -42,7 +42,7 @@ Output_property_engraver::acknowledge_element (Score_element_info inf)
   for (int i=props_.size (); i--; )
     {
       Output_property * o = props_[i];
-      SCM pred = gh_car (o->pred_sym_val_list_);
+      SCM pred = o->get_mus_property ("predicate");
       
       /*
        should typecheck pred. 
@@ -51,8 +51,9 @@ Output_property_engraver::acknowledge_element (Score_element_info inf)
                           gh_list (inf.elem_l_->self_scm_, SCM_UNDEFINED));
       if (to_boolean (result))
        {
-         inf.elem_l_->set_elt_property (gh_cadr (o->pred_sym_val_list_),
-                                        gh_caddr (o->pred_sym_val_list_));
+         SCM sym = o->get_mus_property ("symbol");
+         SCM val = o->get_mus_property ("value");
+         inf.elem_l_->set_elt_property (sym, val);
        }
     }
 }
index e8a2d6a4634528a20cc821891b66d8c1a7c8e282..8cd70e8262a9198f51c942e5be8b4f57c3cbe59f 100644 (file)
@@ -11,6 +11,8 @@
 
 Output_property::Output_property(SCM pred, SCM sym, SCM val)
 {
-  pred_sym_val_list_ = gh_list (pred, sym, val, SCM_UNDEFINED);
+  set_mus_property ("predicate", pred);
+  set_mus_property ("symbol", sym);
+  set_mus_property ("value", val);
 }
 
index 9eec211a700da15a12e230bed3975add054b282e..d90d5b305bc8eb37fea2894a781a88873ddb4d78 100644 (file)
@@ -68,7 +68,7 @@ Paper_def::get_realvar (SCM s) const
     }
   else
     {
-      non_fatal_error (_("not a real variable"));
+      programming_error ("not a real variable");
       return 0.0;
     }
 }
index 0277f753a7ff070975412832c39495cb0ea4e5b4..39d1b49c0edccbce6fa06c66991e3417e3745de7 100644 (file)
@@ -126,6 +126,12 @@ Paper_outputter::output_scheme (SCM scm)
 }
 
 
+/*
+  UGH.
+
+  Should probably change interface to do less eval ( symbol ), and more
+  apply (procedure, args)
+ */
 void
 Paper_outputter::dump_scheme (SCM s)
 {
index 86797de758a08224a8267f47cc5d7dba0959b66e..ec2c83f65f0f0052a5b7bc62785d030c101183c3 100644 (file)
@@ -40,6 +40,11 @@ Paper_score::typeset_line (Line_of_score *l)
     }
   main_smob_ = gh_cons (l->self_scm_, main_smob_);
   l->pscore_l_ = this;
+
+  /*
+    We don't unprotect l->self_scm_, we haven't got any place else to
+    protect it from collection.  */
+
 }
 
 Paper_score::Paper_score (Paper_score const &s)
index d2449736ed9dda7e71d5f13a09d2f8632cc8b2f9..8ce72cb8855b8290ed6afd22ef26d150043a8bae 100644 (file)
@@ -31,6 +31,7 @@
 #include "music-list.hh"
 #include "change-translator.hh"
 #include "file-results.hh"
+#include "input.hh"
 #include "scope.hh"
 #include "relative-music.hh"
 #include "lyric-combine-music.hh"
@@ -86,7 +87,6 @@ print_mudela_versions (ostream &os)
     Identifier *id;
     String * string;
     Music *music;
-    Music_list *music_list;
     Score *score;
     Scope *scope;
     Interval *interval;
@@ -194,14 +194,14 @@ yylex (YYSTYPE *s,  void * v_l)
 %token <pitch> CHORDMODIFIER_PITCH
 %token <id>    DURATION_IDENTIFIER
 %token <id>    IDENTIFIER
-%token <id>    MUSIC_IDENTIFIER
-%token <id>    REQUEST_IDENTIFIER
 %token <id>    TRANS_IDENTIFIER
-%token <scm>   NUMBER_IDENTIFIER
 
 %token <id>    SCORE_IDENTIFIER
 %token <id>    MUSIC_OUTPUT_DEF_IDENTIFIER
 
+%token <scm>   NUMBER_IDENTIFIER
+%token <scm>   REQUEST_IDENTIFIER
+%token <scm>   MUSIC_IDENTIFIER
 %token <scm>   STRING_IDENTIFIER SCM_IDENTIFIER 
 %token <scm>   DURATION RESTNAME
 %token <scm>   STRING 
@@ -239,7 +239,7 @@ yylex (YYSTYPE *s,  void * v_l)
 %type <music>  Music Sequential_music Simultaneous_music Music_sequence
 %type <music>  relative_music re_rhythmed_music
 %type <music>  property_def translator_change
-%type <music_list> Music_list
+%type <scm> Music_list
 %type <outputdef>  music_output_def_body
 %type <request> shorthand_command_req
 %type <request>        post_request 
@@ -378,11 +378,12 @@ identifier_init:
                $$ = smobify (new Translator_group_identifier ($1, TRANS_IDENTIFIER));
        }
        | Music  {
-               $$ = smobify (new Music_identifier ($1, MUSIC_IDENTIFIER));
+               $$ = $1->self_scm_;
+               scm_unprotect_object ($$);
        }
-
        | post_request {
-               $$ = smobify (new Request_identifier ($1, REQUEST_IDENTIFIER));
+               $$ = $1->self_scm_;
+               scm_unprotect_object ($$);
        }
        | explicit_duration {
                $$ = smobify (new Duration_identifier ($1, DURATION_IDENTIFIER));
@@ -474,8 +475,11 @@ score_block:
 score_body:
        Music   {
                $$ = new Score;
+
                $$->set_spot (THIS->here_input ());
-               $$->music_p_ = $1;
+               SCM m = $1->self_scm_;
+               scm_unprotect_object (m);
+               $$->music_ = m;
        }
        | SCORE_IDENTIFIER {
                $$ = $1->access_content_Score (true);
@@ -548,7 +552,6 @@ music_output_def_body:
                        music.
                */
                dynamic_cast<Midi_def*> ($$)->set_tempo ($2->dur_.length_mom (), $2->metronome_i_);
-               delete $2;
        }
        | music_output_def_body bare_int '=' FONT STRING                { // ugh, what a syntax
                Lookup * l =unsmob_lookup (Lookup::make_lookup());
@@ -570,11 +573,19 @@ tempo_request:
        ;
 
 Music_list: /* empty */ {
-               $$ = new Music_list;
-               $$->set_spot (THIS->here_input ());
+               $$ = gh_cons (SCM_EOL, SCM_EOL);
        }
        | Music_list Music {
-               $$->add_music ($2);
+               SCM s = $$;
+               SCM c = gh_cons ($2->self_scm_, SCM_EOL);
+               scm_unprotect_object ($2->self_scm_); /* UGH */
+
+       
+               if (gh_pair_p (gh_cdr (s)))
+                       gh_set_cdr_x (gh_cdr (s), c); /* append */
+               else
+                       gh_set_car_x (s, c); /* set first cons */
+               gh_set_cdr_x (s, c) ;  /* remember last cell */ 
        }
        | Music_list error {
        }
@@ -604,42 +615,37 @@ Repeated_music:
        {
                Music_sequence* m = dynamic_cast <Music_sequence*> ($5);
                if (m && $3 < m->length_i ())
-                       $5->warning (_ ("More alternatives than repeats.  Junking excess alternatives."));
+                       $5->origin ()->warning (_ ("More alternatives than repeats.  Junking excess alternatives."));
 
                Repeated_music * r = new Repeated_music ($4, $3 >? 1, m);
                $$ = r;
                r->type_ = ly_scm2string ($2);
                r->fold_b_ = (r->type_ == "fold");
                r->volta_fold_b_ =  (r->type_ == "volta");
-               r->set_spot ($4->spot  ());
+               r->set_spot (*$4->origin ());
        }
        ;
 
 Music_sequence: '{' Music_list '}'     {
-               $$ = new Music_sequence ($2);
-               $$->set_spot ($2->spot ());
+               $$ = new Music_sequence (gh_car ($2));
        }
        ;
 
 Sequential_music:
        SEQUENTIAL '{' Music_list '}'           {
-               $$ = new Sequential_music ($3);
-               $$->set_spot ($3->spot ());
+               $$ = new Sequential_music (gh_car ($3));
        }
        | '{' Music_list '}'            {
-               $$ = new Sequential_music ($2);
-               $$->set_spot ($2->spot ());
+               $$ = new Sequential_music (gh_car ($2));
        }
        ;
 
 Simultaneous_music:
        SIMULTANEOUS '{' Music_list '}'{
-               $$ = new Simultaneous_music ($3);
-               $$->set_spot ($3->spot ());
+               $$ = new Simultaneous_music (gh_car ($3));
        }
        | '<' Music_list '>'    {
-               $$ = new Simultaneous_music ($2);
-               $$->set_spot ($2->spot ());
+               $$ = new Simultaneous_music (gh_car ($2));
        }
        ;
 
@@ -659,7 +665,7 @@ Simple_music:
        
                $$ = new Output_property (pred,$3, $5);
        }
-       | MUSIC_IDENTIFIER { $$ = $1->access_content_Music (true); }
+       | MUSIC_IDENTIFIER { $$ = unsmob_music ($1)->clone (); }
        | property_def
        | translator_change
        | Simple_music '*' bare_unsigned '/' bare_unsigned      {
@@ -687,7 +693,7 @@ Composite_music:
                Auto_change_music * chm = new Auto_change_music (ly_scm2string ($2), $3);
 
                $$ = chm;
-               chm->set_spot ($3->spot ());
+               chm->set_spot (*$3->origin ());
        }
        | GRACE Music {
                $$ = new Grace_music ($2);
@@ -715,11 +721,11 @@ Composite_music:
        | Sequential_music              { $$ = $1; }
        | TRANSPOSE musical_pitch Music {
                $$ = new Transposed_music ($3, *$2);
-               delete $2;
+               delete $2; // ugh
        }
        | TRANSPOSE steno_tonic_pitch Music {
                $$ = new Transposed_music ($3, *$2);
-               delete $2;
+               delete $2; // ugh
        }
        | NOTES
                { THIS->lexer_p_->push_note_state (); }
@@ -748,7 +754,7 @@ Composite_music:
 relative_music:
        RELATIVE absolute_musical_pitch Music {
                $$ = new Relative_octave_music ($3, *$2);
-               delete $2;
+               delete $2; // ugh
        }
        ;
 
@@ -774,8 +780,8 @@ property_def:
        PROPERTY STRING '.' STRING '='  scalar {
                Translation_property *t = new Translation_property;
 
-               t->var_str_ = ly_scm2string ($4);
-               t->value_ = $6;
+               t->set_mus_property ("symbol", scm_string_to_symbol ($4));
+               t->set_mus_property ("value", $6);
 
                Context_specced_music *csm = new Context_specced_music (t);
                $$ = csm;
@@ -797,9 +803,9 @@ request_chord:
                Music_sequence *l = dynamic_cast<Music_sequence*>($2);
                if (l) {
                        for (int i=0; i < $1->size(); i++)
-                               l->add_music ($1->elem(i));
+                               l->append_music ($1->elem(i));
                        for (int i=0; i < $3->size(); i++)
-                               l->add_music ($3->elem(i));
+                               l->append_music ($3->elem(i));
                        }
                else
                        programming_error ("Need Sequence to add music to");
@@ -811,16 +817,15 @@ request_chord:
 
 command_element:
        command_req {
-               $$ = new Request_chord;
+               $$ = new Request_chord (gh_cons ($1->self_scm_, SCM_EOL));
                $$-> set_spot (THIS->here_input ());
                $1-> set_spot (THIS->here_input ());
-               ((Simultaneous_music*)$$) ->add_music ($1);//ugh
        }
        | PARTIAL duration_length ';'   {
                Translation_property * p = new Translation_property;
-               p->var_str_ = "measurePosition";
-               p->value_ =  (new Moment (-$2->length_mom ()))->smobify_self ();
-               delete $2;
+               p->set_mus_property ("symbol", ly_symbol2scm ( "measurePosition"));
+               p->set_mus_property ("value", (new Moment (-$2->length_mom ()))->smobify_self ());
+               delete $2; // ugh
                Context_specced_music * sp = new Context_specced_music (p);
                $$ =sp ;
                sp-> translator_type_str_ = "Score";
@@ -881,13 +886,13 @@ verbose_command_req:
        }
        | MARK STRING {
                Mark_req *m = new Mark_req;
-               m->mark_label_ = $2;
+               m->set_mus_property ("label", $2);
                $$ = m;
 
        }
        | MARK bare_unsigned {
                Mark_req *m = new Mark_req;
-               m->mark_label_ =  gh_int2scm ($2);
+               m->set_mus_property ("label",  gh_int2scm ($2));
                $$ = m;
        }
 
@@ -906,7 +911,7 @@ verbose_command_req:
        | SKIP duration_length {
                Skip_req * skip_p = new Skip_req;
                skip_p->duration_ = *$2;
-               delete $2;
+               delete $2; // ugh
                $$ = skip_p;
        }
        | tempo_request {
@@ -923,7 +928,7 @@ verbose_command_req:
        | KEY NOTENAME_PITCH SCM_IDENTIFIER     {
                Key_change_req *key_p= new Key_change_req;
                
-               key_p->pitch_alist_ = $3;
+               key_p->set_mus_property ("pitch-alist", $3);
                ((Music* )key_p)->transpose (* $2);
                $$ = key_p; 
        }
@@ -964,14 +969,14 @@ request_with_dir:
                if (Script_req * gs = dynamic_cast<Script_req*> ($2))
                        gs->dir_ = Direction ($1);
                else if ($1)
-                       $2->warning (_ ("Can't specify direction for this request"));
+                       $2->origin ()->warning (_ ("Can't specify direction for this request"));
                $$ = $2;
        }
        ;
        
 verbose_request:
        REQUEST_IDENTIFIER      {
-               $$ = (Request*)$1->access_content_Request (true);
+               $$ = dynamic_cast<Request*> (unsmob_music ($1)->clone ());
                $$->set_spot (THIS->here_input ());
        }
        | TEXTSCRIPT STRING STRING      {
@@ -1268,77 +1273,68 @@ simple_element:
                n->cautionary_b_ = $3 % 2;
                n->forceacc_b_ = $2 % 2 || n->cautionary_b_;
 
-               Simultaneous_music*v = new Request_chord;
+
+               Simultaneous_music*v = new Request_chord (gh_list (n->self_scm_, SCM_UNDEFINED));
                v->set_spot ($1->spot ());
                n->set_spot ($1->spot ());
-
-               v->add_music (n);
-
                $$ = v;
 
                delete $1;
                delete $4;
        }
        | RESTNAME optional_notemode_duration           {
-                 Simultaneous_music* velt_p = new Request_chord;
-                 velt_p->set_spot (THIS->here_input());
 
+               SCM e = SCM_UNDEFINED;
                  if (ly_scm2string ($1) =="s")
                    { /* Space */
                      Skip_req * skip_p = new Skip_req;
                      skip_p->duration_ = *$2;
 
                      skip_p->set_spot (THIS->here_input());
-                     velt_p->add_music (skip_p);
+                       e = skip_p->self_scm_;
                    }
                  else
                    {
                      Rest_req * rest_req_p = new Rest_req;
                      rest_req_p->duration_ = *$2;
                      rest_req_p->set_spot (THIS->here_input());
-
-                     velt_p->add_music (rest_req_p);
+                       e = rest_req_p->self_scm_;
                    }
+                 Simultaneous_music* velt_p = new Request_chord (gh_list (e,SCM_UNDEFINED));
+                 velt_p->set_spot (THIS->here_input());
 
-                 delete $2;
+                 delete $2; // ugh
                  $$ = velt_p;
        }
        | MEASURES optional_notemode_duration   {
                Skip_req * sk = new Skip_req;
                sk->duration_ = *$2;
-               Music_list * ms = new Music_list;
-               Request_chord * rqc1 = new Request_chord;
-               Request_chord * rqc2 = new Request_chord;
-               Request_chord * rqc3 = new Request_chord;
+               
 
                Span_req *sp1 = new Span_req;
                Span_req *sp2 = new Span_req;
                sp1-> span_dir_ = START;
                sp2-> span_dir_ = STOP;
                sp1->span_type_str_ = sp2->span_type_str_ = "rest";
-               rqc1->add_music (sp1);
-               rqc2->add_music (sk);
-               rqc3->add_music (sp2);
-               
-               ms->add_music (rqc1);
-               ms->add_music (rqc2);
-               ms->add_music (rqc3);
+
+               Request_chord * rqc1 = new Request_chord (gh_list (sp1->self_scm_, SCM_UNDEFINED));
+               Request_chord * rqc2 = new Request_chord (gh_list (sk->self_scm_, SCM_UNDEFINED));;
+               Request_chord * rqc3 = new Request_chord(gh_list (sp2->self_scm_, SCM_UNDEFINED));;
+
+               SCM ms = gh_list (rqc1->self_scm_, rqc2->self_scm_, rqc3->self_scm_, SCM_UNDEFINED);
 
                $$ = new Sequential_music (ms);
        }
        | STRING optional_notemode_duration     {
                if (!THIS->lexer_p_->lyric_state_b ())
                        THIS->parser_error (_ ("Have to be in Lyric mode for lyrics"));
-               Simultaneous_music* velt_p = new Request_chord;
-
                Lyric_req* lreq_p = new Lyric_req;
                lreq_p ->text_str_ = ly_scm2string ($1);
                lreq_p->duration_ = *$2;
                lreq_p->set_spot (THIS->here_input());
+               Simultaneous_music* velt_p = new Request_chord (gh_list (lreq_p->self_scm_, SCM_UNDEFINED));
 
-               velt_p->add_music (lreq_p);
-
-               delete  $2;
+               delete  $2; // ugh
                $$= velt_p;
 
        }
index 6bc925a1bd18d5aeefc877672e67ca419529863d..7a38830b530ebbe381491b634e1409f750f05510 100644 (file)
@@ -32,17 +32,13 @@ Performer_group_performer::do_announces()
     }
 
   
-  Request dummy_req;
+
 
   while (announce_info_arr_.size ())
     {
       for (int j =0; j < announce_info_arr_.size(); j++)
        {
          Audio_element_info info = announce_info_arr_[j];
-         
-         if (!info.req_l_)
-           info.req_l_ = &dummy_req;
-
          for (Cons<Translator> *p = trans_p_list_.head_; p; p = p->next_)
            {
              if (!dynamic_cast <Performer_group_performer *> (p->car_))
index 7f4d1777cc7893fffd5a524770df16430101bc58..f7127c425a37a0c03a4a9fb50c17096efc570574 100644 (file)
@@ -154,7 +154,7 @@ Piano_pedal_engraver::do_process_music ()
        {
          if (!p->start_req_l_)
            {
-             p->req_l_drul_[STOP]->warning (_f ("can't find start of piano pedal: %s",  p->name_ ));
+             p->req_l_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: %s",  p->name_ ));
            }
          else
            {
@@ -166,7 +166,7 @@ Piano_pedal_engraver::do_process_music ()
        {
          if (!p->start_req_l_)
            {
-             p->req_l_drul_[STOP]->warning (_f ("can't find start of piano pedal: %s", p->name_ ));
+             p->req_l_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: %s", p->name_ ));
            }
          else
            {
@@ -199,10 +199,10 @@ Piano_pedal_engraver::do_process_music ()
          // todo: init with basic props.
          p->item_p_->add_offset_callback (Side_position::aligned_on_self, X_AXIS);
          p->item_p_->add_offset_callback (Side_position::centered_on_parent, X_AXIS);
-         announce_element (Score_element_info (p->item_p_,
+         announce_element (p->item_p_,
                                                p->req_l_drul_[START]
                                                ? p->req_l_drul_[START]
-                                               : p->req_l_drul_[STOP]));
+                                               : p->req_l_drul_[STOP]);
        }
     }
 }
index c3d2a1a0f4eb322a3a7271ff10e0fcfbb5607fb9..6b1efab4358068a5129548572eb6d9b4570d124f 100644 (file)
@@ -84,7 +84,7 @@ Piano_pedal_performer::do_process_music ()
        {
          if (!p->start_req_l_)
            {
-             p->req_l_drul_[STOP]->warning (_f ("can't find start of piano pedal: %s", String (p->name_)));
+             p->req_l_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: %s", String (p->name_)));
            }
          else
            {
index 06d34035ed152ab1dff8b5aed25bd4a1973609f8..9f47bce0d19037c13006ad47baee2304c71b9b05 100644 (file)
 void
 Property_iterator::do_process_and_next (Moment m)
 {
-  Translation_property const * prop = dynamic_cast<Translation_property const*> (music_l_);
-  if (prop->var_str_.length_i ())
-    report_to_l ()->set_property (prop->var_str_, prop->value_);
+  Translation_property * prop = dynamic_cast<Translation_property *> (music_l_);
+  SCM sym = prop->get_mus_property ("symbol");
+  if (gh_symbol_p(sym))
+    report_to_l ()->set_property (sym, prop->get_mus_property ("value"));
   Music_iterator::do_process_and_next (m);
 }
 
index e2552b65a819fd50c9be45c4dd1e0f04b709e1d3..f786e7b0edcbd9e590c18a8d4fb00b2a5e4b9bec 100644 (file)
@@ -20,7 +20,7 @@ Relative_octave_music::to_relative_octave (Musical_pitch)
 Relative_octave_music::Relative_octave_music(Music*p,Musical_pitch def)
   : Music_wrapper (p)
 {
-  last_pitch_ = element_l ()->to_relative_octave (def);
+  last_pitch_ = element ()->to_relative_octave (def);
 }
 
 void
index dc66a1497a53519b6e5355c20d9e6e0f1ec365e4..98747444146aadb78410bcc6f2bf974f46d1c5bf 100644 (file)
@@ -111,8 +111,8 @@ Repeat_engraver::do_try_music (Music* m)
 void
 Repeat_engraver::queue_events ()
 {
-  Music_sequence* alt = repeated_music_l_->alternatives_p_;
-  Moment walk_mom = now_mom () + repeated_music_l_->repeat_body_p_->length_mom ();
+  Music_sequence* alt = repeated_music_l_->alternatives ();
+  Moment walk_mom = now_mom () + repeated_music_l_->body ()->length_mom ();
 
   SCM novolta = get_property ("noVoltaBraces");
   bool create_volta = !to_boolean (novolta);
@@ -135,8 +135,11 @@ Repeat_engraver::queue_events ()
        appropriate timestamps. The volta spanner event (a number string)
        happens at the begin of the alt. The :| bar event at the ending.
       */
-      for (Cons<Music> *i = alt->music_p_list_p_->head_; i; i = i->next_)
-       {
+
+  for (SCM s = repeated_music_l_->alternatives ()->music_list ();
+       gh_pair_p (s);  s = gh_cdr (s))
+    {
+      Music *mus =unsmob_music (gh_car (s));
 
          /*
            some idiot might typeset a repeat not starting on a
@@ -155,17 +158,17 @@ Repeat_engraver::queue_events ()
              Bar_create_event * c = new Bar_create_event (walk_mom, last_number+ 1,
                                                           volta_number);
              
-             if (!i->next_)
+             if (!gh_pair_p (gh_cdr (s)))
                c->last_b_ = true;
              
              becel.append (c);
              last_number = volta_number;
              volta_number ++;
               SCM l (get_property ("voltaSpannerDuration"));
-              if (SMOB_IS_TYPE_B (Moment, l))
+              if (unsmob_moment(l))
                {
-                 Moment vSD_mom = *SMOB_TO_TYPE (Moment,l);
-                 if ( vSD_mom < i->car_->length_mom() ) // terminate volta early ?
+                 Moment vSD_mom = *unsmob_moment (l);
+                 if ( vSD_mom < mus->length_mom() ) // terminate volta early ?
                    {
                      vSD_mom += walk_mom;
                      c->last_b_ = true;
@@ -173,9 +176,9 @@ Repeat_engraver::queue_events ()
                    }
                }
            }
-         walk_mom += i->car_->length_mom();
+         walk_mom += mus->length_mom();
 
-         if (i->next_)
+         if (gh_pair_p (gh_cdr (s)))
            becel.append (new Bar_create_event (walk_mom, ":|"));
          else
            becel.append (new Bar_create_event (walk_mom, "stop"));
@@ -235,7 +238,7 @@ Repeat_engraver::do_process_music ()
              assert (!volta_span_p_);
              volta_span_p_ = new Spanner (get_property ("basicVoltaSpannerProperties"));
              Volta_spanner::set_interface (volta_span_p_);
-             announce_element (Score_element_info (volta_span_p_,0));
+             announce_element (volta_span_p_,0);
              volta_span_p_->set_elt_property ("text",
                                               ly_str02scm (t.ch_C()));
              volta_span_p_->set_elt_property ("last-volta",
index 82d1c9fe9c63e6294374d9fb1d2f49b258db773c..f2e9b77daae147c1212967f29a1609bd511d2f0b 100644 (file)
 #include "musical-pitch.hh"
 #include "debug.hh"
 
+Music *
+Repeated_music::body ()const
+{
+  return unsmob_music (get_mus_property ("body"));
+}
+
+Music_sequence*
+Repeated_music::alternatives ()const
+{
+  return dynamic_cast<Music_sequence*>  (unsmob_music (get_mus_property ("alternatives")));
+}
+
 Repeated_music::Repeated_music(Music *beg, int times, Music_sequence * alts)
 {
-  repeat_body_p_ = beg;
+  set_mus_property ("body", beg->self_scm_);
   fold_b_ = false;
   repeats_i_ = times;
-  alternatives_p_ = alts;
   volta_fold_b_ = true;
   if (alts)
-    alts->music_p_list_p_->truncate (times);
+    {
+      alts->truncate (times);
+      set_mus_property ("alternatives", alts->self_scm_);
+    }
 }
 
 Repeated_music::Repeated_music (Repeated_music const &s)
@@ -30,16 +44,8 @@ Repeated_music::Repeated_music (Repeated_music const &s)
   fold_b_ = s.fold_b_;
   volta_fold_b_ = s.volta_fold_b_;
   type_ = s.type_;
-  repeat_body_p_ = s.repeat_body_p_ ? s.repeat_body_p_->clone () : 0;
-  alternatives_p_ = s.alternatives_p_
-    ? dynamic_cast<Music_sequence*> (s.alternatives_p_->clone ()):0;
 }
 
-Repeated_music::~Repeated_music ()
-{
-  delete repeat_body_p_;
-  delete alternatives_p_;
-}
 
 void
 Repeated_music::do_print () const
@@ -47,71 +53,69 @@ Repeated_music::do_print () const
 #ifndef NPRINT
   DEBUG_OUT << "Fold = " << fold_b_ << " reps: " << repeats_i_;
 
-  if (repeat_body_p_)
-    repeat_body_p_->print();
+  if (body ())
+    body ()->print();
   
-  if (alternatives_p_)
-    alternatives_p_->print();
+  if (alternatives ())
+    alternatives ()->print();
 #endif
 }
 
 Musical_pitch
 Repeated_music::to_relative_octave (Musical_pitch p)
 {
-  if (repeat_body_p_)
-    p = repeat_body_p_->to_relative_octave (p);
+  if (body ())
+    p = body ()->to_relative_octave (p);
 
   Musical_pitch last = p ; 
-  if (alternatives_p_)
-    for (Cons<Music> *i = alternatives_p_->music_p_list_p_->head_; i ; i = i->next_)
-      {
-       last = i->car_->to_relative_octave (p);
-      }
+  if (alternatives ())
+    for (SCM s = alternatives ()->music_list (); gh_pair_p (s);  s = gh_cdr (s))
+      unsmob_music (gh_car (s))->to_relative_octave (p);
+     
 
   return last;
 }
 
-
-
 void
 Repeated_music::transpose (Musical_pitch p)
 {
-  if (repeat_body_p_)
-    repeat_body_p_->transpose (p);
+  if (body ())
+    body ()->transpose (p);
 
-  if (alternatives_p_)
-    alternatives_p_->transpose (p);  
+  if (alternatives ())
+    alternatives ()->transpose (p);  
 }
 
 void
 Repeated_music::compress (Moment p)
 {
-  if (repeat_body_p_)
-    repeat_body_p_->compress (p);
+  if (body ())
+    body ()->compress (p);
 
-  if (alternatives_p_)
-    alternatives_p_->compress (p);  
+  if (alternatives ())
+    alternatives ()->compress (p);  
 }
 
 Moment
 Repeated_music::alternatives_length_mom () const
 {
-  if (!alternatives_p_ )
+  if (!alternatives () )
     return 0;
   
   if  (fold_b_)
-    return alternatives_p_->maximum_length ();
+    return alternatives ()->maximum_length ();
 
   Moment m =0;
   int done =0;
-  Cons<Music> *p = alternatives_p_->music_p_list_p_->head_;
-  while (p && done < repeats_i_)
+
+  SCM p = alternatives ()->music_list ();
+   while (gh_pair_p (p) && done < repeats_i_)
     {
-      m = m + p->car_->length_mom ();
+      m = m + unsmob_music (gh_car (p))->length_mom ();
       done ++;
       if (volta_fold_b_
-         || repeats_i_ - done < alternatives_p_->length_i ())
-       p = p->next_;
+         || repeats_i_ - done < alternatives ()->length_i ())
+      p = gh_cdr (p);
     }
   return m;
 }
@@ -120,9 +124,9 @@ Moment
 Repeated_music::body_length_mom () const
 {
   Moment m = 0;
-  if (repeat_body_p_)
+  if (body ())
     {
-      m = repeat_body_p_->length_mom ();
+      m = body ()->length_mom ();
       if (!fold_b_ && !volta_fold_b_)
        m *= Rational (repeats_i_);
     }
index 65f3027077905d8787dea11b8b4e116de90866ba..7f0b00827f96e47beaa47fdb16b964f43d5c8411 100644 (file)
@@ -30,7 +30,6 @@ Request_chord_iterator::elt_l () const
 Request_chord_iterator::Request_chord_iterator ()
 {
   last_b_ = false;
-  cursor_ = 0;
 }
 
 
@@ -63,18 +62,19 @@ Request_chord_iterator::do_process_and_next (Moment mom)
 {
   if (first_b_)
     {
-      for (Cons<Music> *i = elt_l ()->music_p_list_p_->head_; i; i = i->next_)
+      for (SCM s = dynamic_cast<Music_sequence *> (music_l_)->music_list (); gh_pair_p (s);  s = gh_cdr (s))
        {
-         if (Request * req_l = dynamic_cast<Request*> (i->car_))
+         Music *mus = unsmob_music (gh_car (s));
+         if (Request * req_l = dynamic_cast<Request*> (mus))
            {
              bool gotcha = try_music (req_l);
              if (!gotcha)
-               req_l->warning (_f ("Junking request: `%s'", classname( req_l)));
+               req_l->origin ()->warning (_f ("Junking request: `%s'", classname( req_l)));
            }
          else
-           i->car_->warning (_f ("Huh?  Not a Request: `%s'",
-                                  classname (i->car_)));
-       }
+           mus->origin ()->warning (_f ("Huh?  Not a Request: `%s'",
+                                                classname (mus)));
+                   }
       first_b_ = false;
     }
 
index 6cefe8b5b5cf166e9c76199b34efa1640ef7fb86..51c7604281988204c346c1a4f3a40354796abeea 100644 (file)
@@ -8,7 +8,7 @@
  */
 #include "request-iterator.hh"
 #include "music.hh"
-
+#include "input.hh"
 
 void
 Simple_music_iterator::do_process_and_next (Moment m)
@@ -17,7 +17,7 @@ Simple_music_iterator::do_process_and_next (Moment m)
     {
       bool g= try_music (music_l_);
       if (!g)
-       music_l_->warning (_f ("Junking music: `%s'", classname(music_l_)));
+       music_l_->origin ()->warning (_f ("Junking music: `%s'", classname(music_l_)));
 
       first_b_ = false;
     }
index e748b88c012a6421a7c939d0b8ed1038fa0feecc..be91eb230621b8017558aeaf913555b48282dfc5 100644 (file)
@@ -42,7 +42,7 @@ Rest_collision_engraver::process_acknowledged ()
 
   rest_collision_p_ = new Item (get_property ("basicRestCollisionProperties"));
   Rest_collision::set_interface (rest_collision_p_);
-  announce_element (Score_element_info (rest_collision_p_, 0));
+  announce_element (rest_collision_p_, 0);
   for (int i=0; i< note_column_l_arr_.size (); i++)
     Rest_collision::add_column ( rest_collision_p_,note_column_l_arr_[i]);
 }
index 1d615fccb375076b8be2cac707562a05b7a53a19..259140717a7ef1e69995b65537cafef24c99bb3d 100644 (file)
@@ -84,10 +84,10 @@ Rest_engraver::do_process_music ()
          dot_p_->add_offset_callback (Dots::quantised_position_callback, Y_AXIS);
          dot_p_->set_elt_property ("dot-count",
                                    gh_int2scm (rest_req_l_->duration_.dots_i_));
-         announce_element (Score_element_info (dot_p_,0));
+         announce_element (dot_p_,0);
        }
 
-      announce_element (Score_element_info (rest_p_, rest_req_l_));
+      announce_element (rest_p_, rest_req_l_);
     }
 }
 
index 82c02d9a4a7bced7fbf3f9f6be01cff20a1dad53..b72f6b1f9902b3b28b79b4e6705a1825bf7c897f 100644 (file)
@@ -54,7 +54,7 @@ Rhythmic_column_engraver::process_acknowledged ()
        {
          ncol_p_ = new Item (get_property("basicNoteColumnProperties"));
          Note_column::set_interface (ncol_p_);
-         announce_element (Score_element_info (ncol_p_, 0));
+         announce_element (ncol_p_, 0);
        }
 
       for (int i=0; i < rhead_l_arr_.size (); i++)
index f53cd8e9b26470ddeb6255274f2a18fb4804b40c..451c1f40be1a8451c80e802f160f600be6f82814 100644 (file)
@@ -10,6 +10,7 @@
 #include <string.h>
 #include <math.h>
 
+#include "input-smob.hh"
 #include "libc-extension.hh"
 #include "group-interface.hh"
 #include "misc.hh"
@@ -78,12 +79,9 @@ Score_element::Score_element (Score_element const&s)
 
 Score_element::~Score_element()
 {
-  // this goes awry when score-elements are copied...
-
   /*
-     Kijk goed naar hoe smobify en unsmobify werken.  unsmobify_self
-    is te gebruiken wanneer C++ geheugen beheer weer overneemt van
-    GUILE. --hwn */
+    do nothing scm-ish and no unprotecting here.
+   */
 }
 
 
@@ -248,10 +246,24 @@ Molecule
 Score_element::get_molecule ()  const
 {
   SCM proc = get_elt_property ("molecule-callback");
+
+  SCM mol = SCM_EOL;
   if (gh_procedure_p (proc)) 
-    return create_molecule (gh_apply (proc, gh_list (this->self_scm_, SCM_UNDEFINED)));
+    mol = gh_apply (proc, gh_list (this->self_scm_, SCM_UNDEFINED));
+
 
-  return Molecule ();
+  SCM origin =get_elt_property ("origin");
+  if (!unsmob_input (origin))
+    origin =ly_symbol2scm ("no-origin");
+  
+  if (gh_pair_p (mol))
+    {
+      // ugr.
+       mol = gh_cons (gh_list (origin, gh_car (mol), SCM_UNDEFINED), gh_cdr (mol));
+    }
+
+  
+  return create_molecule (mol);
 }
 
 
@@ -710,15 +722,17 @@ Score_element::mark_smob (SCM ses)
       programming_error ("SMOB marking gone awry");
       return SCM_EOL;
     }
-  scm_gc_mark ( s->immutable_property_alist_);
-
-  s->do_derived_mark ();
+  scm_gc_mark (s->immutable_property_alist_);
+  scm_gc_mark (s->mutable_property_alist_);
+  
   if (s->parent_l (Y_AXIS))
     scm_gc_mark (s->parent_l (Y_AXIS)->self_scm_);
   if (s->parent_l (X_AXIS))
     scm_gc_mark (s->parent_l (X_AXIS)->self_scm_);
 
-  return s->mutable_property_alist_;
+  if (s->original_l_)
+    scm_gc_mark (s->original_l_->self_scm_);
+  return s->do_derived_mark ();
 }
 
 int
@@ -736,9 +750,10 @@ Score_element::print_smob (SCM s, SCM port, scm_print_state *)
   return 1;
 }
 
-void
+SCM
 Score_element::do_derived_mark ()
 {
+  return SCM_EOL;
 }
 
 void
index 1e35503f42e88de3404ffff1f5101753e9186a3c..c360b9964934f975c89ab5e483f3189b8aee287b 100644 (file)
@@ -267,6 +267,8 @@ Score_engraver::do_add_processing ()
   pscore_p_ = new Paper_score;
   pscore_p_->paper_l_ = dynamic_cast<Paper_def*>(output_def_l_);
 
-  pscore_p_->typeset_line (new Line_of_score (get_property(ly_symbol2scm ("basicLineOfScoreProperties"))));
+  SCM props = get_property(ly_symbol2scm ("basicLineOfScoreProperties"));
+
+  pscore_p_->typeset_line (new Line_of_score (props));
 }
 
index b9027e9288c6ecff777a30c9b9f05412f5bf1b75..8a4e348d0d46d65b44bd9ab95e4fd6df2aec6fed 100644 (file)
@@ -31,14 +31,15 @@ Score::Score()
   : Input()
 {
   header_p_ = 0;
-  music_p_ = 0;
+  music_ = SCM_EOL;
   errorlevel_i_ = 0;
 }
 
 Score::Score (Score const &s)
   : Input (s)
 {
-  music_p_ = (s.music_p_) ? s.music_p_->clone() : 0;
+  Music * m =unsmob_music (s.music_);
+  music_ =  m?m->clone()->self_scm_ : SCM_EOL;
   for (int i=0; i < s.def_p_arr_.size (); i++)
     def_p_arr_.push(s.def_p_arr_[i]->clone());
   errorlevel_i_ = s.errorlevel_i_;
@@ -49,7 +50,6 @@ Score::~Score()
 {
   delete header_p_;
   junk_pointer_array (def_p_arr_);
-  delete music_p_;
 }
 
 void
@@ -61,15 +61,17 @@ Score::run_translator (Music_output_def *odef_l)
   Global_translator * trans_p = odef_l->get_global_translator_p();
   if (!trans_p)
     {
-      non_fatal_error (_("no toplevel translator"));
+      programming_error ("no toplevel translator");
       return ;
     }
   progress_indication ("\n" + _("Interpreting music..."));
-  trans_p->final_mom_ = music_p_->length_mom ();
+  Music * music = unsmob_music (music_);
+  
+  trans_p->final_mom_ = music->length_mom ();
 
 
-  Music_iterator * iter = Music_iterator::static_get_iterator_p (music_p_);
-  iter->init_translator(music_p_, trans_p);
+  Music_iterator * iter = Music_iterator::static_get_iterator_p (music);
+  iter->init_translator(music, trans_p);
 
   iter->construct_children();
 
@@ -115,7 +117,7 @@ Score::run_translator (Music_output_def *odef_l)
 void
 Score::process()
 {
-  if (!music_p_)
+  if (!unsmob_music (music_))
     return;
 
   print();
@@ -135,7 +137,7 @@ Score::print() const
 {
 #ifndef NPRINT
   DEBUG_OUT << "score {\n";
-  music_p_ -> print ();
+  // music_p_ -> print ();
   for (int i=0; i < def_p_arr_.size (); i++)
     def_p_arr_[i]->print();
   DEBUG_OUT << "}\n";
index 73da3806688a3830b46036b2c7c8fb4ff138cad2..23df7b72af0e3a00dbeef709b2c18215cf785493 100644 (file)
@@ -76,7 +76,7 @@ Script_column_engraver::process_acknowledged ()
       scol_p_ = new Item (get_property ("basicScriptColumnProperties"));
       scol_p_->set_elt_property ("scripts", SCM_EOL);  
 
-      announce_element (Score_element_info (scol_p_, 0));
+      announce_element (scol_p_, 0);
     }
 
   if (scol_p_)
index effd5b7123394ddb841d0f43245ba9102d21a44c..db95e855f47163e67171f40afc89502f563d161e 100644 (file)
@@ -62,7 +62,7 @@ Script_engraver::do_process_music()
       
       if (list == SCM_BOOL_F)
        {
-         l->warning (_f ("Don't know how to interpret articulation `%s'",
+         l->origin ()->warning (_f ("Don't know how to interpret articulation `%s'",
                        l->articulation_str_.ch_C ()));
          continue;
        }
@@ -109,7 +109,7 @@ Script_engraver::do_process_music()
   
       script_p_arr_.push (p);
       
-      announce_element (Score_element_info (p, l));
+      announce_element (p, l);
     }
 }
 
index 7cc7ad681a3f0438045b1f932a8e5998a1a6ec4b..eda666a9b492f001e1bd027a96d183533ca3803d 100644 (file)
@@ -41,7 +41,7 @@ Separating_line_group_engraver::do_creation_processing ()
 {
   sep_span_p_ = new Spanner (get_property ("basicSeparatingGroupSpannerProperties"));
   Separating_group_spanner::set_interface (sep_span_p_);
-  announce_element (Score_element_info (sep_span_p_, 0));
+  announce_element (sep_span_p_, 0);
   sep_span_p_->set_bound (LEFT, unsmob_element (get_property ("currentCommandColumn")));
 }
 
@@ -70,7 +70,7 @@ Separating_line_group_engraver::acknowledge_element (Score_element_info i)
          
          if (ib)
            p_ref_->set_elt_property ("breakable", SCM_BOOL_T);
-         announce_element (Score_element_info (p_ref_, 0));
+         announce_element (p_ref_, 0);
        }
       Separation_item::add_item (p_ref_,it);
     }
index 8473d23cd6ec0b259b750470b08ff693fee47f18..d99381cf5415a8645039c6251cf44388c58e6575 100644 (file)
@@ -30,9 +30,9 @@ Sequential_music_iterator::Sequential_music_iterator ()
 void
 Sequential_music_iterator::construct_children()
 {
-  cursor_ = dynamic_cast<Music_sequence const*> (music_l_)->music_p_list_p_->head_;
+  cursor_ = dynamic_cast<Music_sequence const*> (music_l_)->music_list ();
   
-  while (cursor_)
+  while (gh_pair_p (cursor_ ))
     {
       start_next_element();
       if (!iter_p_->ok()) 
@@ -52,16 +52,16 @@ Sequential_music_iterator::leave_element()
 {
   delete iter_p_;
   iter_p_ =0;
-  Moment elt_time = cursor_->car_->length_mom ();
+  Moment elt_time = unsmob_music (gh_car (cursor_))->length_mom ();
   here_mom_ += elt_time;
-  cursor_ =cursor_->next_;
+  cursor_ =gh_cdr (cursor_);
 }
 
 void
 Sequential_music_iterator::start_next_element()
 {
   assert (!iter_p_);
-  iter_p_ = get_iterator_p (cursor_->car_);
+  iter_p_ = get_iterator_p (unsmob_music (gh_car (cursor_)));
 }
 
 void
@@ -80,15 +80,12 @@ Sequential_music_iterator::~Sequential_music_iterator()
   if (iter_p_)
     {
       if (iter_p_->ok ())
-       music_l_->warning (_ ("Must stop before this music ends"));
+       music_l_->origin ()->warning (_ ("Must stop before this music ends"));
       delete iter_p_;
       iter_p_ = 0;
     }
 }
 
-
-
-
 void
 Sequential_music_iterator::do_process_and_next (Moment until)
 {
@@ -112,7 +109,7 @@ Sequential_music_iterator::do_process_and_next (Moment until)
          set_sequential_music_translator();
          leave_element();
          
-         if (cursor_)
+         if (gh_pair_p (cursor_))
            start_next_element();
          else 
            goto loopexit;
@@ -138,7 +135,7 @@ Sequential_music_iterator::ok() const
 }
 
 Music_iterator*
-Sequential_music_iterator::try_music_in_children (Music const *m) const
+Sequential_music_iterator::try_music_in_children (Music *m) const
 { 
   return iter_p_ ? iter_p_->try_music (m) : 0;
 }
index 7e60780cc941bb50f8429953ab0e3f6b13ae74cf..5ea7f712186579e8b819b19e7301be464a293e64 100644 (file)
@@ -28,10 +28,11 @@ Simultaneous_music_iterator::construct_children()
   int j = 0;
   Music_sequence const *sim = dynamic_cast<Music_sequence const*> (music_l_);
 
-  Cons<Music> *i = (sim->music_p_list_p_) ? sim->music_p_list_p_->head_ : 0;
-  for (; i;  i = i->next_, j++)
+  SCM i = sim->music_list ();
+  for (; gh_pair_p(i); i = gh_cdr(i), j++)
     {
-      Music_iterator * mi = static_get_iterator_p (i->car_);
+      Music *mus = unsmob_music (gh_car (i));
+      Music_iterator * mi = static_get_iterator_p (mus);
 
       /* if separate_contexts_b_ is set, create a new context with the
         number number as name */
@@ -44,7 +45,7 @@ Simultaneous_music_iterator::construct_children()
       if (!t)
        t = report_to_l ();
 
-      mi->init_translator (i->car_, t);
+      mi->init_translator (mus, t);
       mi->construct_children ();
       
       if (mi->ok()) 
@@ -106,7 +107,7 @@ Simultaneous_music_iterator::ok() const
 }
 
 Music_iterator*
-Simultaneous_music_iterator::try_music_in_children (Music const*m) const
+Simultaneous_music_iterator::try_music_in_children (Music *m) const
 {
   Music_iterator * b=0;
   for (Cons<Music_iterator> *p = children_p_list_.head_; !b && p; p = p->next_)
index 893c0c4beddf41c7cb15b5460ca62e4d4d8343bc..839b64649a6910a9e4399f11f4c9c62d139797d5 100644 (file)
@@ -79,7 +79,7 @@ Slur_engraver::do_removal_processing ()
   if (!wgb)
     for (int i=0; i < requests_arr_.size (); i++)
       {
-       requests_arr_[i]->warning (_ ("unterminated slur"));
+       requests_arr_[i]->origin ()->warning (_ ("unterminated slur"));
       }
 }
 
@@ -95,7 +95,7 @@ Slur_engraver::do_process_music ()
        {
          if (slur_l_stack_.empty ())
 
-           slur_req_l->warning (_f ("can't find both ends of %s", _ ("slur")));
+           slur_req_l->origin ()->warning (_f ("can't find both ends of %s", _ ("slur")));
          else
            {
              Score_element* slur = slur_l_stack_.pop ();
@@ -121,7 +121,7 @@ Slur_engraver::do_process_music ()
            }
          start_slur_l_arr_.push (slur);
          requests_arr_.push (slur_req_l);
-         announce_element (Score_element_info (slur, slur_req_l));
+         announce_element (slur, slur_req_l);
        }
     }
   for (int i=0; i < start_slur_l_arr_.size (); i++)
index 4dc344b8c070b51dde5898d856319720d8bb0c58..de4be78cb2b24c9f304af1ade18a8d13f3eddc88 100644 (file)
@@ -78,7 +78,7 @@ Spacing_engraver::do_creation_processing ()
   spacing_p_  =new Spanner (get_property ("basicSpacingSpannerProperties"));
   Spacing_spanner::set_interface (spacing_p_);
   spacing_p_->set_bound (LEFT, unsmob_element (get_property ("currentCommandColumn")));  
-  announce_element (Score_element_info (spacing_p_, 0));
+  announce_element (spacing_p_, 0);
 }
 
 void
index dd40fd96e28d3fce48ba9ddac179f7b4a0ac63d4..a228a1b2980011069a2d17a9fae3cd657a5c1650 100644 (file)
@@ -66,7 +66,7 @@ Span_bar_engraver::acknowledge_element (Score_element_info i)
          spanbar_p_->set_parent (bar_l_arr_[0], Y_AXIS);
          spanbar_p_->set_parent (bar_l_arr_[0], X_AXIS);
 
-         announce_element (Score_element_info (spanbar_p_,0));
+         announce_element (spanbar_p_,0);
        }
     }
 }
index deef286259911938e44798f5e843862177a0a37c..5a1eadfe49f71383d9bc544d728049cc4144dd41 100644 (file)
@@ -84,7 +84,7 @@ Span_dynamic_performer::do_process_music ()
     {
       if (!span_start_req_l_)
        {
-         span_req_l_drul_[STOP]->warning (_ ("can't find start of (de)crescendo"));
+         span_req_l_drul_[STOP]->origin ()->warning (_ ("can't find start of (de)crescendo"));
        }
       else
        {
index f9cb12f4c1ae7dbaddf0329cfa4c1fb777aafa0a..5c8f4a1977699ba5ddcbc360e8afd8a0ab29fd96 100644 (file)
@@ -260,9 +260,14 @@ Spanner::get_broken_left_end_align () const
   return 0.0;
 }
 
-void
+SCM
 Spanner::do_derived_mark ()
 {
+  /*
+    We'd be fucked if this is called before spanned_drul_[] is inited.  */
+  if (status_i_ == ORPHAN)
+    return SCM_EOL;
+  
   Direction d = LEFT;
   do
     if (spanned_drul_[d])
@@ -271,6 +276,8 @@ Spanner::do_derived_mark ()
 
   for (int i= broken_into_l_arr_.size () ; i--;)
     scm_gc_mark (broken_into_l_arr_[i]->self_scm_);
+
+  return SCM_EOL;
 }
 
 void
index 1078870c62b249151cb0d2069a42fff595c371ff..d5fb4860f227987f1a723af0a4c0c7aa58bb9910 100644 (file)
@@ -48,7 +48,7 @@ Staff_symbol_engraver::do_creation_processing()
   
   span_p_->set_bound(LEFT, unsmob_element (get_property ("currentCommandColumn")));
 
-  announce_element (Score_element_info (span_p_, 0));
+  announce_element (span_p_, 0);
 }
 
 void
index 2b5367aab276018ca567abbcca6990c22ec63048..1c3de7e27aace35e5cfc371fd850920af8ad78cb 100644 (file)
@@ -106,7 +106,7 @@ Stem_engraver::acknowledge_element(Score_element_info i)
                  tremolo_p_ = new Item (get_property ("basicStemTremoloProperties"));
                  Stem_tremolo::set_interface (tremolo_p_);
 
-                 announce_element (Score_element_info (tremolo_p_, tremolo_req_l_));
+                 announce_element (tremolo_p_, tremolo_req_l_);
                  /*
                    The number of tremolo flags is the number of flags of
                    the tremolo-type minus the number of flags of the note
@@ -120,12 +120,12 @@ Stem_engraver::acknowledge_element(Score_element_info i)
                                                gh_int2scm (tremolo_flags));
                }
            }
-         announce_element (Score_element_info (stem_p_, r));
+         announce_element (stem_p_, r);
        }
 
       if (Stem::flag_i (stem_p_) != duration_log)
        {
-         r->warning (_f ("Adding note head to incompatible stem (type = %d)", 1 <<  Stem::flag_i (stem_p_)));
+         r->origin ()->warning (_f ("Adding note head to incompatible stem (type = %d)", 1 <<  Stem::flag_i (stem_p_)));
        }
 
       Stem::add_head (stem_p_,h);
index 2f9c36619510abaed27a0ef626bb39b8937d7f58..35189db93972b515fcd2d84ec64a4dd2c8fd7cec 100644 (file)
@@ -79,7 +79,7 @@ System_start_delimiter_engraver::do_creation_processing()
       delim_->set_elt_property ("glyph", s);
     }
 
-  announce_element (Score_element_info (delim_,0));
+  announce_element (delim_,0);
 }
 
 void
index 118f8ff2a9372040c68fb0b1fdb0bf349f2c8f8c..f6661e2359ff73f20f8f06fbb9cf78b74c22a684 100644 (file)
@@ -103,7 +103,7 @@ Text_engraver::do_process_music ()
          text->set_elt_property ("no-spacing-rods" , SCM_BOOL_F);
          text->set_extent_callback (0, X_AXIS);
        }
-      announce_element (Score_element_info (text, r));
+      announce_element (text, r);
       texts_.push (text);
     }
 }
index 0f3f3b23007844e3a4b4e0bfda59e1ece727c21f..aa3180f7f620a603649f1d91ab01e0eb0e2a9376 100644 (file)
@@ -184,7 +184,7 @@ Tie_engraver::process_acknowledged ()
          Tie::set_head (p,RIGHT, dynamic_cast<Item*> (unsmob_element (gh_cdr (pair))));
          
          tie_p_arr_.push (p);
-         announce_element (Score_element_info (p, req_l_));
+         announce_element (p, req_l_);
        }
       else for (SCM s = head_list; gh_pair_p (s); s = gh_cdr (s))
        {
@@ -195,12 +195,12 @@ Tie_engraver::process_acknowledged ()
          Tie::set_head (p, RIGHT, dynamic_cast<Item*> (unsmob_element (gh_cdar (s))));
          
          tie_p_arr_.push (p);
-         announce_element (Score_element_info (p, req_l_));
+         announce_element (p, req_l_);
        }
 
       if (!tie_p_arr_.size ())
        {
-         req_l_->warning (_ ("No ties were created!"));
+         req_l_->origin ()->warning (_ ("No ties were created!"));
        }
       else if (tie_p_arr_.size () > 1 && !tie_column_p_)
        {
@@ -208,7 +208,7 @@ Tie_engraver::process_acknowledged ()
          Tie_column::set_interface (tie_column_p_);
          for (int i = tie_p_arr_.size (); i--; )
            Tie_column::add_tie (tie_column_p_,tie_p_arr_ [i]);
-         announce_element (Score_element_info (tie_column_p_, 0));
+         announce_element (tie_column_p_, 0);
        }
     }
 }
index 51d1375d849d376995eea6dd56a834c9b8a12d56..f1088d4c8e6072a9c6e82b0ee34a3d781da2971e 100644 (file)
@@ -106,7 +106,7 @@ Tie_performer::process_acknowledged ()
       
       if (!tie_p_arr_.size ())
        {
-         req_l_->warning (_("No ties were created!"));
+         req_l_->origin ()->warning (_("No ties were created!"));
        }
       
     }
index da04bbf30f8fca60d600d66b1ec9e3effe677f93..6230181c884b04482408c15f11fc4285361dfec4 100644 (file)
@@ -22,7 +22,7 @@ Time_scaled_music_iterator::do_process_and_next (Moment m)
       if (yeah)
        set_translator (yeah->report_to_l ());
       else
-       music_l_->warning ( _("no one to print a tuplet start bracket"));
+       music_l_->origin ()->warning ( _("no one to print a tuplet start bracket"));
     }
 
   Music_wrapper_iterator::do_process_and_next (m);
index 9b44c6ded40fe2ff1ad08a5b2671fca0f0ec2d21..99f7898328d9edc056864ba051f3bb03ae834e81 100644 (file)
@@ -64,7 +64,7 @@ Time_signature_engraver::do_process_music()
 
   
   if (time_signature_p_)
-    announce_element (Score_element_info (time_signature_p_, req));
+    announce_element (time_signature_p_, req);
 }
 
 void
index 9096284795223d6b930b1088baf0d4a790d5d233..762ac771bac580498589a830e6c8cc6f0cb9e11f 100644 (file)
@@ -33,8 +33,8 @@ Timing_translator::do_try_music (Music*r)
            return true;
          if (String (classname (timing_req_l_arr_[i])) == classname (r))
            {
-             r->warning (_ ("conflicting timing request"));
-             timing_req_l_arr_[i]->warning (_("This is the other timing request")); 
+             r->origin ()->warning (_ ("conflicting timing request"));
+             timing_req_l_arr_[i]->origin ()->warning (_("This is the other timing request")); 
              return false;
            }
        }
@@ -75,7 +75,7 @@ Timing_translator::do_process_music()
        {
          if (measure_position ())
            {
-             tr_l ->warning (_f ("barcheck failed at: %s", 
+             tr_l ->origin ()->warning (_f ("barcheck failed at: %s", 
                                  measure_position ().str ()));
              // resync
              daddy_trans_l_->set_property("measurePosition",
index 45f8de630c37dd7901d975f57d68a328febbc19a..cdd2579202ac0496dc946c8bec8f1fcfbd8a161c 100644 (file)
@@ -9,12 +9,5 @@
 #include "translation-property.hh"
 #include "debug.hh"
 
-void
-Translation_property::do_print () const
-{
-#ifndef NPRINT
-  DEBUG_OUT << "." << var_str_ << " = " ;
-  if (flower_dstream && !flower_dstream->silent_b ("Translation_property"))
-    ly_display_scm (value_);
-#endif
-}
+
+
index 62de8aa63414296d4bec85bc88a789fb677cca0f..4303d0cbf470bdeef0991cf46efd761aeafb2273 100644 (file)
@@ -459,6 +459,13 @@ Translator_group::get_property (SCM sym) const
 void
 Translator_group::set_property (String id, SCM val)
 {
-  properties_dict_->set (ly_symbol2scm (id.ch_C()), val);
+  set_property (ly_symbol2scm (id.ch_C()), val);
 }
 
+void
+Translator_group::set_property (SCM sym, SCM val)
+{
+  properties_dict_->set (sym, val);
+}
+
+
index 6fcdba950e6b37657129a10c303980ec763b02ed..0c38ef1d2ae04c6be7d2b99e92ef10fc786fe447 100644 (file)
@@ -44,7 +44,7 @@ Tuplet_engraver::do_try_music (Music *r)
 {
   if (Time_scaled_music * c = dynamic_cast<Time_scaled_music *> (r))
     {
-      Music *el = c->element_l ();
+      Music *el = c->element ();
       if (!dynamic_cast<Request_chord*> (el))
        {
          time_scaled_music_arr_.push (c);
@@ -84,7 +84,7 @@ Tuplet_engraver::do_process_music ()
       glep->set_elt_property ("text",
                              ly_str02scm (to_str (time_scaled_music_arr_[i]->den_i_).ch_C()));
       
-      announce_element (Score_element_info (glep, time_scaled_music_arr_ [i]));
+      announce_element (glep, time_scaled_music_arr_ [i]);
     }
 }
 
index a51bbca2f602a9f656a3fd02cd376e413af97820..6395987a1df84f235dba6c6fbabeacdadaea4b75 100644 (file)
@@ -40,26 +40,26 @@ the  alternative just set.
 void
 Unfolded_repeat_iterator::next_element () 
 {
-  Repeated_music const* mus =dynamic_cast<Repeated_music const*> (music_l_);
+  Repeated_music * mus =dynamic_cast<Repeated_music *> (music_l_);
   delete current_iter_p_;
   current_iter_p_ =0;
 
 
   if (do_main_b_)
     {
-      done_mom_ += mus->repeat_body_p_->length_mom ();
+      done_mom_ += mus->body ()->length_mom ();
 
       if (!mus->volta_fold_b_)
        done_count_ ++;
      
-      if (alternative_cons_l_)
+      if (gh_pair_p (alternative_cons_))
        {
-         current_iter_p_ = get_iterator_p (alternative_cons_l_->car_);
+         current_iter_p_ = get_iterator_p (unsmob_music (gh_car (alternative_cons_)));
          do_main_b_ = false;
        }
       else if (done_count_ <  mus->repeats_i_ && !mus->volta_fold_b_) 
        {
-         current_iter_p_ = get_iterator_p (mus->repeat_body_p_);
+         current_iter_p_ = get_iterator_p (mus->body ());
          do_main_b_ = true;
        }
     }
@@ -69,13 +69,13 @@ Unfolded_repeat_iterator::next_element ()
        we're not in the main part. So we're either in an alternative, or
        we just finished.
       */
-      if (alternative_cons_l_)
+      if (alternative_cons_)
        {
-         done_mom_ += alternative_cons_l_->car_->length_mom ();
+         done_mom_ += unsmob_music (gh_car (alternative_cons_))->length_mom ();
 
          if (mus->volta_fold_b_ || 
              mus->repeats_i_ - done_count_  < alternative_count_i_)
-           alternative_cons_l_ = alternative_cons_l_->next_;
+           alternative_cons_ = gh_cdr (alternative_cons_);
          
          /*
            we've done the main body as well, but didn't go over the other
@@ -84,13 +84,13 @@ Unfolded_repeat_iterator::next_element ()
            done_count_ ++;
        }
       
-      if (done_count_ < mus->repeats_i_ && alternative_cons_l_)
+      if (done_count_ < mus->repeats_i_ && gh_pair_p (alternative_cons_))
        {
          if (mus->volta_fold_b_)
-           current_iter_p_ = get_iterator_p (alternative_cons_l_->car_);
+           current_iter_p_ = get_iterator_p (unsmob_music (gh_car (alternative_cons_)));
          else
            {
-             current_iter_p_ = get_iterator_p (mus->repeat_body_p_);
+             current_iter_p_ = get_iterator_p (mus->body ());
              do_main_b_ = true;
            }
        }
@@ -113,22 +113,23 @@ Unfolded_repeat_iterator::next_moment () const
 void
 Unfolded_repeat_iterator::construct_children ()
 {
-  Repeated_music const* mus =dynamic_cast<Repeated_music const*> (music_l_);
-  alternative_cons_l_ = (mus->alternatives_p_)
-    ? mus->alternatives_p_->music_p_list_p_->head_
-    : 0;
+  Repeated_music * mus =dynamic_cast<Repeated_music *> (music_l_);
+  
+  alternative_cons_ = (mus->alternatives ())
+    ? mus->alternatives ()->music_list ()
+    : SCM_EOL;
 
-  for (Cons<Music> *p = alternative_cons_l_; p; p = p->next_)
+  for (SCM p = alternative_cons_; gh_pair_p (p); p = gh_cdr (p))
     alternative_count_i_ ++;
 
-  if (mus->repeat_body_p_)
+  if (mus->body ())
     {
-      current_iter_p_  = get_iterator_p (mus->repeat_body_p_);
+      current_iter_p_  = get_iterator_p (mus->body ());
       do_main_b_ = true;
     }
-  else if (alternative_cons_l_)
+  else if (gh_pair_p (alternative_cons_))
     {
-      current_iter_p_ = get_iterator_p (alternative_cons_l_->car_);
+      current_iter_p_ = get_iterator_p (unsmob_music (gh_car (alternative_cons_)));
       do_main_b_ = false;
     }
 }
@@ -142,7 +143,7 @@ Unfolded_repeat_iterator::do_process_and_next (Moment m)
       if (yeah)
        set_translator (yeah->report_to_l ());
       else
-       music_l_->warning ( _("no one to print a volta bracket"));
+       music_l_->origin ()->warning ( _("no one to print a volta bracket"));
     }
   while (1)
     {
@@ -172,7 +173,7 @@ Unfolded_repeat_iterator::do_print () const
 }
 
 Music_iterator* 
-Unfolded_repeat_iterator::try_music_in_children (Music const * m) const
+Unfolded_repeat_iterator::try_music_in_children (Music  * m) const
 {
   return  current_iter_p_->try_music (m);
 }
index fd0a20c87978f824b0e060856aae03a7e466f660..41308ac2cf12974fdb974aeed29701a74f629957 100644 (file)
@@ -1,10 +1,7 @@
 % Toplevel initialisation file. 
 
-foo = \tempo 4 = 100 ;
-       
 \version "1.3.59";
 
-
 \include "declarations.ly";
 
 \maininput
diff --git a/mf/feta-nummer-code.mf b/mf/feta-nummer-code.mf
new file mode 100644 (file)
index 0000000..a766458
--- /dev/null
@@ -0,0 +1,421 @@
+% feta-nummer.mf -- implement bold Orator numerals
+%
+% part of LilyPond's pretty-but-neat music font
+%
+% source file of the Feta (not the Font-En-Tja) music font
+% 
+% (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
+
+fet_begingroup("number")
+
+define_pixels(height,thick,thick,thin,hair,flare);
+define_pixels(foot_top,foot_width);
+define_pixels(kuulleke);
+
+def calc_kuulleke(expr w,alpha) = 
+       begingroup;
+       save beta; beta=(alpha-90)/2;
+       save gamma; gamma=(90+alpha)/2;
+
+       penpos1(w/cosd(alpha),alpha);
+       penpos2(hair,90+beta);
+       z2=z1l+(1/2hair/tand((alpha+90)/2))*dir(beta);
+
+       penpos3(hair,gamma-90);
+       z3=z1r-(1/2hair/tand((90-alpha)/2))*dir(gamma);
+       z4=z1+kuulleke*dir(alpha-90);
+       endgroup;
+       enddef;
+
+% should make generic macro? 
+%
+def draw_foot(expr xpos) = 
+       begingroup;
+       clearxy;
+       penpos1(thick,0);
+       z1=(xpos,foot_top);
+       penpos2(foot_width,0);
+       z2=(x1,0);
+       penpos3(hair,-90);
+       z3r=z2r;
+       penpos4(hair,90);
+       z4l=z2l;
+       z5=(x1,kuulleke);
+       penlabels(1,2,3,4);
+       fill z1..{right}z1r{down}..{right}z3l..z3r{left}..z5
+               ..{left}z4l..z4r{right}..{up}z1l{right}..z1..cycle;
+       endgroup;
+       enddef;
+
+def draw_six =
+       set_char_box(0, 2/3height#*widen, 0, height#);
+       message "w:"&decimal w;
+       message "h:"&decimal h;
+
+       penpos1(thin,90);
+       z1=(thick,h/2+thin-hair/2);
+       penpos2(hair,90);
+       
+       z2=(w/2,y1);
+       penpos3(7/8thick,0);
+       % yup, should use the path fract [] "everywhere"
+       z3r=(w,1/2[0,y1]);
+       penpos4(hair,-90);
+       z4r=(x2,0);
+       penpos5(7/8thick,180);
+       z5r=(0,y1);
+       penpos6(hair,90);
+       z6r=(w-flare,h);
+       penpos7(7/8thick,180);
+       z7r=(0,h/2);
+       penpos10(7/8thick,180);
+       z10r=(0,y3);
+       penlabels(1,2,3,4,5,6,7,8,9,10,11);
+       save t; t=tense;
+       fill z7{right}..z2r{right}..tension t..z3r{down}
+               ..tension t..z4r{left}
+               ..tension t..z7r{up}..tension t..z6r{right}
+               ..z6l{left}..tension t..z7l{down}..z10l{up}..cycle;
+       draw_flare(z6r,0,-90,hair,flare);
+       unfill z2l{right}..tension t..z3l{down}..tension t
+               ..z4l{left}..tension t..z10l{up}..tension t..cycle;
+       enddef;
+
+save dot_diam;
+dot_diam# = 7/8flare#;
+define_pixels(dot_diam);
+
+
+code := 43;  % , = 44 
+
+% urg
+fet_beginchar("Numeral comma", ",", "comma")
+       set_char_box(0, dot_diam#, 3/2dot_diam#, dot_diam#);
+       pickup pencircle scaled dot_diam;
+       draw (dot_diam/2,dot_diam/2);
+       z0=(w/3,0);
+       alpha=65;
+        penpos1(thin,alpha+90);
+        z1l=(w/2,-1.5h+hair);
+       z2=(w,h/2);
+       pickup pencircle;
+       filldraw z1l{dir(alpha)}..{up}z2..{z0-z2}z0{right}..{dir(180+alpha)}z1r..cycle;
+       labels(0,1,2);
+       penlabels(1);
+fet_endchar;
+
+fet_beginchar("Numeral dash", "-", "dash")
+       set_char_box(0, height#/3, 0, height#);
+       pickup pencircle scaled thin;
+       lft x1 = -b;
+       rt x2 = w;
+       y1 = y2 = h/3;
+       draw z1 .. z2;
+fet_endchar;
+
+fet_beginchar("Numeral dot", ".", "dot")
+       set_char_box(0, dot_diam#, 0, dot_diam#);
+       pickup pencircle scaled dot_diam;
+       draw (dot_diam/2,dot_diam/2);
+fet_endchar;
+
+
+% skip slash
+
+code := 47; % 0 = 48
+
+fet_beginchar("Numeral 0", "0", "zero")
+%      set_char_box(0, 4/5height#*widen, 0, height#);
+       set_char_box(0, 11/15height#*widen, 0, height#);
+       message "w:"&decimal w;
+       message "h:"&decimal h;
+       penpos1(thin,90);
+       z1r=(w/2,h);
+       penpos2(thick,180);
+       z2r=(0,h/2);
+       penpos3(thin,-90);
+       z3r=(w/2,0);
+       penpos4(thick,0);
+       z4r=(w,h/2);
+       fill z1r..z2r..z3r..z4r..cycle;
+       save t; t=1/tense;
+       penlabels(1,2,3,4);
+       unfill z1l..tension t..z2l..tension t..z3l
+               ..tension t..z4l..tension t..cycle;
+fet_endchar;
+       
+fet_beginchar("Numeral 1", "1", "one")
+%      set_char_box(0, 19/30height#*widen, 0, height#);
+       set_char_box(0, 1/2foot_width#+3/2thick#+1/2hair#, 0, height#);
+       message "w:"&decimal w;
+       message "h:"&decimal h;
+
+       save alpha; alpha=0;
+       calc_kuulleke(thick,alpha);
+       z1=(3/2thick,height);
+
+       penpos5(thick,0);
+       z5=(x1,foot_top);
+       
+       z6=(0,h/2);
+       save beta; beta=angle(z1l-z6);
+       penpos7(thin,beta-90);
+       z7l=z6;
+       penpos8(thin/cosd(beta),-90);
+       z8l=z1l;
+       penpos9(thin,beta-90);
+       z9r=z8r+(thin/cosd(beta))*(0,-1);
+       penlabels(1,2,3,4,5,6,7,8,9);
+       save gamma; gamma=angle(length(z1r-z1),+2kuulleke);
+       fill z2r{dir(alpha-gamma)}..z4..{dir(alpha+gamma)}z3l..z3r{down}
+               ..{down}z5r{left}..z5..{left}z5l{up}..{up}z2l..cycle;
+       fill z7l{dir(beta)}..{dir(beta)}z1l..z2r..z9r{up}
+               ..z9l{dir(180+beta)}..{dir(180+beta)}z7r..cycle;
+       penlabels(7,8,9);
+
+       draw_foot(x1);
+fet_endchar;
+
+fet_beginchar("Numeral 2", "2", "two")
+       set_char_box(0, 11/15height#*widen, 0, height#);
+       message "w:"&decimal w;
+       message "h:"&decimal h;
+       clearxy;
+       save alpha; alpha=-45*widen;
+       save beta; beta=85;
+       save gamma; gamma=beta-10;
+       save theta; theta=20/widen;
+       penpos1(hair,90+beta);
+       z1=(0,0)+(1/2sqrt(2)*hair)*dir(45);
+       penpos3(hair,90+gamma);
+       z3=(w,thick)+(1/2sqrt(2)*hair)*dir(-135);
+       penpos2(thick,90+alpha);
+       x2-x1=x3-x2; y2=11/16thick/widen;
+       fill z1r{dir(beta)}..{dir(alpha)}z2r..{dir(gamma)}z3r
+               ..z3l{dir(180+gamma)}..{dir(180+alpha)}z2l
+               ..{dir(180+beta)}z1l..cycle;
+
+       penpos4(thick,0);
+       z4r=(w-thin/2,.72h);
+       penpos5(thin,90);
+       z5r=(1/2hair+flare,h);
+       penlabels(1,2,3,4);
+       penlabels(5,6);
+       save t; t=tense;
+       fill z1l{dir(beta)}..tension t..z4r{up}
+               ..tension t..z5r{left}..z5l{right}
+               ..z4l{down}..tension t
+               ..{dir(180+beta)}z1r..cycle;
+       draw_flare(z5r,180,90,thin,flare);
+fet_endchar;
+
+fet_beginchar("Numeral 3", "3", "three")
+       set_char_box(0, 2/3height#*widen, 0, height#);
+       message "w:"&decimal w;
+       message "h:"&decimal h;
+       penpos1(hair,-90);
+       z1l=(17/16thick,h);
+       penpos2(7/8thick,180);
+       z2l=(w-thick/8,3/4h+thick/16);
+       penpos3(thin,90);
+       z3=(w/2,h/2+1/8thick);
+       penpos4(thin,90);
+       z4=(5/8thick+1/2thin,y3);
+       penpos5(thick,0);
+       z5r=(w,1/4h+thick/16);
+       penpos6(hair,-90);
+       z6r=(9/8thick,0);
+       penpos7(3/2thin,90);
+       z7=(x5,y3);
+       penlabels(1,2,3,4,5,6,7);
+       save alpha; alpha=25;
+       save t; t=tense;
+       fill z1l{right}..tension t..z2l{down}..z7r{dir(180+alpha)}
+               ..z7l{dir(-alpha)}..z5r{down}..tension t..z6r{left}
+               ..z6l{right}..tension t..z5l{up}
+               ..tension t..z3l{left}..z4l{left}
+               ..z4r{right}..z3r{right}..tension t..z2r{up}
+               ..tension t..z1r{left}..cycle;
+       draw_flare(z1l,180,90,hair,7/8flare);
+       draw_flare(z6r,180,-90,hair,flare);
+fet_endchar;
+
+fet_beginchar("Numeral 4", "4", "four")
+       set_char_box(0, 4/5height#*widen, 0, height#);
+       message "w:"&decimal w;
+       message "h:"&decimal h;
+
+       save alpha; alpha=0;
+       calc_kuulleke(3/2thick,alpha);
+       z1r=(w-3/4thick,height);
+
+       z5=(thin,1/4height+thin);
+       save beta; beta=angle(z3r-z5);
+       penpos6(thin,-90);
+       z6l=z5;
+       penpos7(thin,-90);
+       y7=y6; x7=w-1/2thin;
+       penpos8(thin,-alpha);
+       z8r=z5;
+       penlabels(1,2,3,4,5,6,7);
+       save gamma; gamma=angle(length(z1r-z1),+2kuulleke);
+       fill z2r{dir(alpha-gamma)}..z4..{dir(alpha+gamma)}z3l
+               ..z3r{dir(180+beta)}..{dir(180+beta)}z8r{right}
+               ..{right}z7l..z7r{left}..{left}z6r..z8l{dir(beta)}
+               ..{up}z2l..cycle;
+
+       clearxy;
+
+       save alpha; alpha=beta;
+       calc_kuulleke(thick,alpha);
+       z1r=(w-3/4thick,height-(3/2thin)/cosd(alpha));
+
+       penpos5(thick,0);
+       z5=(x1,foot_top);
+       
+       save gamma; gamma=angle(length(z1r-z1),+2kuulleke);
+       fill z2r{dir(alpha-gamma)}..z4..{dir(alpha+gamma)}z3l
+               ..z3r{down}..{down}z5r{left}..z5..{left}z5l{up}
+               ..{up}z2l..cycle;
+       penlabels(1,2,3,4,5);
+
+       draw_foot(x5);
+fet_endchar;
+
+fet_beginchar("Numeral 5", "5", "five")
+       set_char_box(0, 7/10height#*widen, 0, height#);
+       message "w:"&decimal w;
+       message "h:"&decimal h;
+       calc_kuulleke(w-thin,0);
+       z1=(w/2+1/8thick,h);
+       save alpha; alpha=0;
+       penpos5(thin,0);
+       z5l=(x1l,h-15/16thick);
+       penpos6(hair,90-45);
+       z6=z5r+1/2hair*dir(-45);
+       penpos7(thin,0);
+       z7l=(x1l,h/2+thin-hair);
+       penlabels(1,2,3,4,5,6,7);
+       save gamma; gamma=angle(length(z1r-z1),+2kuulleke);
+       fill z2r{dir(alpha-gamma)}..z4..{dir(alpha+gamma)}z3l
+               ..z3r{dir(-135)}..{left}z6r..z6l{down}..z7r{down}
+               ..z7l{up}..{up}z2l..cycle;
+       penpos8(thin,90);
+       z8l=(x7r,y7r-1/16thick);
+       penpos9(thin,90);
+       z9=(x11+3/16thick,10/16[y5,y7]);
+       penpos10(thick,0);
+       z10r=(w,1/2[y9r,y11r]);
+       penpos11(hair,-90);
+        z11r=(9/8thick,0);
+       penlabels(8,9,10,11);
+       save beta; beta=45;
+       save t; t=tense;
+       fill z8r{dir(beta)}..z9r{right}..tension t..z10r{down}
+               ..tension t..z11r{left}
+               ..z11l{right}..tension t..z10l{up}..tension t
+               ..z9l{left}..z8l{dir(180+beta+10)}..cycle;
+       draw_flare(z11r,180,-90,hair,flare);
+fet_endchar;
+
+fet_beginchar("Numeral 6", "6", "six")
+       draw_six;
+fet_endchar;
+
+fet_beginchar("Numeral 7", "7", "seven")
+       set_char_box(0, 11/15height#*widen, 0, height#);
+       message "w:"&decimal w;
+       message "h:"&decimal h;
+
+       save alpha; alpha=-180;
+if true:
+       penpos1(3/2thick,180+alpha);
+       penpos2(hair,180+alpha-45);
+       z2=z1l+(1/4sqrt(2)*hair)*dir(alpha-135);
+       penpos3(hair,180+alpha+45);
+       z3=z1r+(1/4sqrt(2)*hair)*dir(alpha-45);
+       z4=z1+kuulleke*dir(alpha-90);
+else:
+       % shit, does not work
+       calc_kuulleke(3/2thick,-alpha);
+fi
+       z1l=(thin,0);
+
+       save beta; beta=55;
+       penpos5(thin,90+beta);
+       z5=(w,h)+(1/2sqrt(2)*thin)*dir(-135);
+
+       save gamma; gamma=angle(length(z1r-z1),+2kuulleke);
+       save delta; delta=12;
+       pickup pencircle;
+       fill z3l{dir(alpha-gamma)}..z4..{dir(alpha+gamma)}z2r..
+               z2l{dir(beta+delta)}..{dir(beta)}z5r
+               ..z5l{dir(180+beta)}..{dir(delta-90)}z3r..cycle;
+       penlabels(1,2,3,4,5);
+
+       clearxy;
+       save alpha; alpha=-45*widen;
+       penpos1(1/2thick,90);
+       z1=(3/2thin,h-(thick+thin)/2);
+       penpos3(thin,90+beta);
+       z3=(w,h)+(1/2sqrt(2)*thin)*dir(-135);
+       penpos2(thick,90+alpha);
+       x2=1/2[x1,x3]-1/4thick; y2=h-15/16thick+thin*widen;
+
+       penpos4(thin,0);
+       z4l=(0,h-thin/2);
+       penpos5(thin,0);
+       z5l=(0,h/2+thin/2);
+
+       penpos6(9/8thick,90);
+       z6r=(thin,y1r+2/16thick);
+       
+       fill z1r{dir(beta)}..{dir(alpha)}z2r..{dir(beta)}z3r
+               ..z3l{dir(180+beta)}..{dir(180+alpha)}z2l
+               ..{dir(180+beta)}z1l..z6l{down}..{down}z5r
+               ..z5l{up}..{up}z4l..z4r{down}..{down}z6r..{right}cycle;
+       penlabels(1,2,3,4,5,6);
+fet_endchar;
+
+fet_beginchar("Numeral 8", "8", "eight")
+       set_char_box(0, 11/15height#*widen, 0, height#);
+       message "w:"&decimal w;
+       message "h:"&decimal h;
+       save alpha; alpha=60;
+       save beta; beta=alpha-15;
+       z1=(w/2,h/2+thick/8);
+       penpos2(hair,90+180+beta);
+       z2=(w/3,h/2+thin);
+       penpos3(3/2thin,0);
+       z3l=(0,h/4+thin/2);
+       penpos4(hair,90);
+       z4l=(x1,0);
+       penpos5(thick,90+90+alpha);
+       z5=z1+w/4*dir(alpha-90);
+       penpos6(thick,90+90+alpha);
+       z6=z1+(w/4-thin/2)*dir(90+alpha);
+       penpos7(hair,90);
+       z7r=(x1,h);
+       penpos8(3/2thin,0);
+       z8r=(w-thin/2,3/4h+thin/2);
+       penpos9(hair,90+180+beta);
+       z9=(2/3w,h/2);
+       penlabels(1,2,3,4,5,6,7,8,9);
+       save t; t=tense;
+       fill z2r{dir(180+beta)}..z3r{down}..z4r{right}
+               ..z5r{dir(90+alpha)}..z6r{dir(90+alpha)}
+               ..tension t..z7r{right}..z8r{down}..z9r{dir(180+beta)}
+               ..z9l{dir(beta)}..z8l{up}..z7l{left}..z6l{dir(alpha-90)}
+               ..z5l{dir(alpha-90)}..tension t..z4l{left}..z3l{up}
+               ..z2l{dir(beta)}..cycle;
+fet_endchar;
+
+fet_beginchar("Numeral 9", "9", "nine")
+       draw_six;
+%      xy_mirror_char;
+       currentpicture := currentpicture scaled -1;
+       currentpicture := currentpicture shifted (w,h);
+fet_endchar;
+
+fet_endgroup("number")
+
index a7664589eff43aa50624e68165de664fdb0a8085..476a2c43fa33232cdde885f3e80b2d06770b913e 100644 (file)
-% feta-nummer.mf -- implement bold Orator numerals
-%
+% feta-nummer-generic.mf
 % part of LilyPond's pretty-but-neat music font
-%
-% source file of the Feta (not the Font-En-Tja) music font
-% 
-% (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
 
-fet_begingroup("number")
+test:=0;
 
-define_pixels(height,thick,thick,thin,hair,flare);
-define_pixels(foot_top,foot_width);
-define_pixels(kuulleke);
+input feta-autometric;
+input feta-macros;
+input feta-params;
 
-def calc_kuulleke(expr w,alpha) = 
-       begingroup;
-       save beta; beta=(alpha-90)/2;
-       save gamma; gamma=(90+alpha)/2;
+%blot_diameter# = .4pt#;
 
-       penpos1(w/cosd(alpha),alpha);
-       penpos2(hair,90+beta);
-       z2=z1l+(1/2hair/tand((alpha+90)/2))*dir(beta);
+fet_beginfont("feta-nummer", design_size);
+mode_setup;
 
-       penpos3(hair,gamma-90);
-       z3=z1r-(1/2hair/tand((90-alpha)/2))*dir(gamma);
-       z4=z1+kuulleke*dir(alpha-90);
-       endgroup;
-       enddef;
+height#:=designsize;
 
-% should make generic macro? 
-%
-def draw_foot(expr xpos) = 
-       begingroup;
-       clearxy;
-       penpos1(thick,0);
-       z1=(xpos,foot_top);
-       penpos2(foot_width,0);
-       z2=(x1,0);
-       penpos3(hair,-90);
-       z3r=z2r;
-       penpos4(hair,90);
-       z4l=z2l;
-       z5=(x1,kuulleke);
-       penlabels(1,2,3,4);
-       fill z1..{right}z1r{down}..{right}z3l..z3r{left}..z5
-               ..{left}z4l..z4r{right}..{up}z1l{right}..z1..cycle;
-       endgroup;
-       enddef;
+font_x_height height#;
 
-def draw_six =
-       set_char_box(0, 2/3height#*widen, 0, height#);
-       message "w:"&decimal w;
-       message "h:"&decimal h;
+save b,h; 4h+b=1.15; 10h+b=1;
+fatten:=designsize*h+b;
+save b,h; 4h+b=1.05; 10h+b=1;
+widen:=designsize*h+b;
+tense=0.85;
+thick#:=7/30height#*fatten;
+thin#:=thick#/4*fatten;
+hair#:=blot_diameter#;
+flare#:=9/8thick#/fatten;
+save b,h; 4h+b=1/8; 10h+b=1/6;
+kuulleke#:=thick#*designsize*h+b;
+foot_top#:=thick#;
+foot_width#:=9/4thick#;
 
-       penpos1(thin,90);
-       z1=(thick,h/2+thin-hair/2);
-       penpos2(hair,90);
-       
-       z2=(w/2,y1);
-       penpos3(7/8thick,0);
-       % yup, should use the path fract [] "everywhere"
-       z3r=(w,1/2[0,y1]);
-       penpos4(hair,-90);
-       z4r=(x2,0);
-       penpos5(7/8thick,180);
-       z5r=(0,y1);
-       penpos6(hair,90);
-       z6r=(w-flare,h);
-       penpos7(7/8thick,180);
-       z7r=(0,h/2);
-       penpos10(7/8thick,180);
-       z10r=(0,y3);
-       penlabels(1,2,3,4,5,6,7,8,9,10,11);
-       save t; t=tense;
-       fill z7{right}..z2r{right}..tension t..z3r{down}
-               ..tension t..z4r{left}
-               ..tension t..z7r{up}..tension t..z6r{right}
-               ..z6l{left}..tension t..z7l{down}..z10l{up}..cycle;
-       draw_flare(z6r,0,-90,hair,flare);
-       unfill z2l{right}..tension t..z3l{down}..tension t
-               ..z4l{left}..tension t..z10l{up}..tension t..cycle;
-       enddef;
+input feta-nummer-code;
 
-save dot_diam;
-dot_diam# = 7/8flare#;
-define_pixels(dot_diam);
+fet_endfont("feta-nummer");
 
 
-code := 43;  % , = 44 
-
-% urg
-fet_beginchar("Numeral comma", ",", "comma")
-       set_char_box(0, dot_diam#, 3/2dot_diam#, dot_diam#);
-       pickup pencircle scaled dot_diam;
-       draw (dot_diam/2,dot_diam/2);
-       z0=(w/3,0);
-       alpha=65;
-        penpos1(thin,alpha+90);
-        z1l=(w/2,-1.5h+hair);
-       z2=(w,h/2);
-       pickup pencircle;
-       filldraw z1l{dir(alpha)}..{up}z2..{z0-z2}z0{right}..{dir(180+alpha)}z1r..cycle;
-       labels(0,1,2);
-       penlabels(1);
-fet_endchar;
-
-fet_beginchar("Numeral dash", "-", "dash")
-       set_char_box(0, height#/3, 0, height#);
-       pickup pencircle scaled thin;
-       lft x1 = -b;
-       rt x2 = w;
-       y1 = y2 = h/3;
-       draw z1 .. z2;
-fet_endchar;
-
-fet_beginchar("Numeral dot", ".", "dot")
-       set_char_box(0, dot_diam#, 0, dot_diam#);
-       pickup pencircle scaled dot_diam;
-       draw (dot_diam/2,dot_diam/2);
-fet_endchar;
-
-
-% skip slash
-
-code := 47; % 0 = 48
-
-fet_beginchar("Numeral 0", "0", "zero")
-%      set_char_box(0, 4/5height#*widen, 0, height#);
-       set_char_box(0, 11/15height#*widen, 0, height#);
-       message "w:"&decimal w;
-       message "h:"&decimal h;
-       penpos1(thin,90);
-       z1r=(w/2,h);
-       penpos2(thick,180);
-       z2r=(0,h/2);
-       penpos3(thin,-90);
-       z3r=(w/2,0);
-       penpos4(thick,0);
-       z4r=(w,h/2);
-       fill z1r..z2r..z3r..z4r..cycle;
-       save t; t=1/tense;
-       penlabels(1,2,3,4);
-       unfill z1l..tension t..z2l..tension t..z3l
-               ..tension t..z4l..tension t..cycle;
-fet_endchar;
-       
-fet_beginchar("Numeral 1", "1", "one")
-%      set_char_box(0, 19/30height#*widen, 0, height#);
-       set_char_box(0, 1/2foot_width#+3/2thick#+1/2hair#, 0, height#);
-       message "w:"&decimal w;
-       message "h:"&decimal h;
-
-       save alpha; alpha=0;
-       calc_kuulleke(thick,alpha);
-       z1=(3/2thick,height);
-
-       penpos5(thick,0);
-       z5=(x1,foot_top);
-       
-       z6=(0,h/2);
-       save beta; beta=angle(z1l-z6);
-       penpos7(thin,beta-90);
-       z7l=z6;
-       penpos8(thin/cosd(beta),-90);
-       z8l=z1l;
-       penpos9(thin,beta-90);
-       z9r=z8r+(thin/cosd(beta))*(0,-1);
-       penlabels(1,2,3,4,5,6,7,8,9);
-       save gamma; gamma=angle(length(z1r-z1),+2kuulleke);
-       fill z2r{dir(alpha-gamma)}..z4..{dir(alpha+gamma)}z3l..z3r{down}
-               ..{down}z5r{left}..z5..{left}z5l{up}..{up}z2l..cycle;
-       fill z7l{dir(beta)}..{dir(beta)}z1l..z2r..z9r{up}
-               ..z9l{dir(180+beta)}..{dir(180+beta)}z7r..cycle;
-       penlabels(7,8,9);
-
-       draw_foot(x1);
-fet_endchar;
-
-fet_beginchar("Numeral 2", "2", "two")
-       set_char_box(0, 11/15height#*widen, 0, height#);
-       message "w:"&decimal w;
-       message "h:"&decimal h;
-       clearxy;
-       save alpha; alpha=-45*widen;
-       save beta; beta=85;
-       save gamma; gamma=beta-10;
-       save theta; theta=20/widen;
-       penpos1(hair,90+beta);
-       z1=(0,0)+(1/2sqrt(2)*hair)*dir(45);
-       penpos3(hair,90+gamma);
-       z3=(w,thick)+(1/2sqrt(2)*hair)*dir(-135);
-       penpos2(thick,90+alpha);
-       x2-x1=x3-x2; y2=11/16thick/widen;
-       fill z1r{dir(beta)}..{dir(alpha)}z2r..{dir(gamma)}z3r
-               ..z3l{dir(180+gamma)}..{dir(180+alpha)}z2l
-               ..{dir(180+beta)}z1l..cycle;
-
-       penpos4(thick,0);
-       z4r=(w-thin/2,.72h);
-       penpos5(thin,90);
-       z5r=(1/2hair+flare,h);
-       penlabels(1,2,3,4);
-       penlabels(5,6);
-       save t; t=tense;
-       fill z1l{dir(beta)}..tension t..z4r{up}
-               ..tension t..z5r{left}..z5l{right}
-               ..z4l{down}..tension t
-               ..{dir(180+beta)}z1r..cycle;
-       draw_flare(z5r,180,90,thin,flare);
-fet_endchar;
-
-fet_beginchar("Numeral 3", "3", "three")
-       set_char_box(0, 2/3height#*widen, 0, height#);
-       message "w:"&decimal w;
-       message "h:"&decimal h;
-       penpos1(hair,-90);
-       z1l=(17/16thick,h);
-       penpos2(7/8thick,180);
-       z2l=(w-thick/8,3/4h+thick/16);
-       penpos3(thin,90);
-       z3=(w/2,h/2+1/8thick);
-       penpos4(thin,90);
-       z4=(5/8thick+1/2thin,y3);
-       penpos5(thick,0);
-       z5r=(w,1/4h+thick/16);
-       penpos6(hair,-90);
-       z6r=(9/8thick,0);
-       penpos7(3/2thin,90);
-       z7=(x5,y3);
-       penlabels(1,2,3,4,5,6,7);
-       save alpha; alpha=25;
-       save t; t=tense;
-       fill z1l{right}..tension t..z2l{down}..z7r{dir(180+alpha)}
-               ..z7l{dir(-alpha)}..z5r{down}..tension t..z6r{left}
-               ..z6l{right}..tension t..z5l{up}
-               ..tension t..z3l{left}..z4l{left}
-               ..z4r{right}..z3r{right}..tension t..z2r{up}
-               ..tension t..z1r{left}..cycle;
-       draw_flare(z1l,180,90,hair,7/8flare);
-       draw_flare(z6r,180,-90,hair,flare);
-fet_endchar;
-
-fet_beginchar("Numeral 4", "4", "four")
-       set_char_box(0, 4/5height#*widen, 0, height#);
-       message "w:"&decimal w;
-       message "h:"&decimal h;
-
-       save alpha; alpha=0;
-       calc_kuulleke(3/2thick,alpha);
-       z1r=(w-3/4thick,height);
-
-       z5=(thin,1/4height+thin);
-       save beta; beta=angle(z3r-z5);
-       penpos6(thin,-90);
-       z6l=z5;
-       penpos7(thin,-90);
-       y7=y6; x7=w-1/2thin;
-       penpos8(thin,-alpha);
-       z8r=z5;
-       penlabels(1,2,3,4,5,6,7);
-       save gamma; gamma=angle(length(z1r-z1),+2kuulleke);
-       fill z2r{dir(alpha-gamma)}..z4..{dir(alpha+gamma)}z3l
-               ..z3r{dir(180+beta)}..{dir(180+beta)}z8r{right}
-               ..{right}z7l..z7r{left}..{left}z6r..z8l{dir(beta)}
-               ..{up}z2l..cycle;
-
-       clearxy;
-
-       save alpha; alpha=beta;
-       calc_kuulleke(thick,alpha);
-       z1r=(w-3/4thick,height-(3/2thin)/cosd(alpha));
-
-       penpos5(thick,0);
-       z5=(x1,foot_top);
-       
-       save gamma; gamma=angle(length(z1r-z1),+2kuulleke);
-       fill z2r{dir(alpha-gamma)}..z4..{dir(alpha+gamma)}z3l
-               ..z3r{down}..{down}z5r{left}..z5..{left}z5l{up}
-               ..{up}z2l..cycle;
-       penlabels(1,2,3,4,5);
-
-       draw_foot(x5);
-fet_endchar;
-
-fet_beginchar("Numeral 5", "5", "five")
-       set_char_box(0, 7/10height#*widen, 0, height#);
-       message "w:"&decimal w;
-       message "h:"&decimal h;
-       calc_kuulleke(w-thin,0);
-       z1=(w/2+1/8thick,h);
-       save alpha; alpha=0;
-       penpos5(thin,0);
-       z5l=(x1l,h-15/16thick);
-       penpos6(hair,90-45);
-       z6=z5r+1/2hair*dir(-45);
-       penpos7(thin,0);
-       z7l=(x1l,h/2+thin-hair);
-       penlabels(1,2,3,4,5,6,7);
-       save gamma; gamma=angle(length(z1r-z1),+2kuulleke);
-       fill z2r{dir(alpha-gamma)}..z4..{dir(alpha+gamma)}z3l
-               ..z3r{dir(-135)}..{left}z6r..z6l{down}..z7r{down}
-               ..z7l{up}..{up}z2l..cycle;
-       penpos8(thin,90);
-       z8l=(x7r,y7r-1/16thick);
-       penpos9(thin,90);
-       z9=(x11+3/16thick,10/16[y5,y7]);
-       penpos10(thick,0);
-       z10r=(w,1/2[y9r,y11r]);
-       penpos11(hair,-90);
-        z11r=(9/8thick,0);
-       penlabels(8,9,10,11);
-       save beta; beta=45;
-       save t; t=tense;
-       fill z8r{dir(beta)}..z9r{right}..tension t..z10r{down}
-               ..tension t..z11r{left}
-               ..z11l{right}..tension t..z10l{up}..tension t
-               ..z9l{left}..z8l{dir(180+beta+10)}..cycle;
-       draw_flare(z11r,180,-90,hair,flare);
-fet_endchar;
-
-fet_beginchar("Numeral 6", "6", "six")
-       draw_six;
-fet_endchar;
-
-fet_beginchar("Numeral 7", "7", "seven")
-       set_char_box(0, 11/15height#*widen, 0, height#);
-       message "w:"&decimal w;
-       message "h:"&decimal h;
-
-       save alpha; alpha=-180;
-if true:
-       penpos1(3/2thick,180+alpha);
-       penpos2(hair,180+alpha-45);
-       z2=z1l+(1/4sqrt(2)*hair)*dir(alpha-135);
-       penpos3(hair,180+alpha+45);
-       z3=z1r+(1/4sqrt(2)*hair)*dir(alpha-45);
-       z4=z1+kuulleke*dir(alpha-90);
-else:
-       % shit, does not work
-       calc_kuulleke(3/2thick,-alpha);
-fi
-       z1l=(thin,0);
-
-       save beta; beta=55;
-       penpos5(thin,90+beta);
-       z5=(w,h)+(1/2sqrt(2)*thin)*dir(-135);
-
-       save gamma; gamma=angle(length(z1r-z1),+2kuulleke);
-       save delta; delta=12;
-       pickup pencircle;
-       fill z3l{dir(alpha-gamma)}..z4..{dir(alpha+gamma)}z2r..
-               z2l{dir(beta+delta)}..{dir(beta)}z5r
-               ..z5l{dir(180+beta)}..{dir(delta-90)}z3r..cycle;
-       penlabels(1,2,3,4,5);
-
-       clearxy;
-       save alpha; alpha=-45*widen;
-       penpos1(1/2thick,90);
-       z1=(3/2thin,h-(thick+thin)/2);
-       penpos3(thin,90+beta);
-       z3=(w,h)+(1/2sqrt(2)*thin)*dir(-135);
-       penpos2(thick,90+alpha);
-       x2=1/2[x1,x3]-1/4thick; y2=h-15/16thick+thin*widen;
-
-       penpos4(thin,0);
-       z4l=(0,h-thin/2);
-       penpos5(thin,0);
-       z5l=(0,h/2+thin/2);
-
-       penpos6(9/8thick,90);
-       z6r=(thin,y1r+2/16thick);
-       
-       fill z1r{dir(beta)}..{dir(alpha)}z2r..{dir(beta)}z3r
-               ..z3l{dir(180+beta)}..{dir(180+alpha)}z2l
-               ..{dir(180+beta)}z1l..z6l{down}..{down}z5r
-               ..z5l{up}..{up}z4l..z4r{down}..{down}z6r..{right}cycle;
-       penlabels(1,2,3,4,5,6);
-fet_endchar;
-
-fet_beginchar("Numeral 8", "8", "eight")
-       set_char_box(0, 11/15height#*widen, 0, height#);
-       message "w:"&decimal w;
-       message "h:"&decimal h;
-       save alpha; alpha=60;
-       save beta; beta=alpha-15;
-       z1=(w/2,h/2+thick/8);
-       penpos2(hair,90+180+beta);
-       z2=(w/3,h/2+thin);
-       penpos3(3/2thin,0);
-       z3l=(0,h/4+thin/2);
-       penpos4(hair,90);
-       z4l=(x1,0);
-       penpos5(thick,90+90+alpha);
-       z5=z1+w/4*dir(alpha-90);
-       penpos6(thick,90+90+alpha);
-       z6=z1+(w/4-thin/2)*dir(90+alpha);
-       penpos7(hair,90);
-       z7r=(x1,h);
-       penpos8(3/2thin,0);
-       z8r=(w-thin/2,3/4h+thin/2);
-       penpos9(hair,90+180+beta);
-       z9=(2/3w,h/2);
-       penlabels(1,2,3,4,5,6,7,8,9);
-       save t; t=tense;
-       fill z2r{dir(180+beta)}..z3r{down}..z4r{right}
-               ..z5r{dir(90+alpha)}..z6r{dir(90+alpha)}
-               ..tension t..z7r{right}..z8r{down}..z9r{dir(180+beta)}
-               ..z9l{dir(beta)}..z8l{up}..z7l{left}..z6l{dir(alpha-90)}
-               ..z5l{dir(alpha-90)}..tension t..z4l{left}..z3l{up}
-               ..z2l{dir(beta)}..cycle;
-fet_endchar;
-
-fet_beginchar("Numeral 9", "9", "nine")
-       draw_six;
-%      xy_mirror_char;
-       currentpicture := currentpicture scaled -1;
-       currentpicture := currentpicture shifted (w,h);
-fet_endchar;
-
-fet_endgroup("number")
-
+end.
index f3f25459d83d6d986816014f3f96aaec04c78ece..1a802df0ddb7223202852c2883a47adc68aed895 100644 (file)
@@ -1,9 +1,10 @@
+
 % feta-nummer10.mf
 % part of LilyPond's pretty-but-neat music font
 
-size:=10;
+design_size:=10;
 
-input feta-nummer-generic;
+input feta-nummer;
 
 end.
 
index fe599fdbdc314471b0d749da3a6ccea746b967fc..315caebb4361a35c99bf2698311a03c53d5f531e 100644 (file)
@@ -1,9 +1,9 @@
 % feta-nummer10.mf
 % part of LilyPond's pretty-but-neat music font
 
-size:=12;
+design_size:=12;
 
-input feta-nummer-generic;
+input feta-nummer;
 
 end.
 
diff --git a/mf/feta-nummer14.mf b/mf/feta-nummer14.mf
new file mode 100644 (file)
index 0000000..dc966e6
--- /dev/null
@@ -0,0 +1,2 @@
+design_size := 14.4;
+input feta-nummer;
index d9c79640cb251cf107e8d57c8f5d06111e0d83f8..8ac70299c6717f5cb603eb664ab9312c7e4b19eb 100644 (file)
@@ -2,9 +2,9 @@
 % part of LilyPond's pretty-but-neat music font
 
 % size:=4;
-size:=16*3/15;
+design_size:=16*3/15;
 
-input feta-nummer-generic.mf;
+input feta-nummer.mf;
 
 end.
 
index efa2f9ac48078482aba88d2e9657768a4806a710..97b59333d3e7aeba0870f572e3b4f5c2c82654e7 100644 (file)
@@ -2,9 +2,9 @@
 % part of LilyPond's pretty-but-neat music font
 
 % size:=4;
-size:=16*4/15;
+design_size:=16*4/15;
 
-input feta-nummer-generic.mf;
+input feta-nummer.mf;
 
 end.
 
index 0a9fb3ffa36279167d17d0b491c7afc20ae96572..21c474f1a77fd9cd339f102061f92736b46291ab 100644 (file)
@@ -2,9 +2,9 @@
 % part of LilyPond's pretty-but-neat music font
 
 % size:=5;
-size:=20*4/15;
+design_size:=20*4/15;
 
-input feta-nummer-generic.mf;
+input feta-nummer.mf;
 
 end.
 
index 3daff78c4e4368810ae48781aa7f9bc01353c87b..fbda92971a7001a540a227a3c15ad8d2f0634c03 100644 (file)
@@ -2,9 +2,9 @@
 % part of LilyPond's pretty-but-neat music font
 
 % size:=5;
-size:=20*6/15;
+design_size:=20*6/15;
 
-input feta-nummer-generic.mf;
+input feta-nummer.mf;
 
 end.
 
index a098d0f62a5d76875070fdc77d52848b0d55a73a..fcc15d6b8f8215e77b9cb65d1a98681d74f73003 100644 (file)
@@ -2,9 +2,9 @@
 % part of LilyPond's pretty-but-neat music font
 
 % size:=5;
-size:=26*4/15;
+design_size:=26*4/15;
 
-input feta-nummer-generic.mf;
+input feta-nummer.mf;
 
 end.
 
index 874cb8f8a032c63a4e08cad2fb9bf1174a8c8d4a..d790057895043600559931a23298cf26d9dbc33f 100644 (file)
@@ -1,9 +1,7 @@
 % feta-nummer8.mf
 % part of LilyPond's pretty-but-neat music font
 
-size:=8;
+design_size:=8;
 
-input feta-nummer-generic.mf;
-
-end.
+input feta-nummer.mf;
 
index 7088dd1dabb12dd1cfa6a9b5496f3281a6473764..99f21eb25bd8218d76ed7ac433ecb5d5f73aec73 100644 (file)
   (define (volta h w thick vert_start vert_end)
     (embedded-ps ((ps-scm 'volta) h w thick vert_start vert_end)))
 
+  (define (define-origin file line col)
+    ; use this for column positions
+     (string-append "\\special{src:" (number->string line) ":"
+        (number->string col) " " file "}")
+
+     ; line numbers only:
+    ;(string-append "\\special{src:" (number->string line) " " file "}")
+)
+  ; no-origin not yet supported by Xdvi
+  (define (no-origin) "")
+  
   ;; TeX
   ;; The procedures listed below form the public interface of TeX-scm.
   ;; (should merge the 2 lists)
            (define text ,text)
            (define tuplet ,tuplet)
            (define volta ,volta)
+           (define define-origin ,define-origin)
+           (define no-origin ,no-origin)
            ))
 
        ((eq? action-name 'beam) beam)
     "\n unknown\n")
 
 
+  (define (define-origin a b c ) "")
+  (define (no-origin) "")
+  
   ;; PS
   (cond ((eq? action-name 'all-definitions)
         `(begin
            (define stop-line ,stop-line)
            (define stop-last-line ,stop-line)
            (define text ,text)
+           (define no-origin ,no-origin)
+           (define define-origin ,define-origin)
            ))
        ((eq? action-name 'tuplet) tuplet)
        ((eq? action-name 'beam) beam)