]> git.donarmstrong.com Git - lilypond.git/commitdiff
*** empty log message ***
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 17 Jul 2003 08:39:38 +0000 (08:39 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 17 Jul 2003 08:39:38 +0000 (08:39 +0000)
13 files changed:
ChangeLog
Documentation/topdocs/INSTALL.texi
configure.in
lily/cluster-engraver.cc
lily/cluster.cc
lily/translator-scheme.cc
ly/engraver-init.ly
ly/spanners-init.ly
scm/define-grob-interfaces.scm
scm/define-grobs.scm
scm/define-music-types.scm
scm/music-functions.scm
scripts/update-lily.py

index 640b5b385244df19e4c60a152e912b0877fd5717..466d64f5df1c8ee70f513da9ad55be7597dce87a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,6 +19,9 @@
 
 2003-07-17  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
+       * lily/translator-scheme.cc (LY_DEFINE): bugfix: always return
+       something.
+
        * make/lilypond.redhat.spec.in (Group): change ftp.cs.uu.nl to
        ftp.lilypond.org everywhere.
 
index 691dfbac45291a19f86675e9b2d6408e2276d8f5..136076112f917bf40ea0faa17bfe6a42d895d424 100644 (file)
@@ -364,12 +364,10 @@ augroup
 
 @subsection Red Hat Linux
 
-Red Hat 7.x i386 RPMS are available from
-@uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/binaries/}.  For running on
-a Red Hat system you need these packages: guile, tetex, tetex-latex,
-tetex-dvips, libstdc++, python, ghostscript.
 
-You can also compile them yourself.  A spec file is in
+You can compile RPMS yourself.  For running on a Red Hat system you
+need these packages: guile, tetex, tetex-latex, tetex-dvips,
+libstdc++, python, ghostscript.  A spec file is in
 @file{make/out/lilypond.redhat.spec}. This file is distributed along
 with the sources.  You can make the rpm by issuing
 @example 
@@ -386,16 +384,6 @@ addition to the those needed for running: glibc-devel, gcc-c++,
 libstdc++-devel, guile-devel, flex, bison, texinfo, groff, mftrace,
 netpbm-progs, autotrace, t1utils.
 
-
-
-@subsection LinuxPPC
-
-
-Some LinuxPPC RPMS should available from
-@uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/binaries/}.
-
-A LinuxPPC RPM can be made using the @file{lilypond.redhat.spec} file.
-
 @subsection SuSE
 
 Some SUSE RPMS should available from
index 8dd486c886848f477a3ead6e52ad419b58c9e0ce..f70ea752a8f26c037ba0232c50dddd07dc2eee91 100644 (file)
@@ -12,9 +12,8 @@ AC_CONFIG_AUX_DIR([stepmake/bin])
 STEPMAKE_INIT
 
 # List a file that identifies your package.
-## huh, lsm.in silently [re]moved?
-##AC_CONFIG_SRCDIR([make/lilypond.lsm.in])
 AC_CONFIG_SRCDIR([lily/main.cc])
+
 # Move to aclocal.m4?
 AC_CONFIG_HEADER([$CONFIGFILE.h:config.hh.in])
 
index 1263763f4b90edfde5a88fc7a3a4bdd339abeb05..92162413191e13c4ceca3be5a2f22f58039c566a 100644 (file)
 #include "note-column.hh"
 #include "group-interface.hh"
 
-class Cluster_engraver : public Engraver
+class Cluster_spanner_engraver : public Engraver
 {
 
 protected:
-TRANSLATOR_DECLARATIONS(Cluster_engraver);
+  TRANSLATOR_DECLARATIONS(Cluster_spanner_engraver);
   virtual bool try_music (Music *);
   virtual void process_music ();  
   virtual void acknowledge_grob (Grob_info);
   virtual void stop_translation_timestep ();
-
+  virtual void finalize ();
 private:
-  Drul_array<Music*> reqs_drul_;
+  Link_array<Music> cluster_notes_;
+  Item* beacon_;
 
-  Spanner *cluster_;
+  void typeset_grobs ();
+  Spanner *spanner_;
+  Spanner * finished_spanner_ ;
 };
 
-Cluster_engraver::Cluster_engraver ()
+Cluster_spanner_engraver::Cluster_spanner_engraver ()
+{
+  spanner_ = 0;
+  finished_spanner_ = 0;
+  beacon_ = 0;
+}
+
+void
+Cluster_spanner_engraver::finalize ()
 {
-  cluster_ = 0;
-  reqs_drul_[LEFT] = reqs_drul_[RIGHT] = 0;
+  typeset_grobs ();
+  finished_spanner_ = spanner_;
+  spanner_ = 0;
+  typeset_grobs ();
+}
+
+void
+Cluster_spanner_engraver::typeset_grobs ()
+{
+  if (finished_spanner_ )
+    {
+      typeset_grob (finished_spanner_);
+      finished_spanner_ = 0;
+    }
+
+  if (beacon_)
+    {
+      typeset_grob (beacon_);
+      beacon_ = 0;
+    }
 }
 
 bool
-Cluster_engraver::try_music (Music *m)
+Cluster_spanner_engraver::try_music (Music *m)
 {
   if (m->is_mus_type ("abort-event"))
     {
-      reqs_drul_[START] = 0;
-      reqs_drul_[STOP] = 0;
-      if (cluster_)
+      if (spanner_)
        {
-         cluster_->suicide ();
-         cluster_ = 0;
+         spanner_->suicide ();
+         spanner_ = 0;
        }
     }
-  else if (m->is_mus_type ("cluster-event"))
+  else if (m->is_mus_type ("cluster-note-event"))
     {
-      Direction d = to_dir (m->get_mus_property ("span-direction"));
-
-      reqs_drul_[d] = m;
+      cluster_notes_.push (m);
       return true;
     }
   return false;
 }
 
 void
-Cluster_engraver::process_music ()
+Cluster_spanner_engraver::process_music ()
 {
-  if (reqs_drul_[STOP])
+  if (cluster_notes_.size())
     {
-      if (!cluster_)
-       {
-         reqs_drul_[STOP]->origin ()->warning ("can't find start of cluster");
-       }
-      else
+      SCM c0scm = get_property ("centralCPosition");
+
+      int c0 =  gh_number_p (c0scm) ? gh_scm2int (c0scm) : 0;
+      int pmax = INT_MIN;
+      int pmin = INT_MAX;
+      
+      for (int i = 0; i <cluster_notes_.size (); i++)
        {
-         Grob *bound = unsmob_grob (get_property ("currentMusicalColumn"));
-         cluster_->set_bound (RIGHT, bound);
+         Pitch *pit =unsmob_pitch (cluster_notes_[i]->get_mus_property ("pitch"));
+
+         int p =( pit ? pit->steps () : 0) + c0;
+
+         pmax = pmax >? p;
+         pmin = pmin <? p;
        }
+      
+      Item *it = new Item (get_property ("ClusterSpannerBeacon"));
+      it->set_grob_property ("positions", scm_cons (gh_int2scm (pmin),
+                                                  gh_int2scm (pmax)));
+      
+    }
+
+  if (beacon_ && !spanner_)
+    {    
+      spanner_ = new Spanner (get_property ("Cluster"));
+      announce_grob (spanner_, cluster_notes_[0]->self_scm ());
     }
-  if (reqs_drul_[START])
+  
+  if (beacon_ && spanner_)
     {
-      if (cluster_)
-       {
-         reqs_drul_[START]->origin ()->warning ("may not nest clusters");
-       }
-      else
-       {
-         cluster_ = new Spanner (get_property ("Cluster"));
-         Grob *bound = unsmob_grob (get_property ("currentMusicalColumn"));
-         cluster_->set_bound (LEFT, bound);
-         announce_grob (cluster_, reqs_drul_[START]->self_scm ());
-       }
-      reqs_drul_[START] = 0;
+      add_bound_item (spanner_, beacon_);
+      Pointer_group_interface::add_grob (spanner_, ly_symbol2scm ("columns"), beacon_);
     }
 }
 
 
 void
-Cluster_engraver::stop_translation_timestep ()
+Cluster_spanner_engraver::stop_translation_timestep ()
 {
-  if (reqs_drul_[STOP])
-    {
-      reqs_drul_[STOP] = 0;
-      typeset_grob (cluster_);
-      cluster_ = 0;
-    }
+  typeset_grobs ();
+
+  cluster_notes_.clear();
+  
 }
 
 void
-Cluster_engraver::acknowledge_grob (Grob_info info)
+Cluster_spanner_engraver::acknowledge_grob (Grob_info info)
 {
-  if (cluster_ && Note_column::has_interface (info.grob_))
+  if (!beacon_ && Note_column::has_interface (info.grob_))
     {
-      Pointer_group_interface::add_grob (cluster_, ly_symbol2scm ("columns"), info.grob_);
+      finished_spanner_ = spanner_;
+      spanner_ = 0;
     }
 }
 
-ENTER_DESCRIPTION(Cluster_engraver,
-/* descr */    "engraves a cluster",
+ENTER_DESCRIPTION(Cluster_spanner_engraver,
+/* descr */    "Engraves a cluster using Spanner notation ",
 /* creats*/    "Cluster",
-/* accepts */  "cluster-event",
+/* accepts */  "cluster-note-event abort-event",
 /* acks  */    "note-column-interface",
 /* reads */    "",
 /* write */    "");
index 75346dbbac244ae18a4cd0adf09745362ee075ca..c86adfdd84cc90209ac56363368e68ef0083fc7d 100644 (file)
@@ -147,6 +147,7 @@ Cluster::brew_molecule (SCM smob)
 
   Grob *common = left_bound->common_refpoint (right_bound, X_AXIS);
   SCM cols  =me->get_grob_property ("columns");
+
   if (!gh_pair_p (cols))
     {
       me->warning ("junking empty cluster");
@@ -164,10 +165,15 @@ Cluster::brew_molecule (SCM smob)
   for (SCM s = cols; gh_pair_p (s); s = ly_cdr (s))
     {
       Grob * col = unsmob_grob (ly_car (s));
-      Slice s = Note_column::head_positions_interval (col);
-      Grob * h = Note_column::first_head (col);
 
-      Real x = h->relative_coordinate (common, X_AXIS) - left_coord;
+      SCM posns = col->get_grob_property ("positions");
+      
+      Slice s (0,0);
+      if (ly_number_pair_p (posns))
+       s = Slice (gh_scm2int (gh_car (posns)),
+                  gh_scm2int (gh_cdr (posns)));
+
+      Real x = col->relative_coordinate (common, X_AXIS) - left_coord;
       bottom_points.push (Offset (x, s[DOWN] *0.5));
       top_points.push (Offset (x, s[UP] * 0.5));
     }
@@ -186,7 +192,13 @@ Cluster::brew_molecule (SCM smob)
          if (gh_pair_p (cols))
            {
              Grob * col = unsmob_grob (ly_car (scm_last_pair (cols)));
-             Slice s = Note_column::head_positions_interval (col);
+             SCM posns = col->get_grob_property ("positions");
+      
+             Slice s (0,0);
+             if (ly_number_pair_p (posns))
+               s = Slice (gh_scm2int (gh_car (posns)),
+                          gh_scm2int (gh_cdr (posns)));
+
              Real x = right_bound->relative_coordinate (common,X_AXIS) - left_coord;
              
              bottom_points.insert (Offset (x, s[DOWN] * 0.5),0);
index da08478faed95ea0725b5535d4547878874b11d1..ad894342dee1ac3924d11f553e088d99c4ea02cb 100644 (file)
@@ -56,8 +56,11 @@ LY_DEFINE(ly_context_property_where_defined,
 
 
   tr = tr->where_defined (name);
+
   if (tr)
-    return tr?  tr->self_scm():  SCM_EOL;
+    return tr->self_scm();
+
+  return SCM_EOL;
 }
 
 LY_DEFINE(ly_unset_context_property,
index a0039f92d2ff5e502fd756c83443cc1f2768b252..69b3ce840c099dc7bc440d814236fa804c4324a3 100644 (file)
@@ -186,7 +186,7 @@ VoiceContext = \translator {
        \consists "Script_column_engraver"
        \consists "Rhythmic_column_engraver"
        \consists "Phrasing_slur_engraver"
-       \consists "Cluster_engraver"
+       \consists "Cluster_spanner_engraver"
        \consists "Slur_engraver"
        \consists "Tie_engraver"
        \consists "New_tie_engraver"
index 08fe9534a7198b78ad660346063811b4b8c44b9c..1c448e450741e317fd0a2a3cceaa017540cda2ca 100644 (file)
@@ -1,8 +1,5 @@
 \version "1.7.18"
 
-startCluster = #(make-span-event 'ClusterEvent START)
-stopCluster = #(make-span-event 'ClusterEvent STOP)
-
 startGroup = #(make-span-event 'NoteGroupingEvent START)
 stopGroup = #(make-span-event 'NoteGroupingEvent STOP)
 
index 25370f169afd30e4520e0a798450830aa8808258..dbc2cf4ed88bdac0efccdd1b29bf1c2e043512c7 100644 (file)
  "Note name"
  '(style))
 
+
+(ly:add-interface
+ 'cluster-beacon-interface
+
+ "A place holder for the cluster spanner to determine the vertical
+extents of a cluster spanner at this X position.
+
+ "
+ '(positions)
+ )
+
 (ly:add-interface
  'dynamic-interface
    "Any kind of loudness sign"
  '()
  )
 
-(ly:add-interface
- 'rhythmic-grob-interface
- "Any object with a rhythmic basis. Used to determine which grobs 
-are interesting enough to maintain a hara-kiri staff."
- '()
- )
-
 (ly:add-interface
  'ligature-interface
  "A ligature"
@@ -55,6 +59,12 @@ are interesting enough to maintain a hara-kiri staff."
  '(
    ))
 
+(ly:add-interface
+ 'rhythmic-grob-interface
+ "Any object with a rhythmic basis. Used to determine which grobs 
+are interesting enough to maintain a hara-kiri staff."
+ '()
+ )
 ;;; todo: this is not typesetting info. Move to interpretation.
 (ly:add-interface
  'tablature-interface
index 0532220a1b86d0beb4f8bbbf7df29ba6c566f77b..b893f3b1d647f3a49651ba16a893772518c41297 100644 (file)
        (Y-offset-callbacks  . (,Staff_symbol_referencer::callback)) 
        (meta . ((interfaces . (clef-interface staff-symbol-referencer-interface font-interface break-aligned-interface item-interface ))))
        ))
-
+    
+    (ClusterSpannerBeacon
+     . (
+       (molecule-callback . #f)
+       (meta . ((interfaces . (cluster-beacon-interface item-interface))))
+       ))
+    
     (Cluster
      . (
        (molecule-callback . ,Cluster::brew_molecule)
index d0fdce20c8b4a0a97e80c1cb3dd64d41838da019..1ff1c129ba75092debc63894aba8ab1d70ab0d7e 100644 (file)
@@ -120,12 +120,12 @@ c8-[ c c-] c8")
        (internal-class-name . "Event")
        (types . (general-music event busy-playing-event))
        )) 
-    (ClusterEvent
+    (ClusterNoteEvent
      . (
-       (description .  "Begins or ends a cluster.")
+       (description .  "A note that is part of a cluster.")
        (internal-class-name . "Event")
-       (types . (general-music cluster-event span-event event))
-       )) 
+       (types . (general-music note-event cluster-note-event melodic-event rhythmic-event event))
+       ))
     (ContextSpeccedMusic
      . (
        (description .  "Interpret the argument music within a specific context.")
index 8bffc5e52f35dcb6eb870cad5ee23556a2f56ae8..67056ef8597cab9769624ac3d35ef911a767e0b3 100644 (file)
@@ -46,7 +46,6 @@
 
 
 
-  
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (define (shift-one-duration-log music shift dot)
             music))
   
 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; clusters.
+
+(define-public (note-to-cluster music)
+  "Replace NoteEvents by ClusterNoteEvents."
+  (if (eq? (ly:get-mus-property music 'name) 'NoteEvent)
+      (let* ((cn (make-music-by-name 'ClusterNoteEvent)))
+
+            (ly:set-mus-property! cn 'pitch (ly:get-mus-property music 'pitch))
+            (ly:set-mus-property! cn 'duration (ly:get-mus-property music 'duration))
+            cn)
+      music))
 
+(define-public (notes-to-cluster music)
+  (music-map note-to-cluster music))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; repeats.
index d90bc62c37bf1d9fac52a65c12d5fe91202b25a7..3030205055d06416717421905f1769b20848124d 100644 (file)
@@ -44,9 +44,9 @@ keep_temp_dir_p = 0
 verbose_p = 0
 remove_previous_p = 0
 
-url = 'file:/home/ftp/pub/gnu/LilyPond/development/lilypond-*.tar.gz'
-url = 'ftp://appel.lilypond.org/pub/gnu/LilyPond/development/lilypond-*.tar.gz'
-url = 'ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/development/lilypond-*.tar.gz'
+#url = 'file:/home/ftp/pub/gnu/LilyPond/development/lilypond-*.tar.gz'
+# url = 'ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/development/lilypond-*.tar.gz'
+url = 'ftp://ftp.lilypond.org/pub/LilyPond/development/lilypond-*.tar.gz'
 
 
 build_root = os.path.join (os.environ ['HOME'], 'usr', 'src')