]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.1.38.jcn1: Cons
authorJan Nieuwenhuizen <janneke@gnu.org>
Wed, 7 Apr 1999 22:48:49 +0000 (01:48 +0300)
committerJan Nieuwenhuizen <janneke@gnu.org>
Wed, 7 Apr 1999 22:48:49 +0000 (01:48 +0300)
28 files changed:
VERSION
flower/include/cons.hh
flower/include/killing-cons.tcc
lib/source.cc
lily/midi-item.cc
lily/molecule.cc
lily/music-list.cc
lily/music-sequence.cc
lily/paper-outputter.cc
lily/performance.cc
lily/repeat-engraver.cc
lily/request-iterator.cc
lily/sequential-music-iterator.cc
lily/simultaneous-music-iterator.cc
lily/spring-spacer.cc
lily/translator-group.cc
mi2mu/include/midi-track-parser.hh
mi2mu/include/mudela-column.hh
mi2mu/include/mudela-item.hh
mi2mu/include/mudela-score.hh
mi2mu/include/mudela-staff.hh
mi2mu/include/mudela-voice.hh
mi2mu/midi-track-parser.cc
mi2mu/mudela-column.cc
mi2mu/mudela-score.cc
mi2mu/mudela-staff.cc
mi2mu/mudela-voice.cc
mi2mu/template9.cc

diff --git a/VERSION b/VERSION
index cf74e47cf8e8be71e2f97c2768401c803f8380c8..1aa2572085e4d8c0a972031add9ebc9aa5d254c3 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=1
 PATCH_LEVEL=38
-MY_PATCH_LEVEL=uu1
+MY_PATCH_LEVEL=jcn1
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
index 6e62c4c865b97cec07ba92663c2e156928cc15cf..1d59e98ec08d422e07485d88ddb41a1e8b7d6e50 100644 (file)
 #ifndef CONS_HH
 #define CONS_HH
 
+#include <assert.h>
+#define TAIL
 
 template<class T>
 class Cons
 {
 public:
-  T * car_;
-  Cons * next_;
+  T * car_p_;
+  Cons * next_cons_p_;
   Cons ()
     {
-      car_=0;
-      next_ =0;
+      car_p_=0;
+      next_cons_p_ =0;
     }
   Cons (T*t, Cons<T>*c)
     {
-      car_ = t;
-      next_ = c;
+      car_p_ = t;
+      next_cons_p_ = c;
     }
  virtual ~Cons ()
     {
-      delete next_;
+      delete next_cons_p_;
     }
 };
 
@@ -47,55 +49,146 @@ public:
 
 /// remove the link pointed to by *p.
 template<class T>
-Cons<T> *remove_cons (Cons<T> **pp)
+Cons<T> *remove_cons_p (Cons<T> **pp)
 {
   Cons<T> *knip = *pp;
-  *pp = (*pp)->next_;
-  knip->next_ = 0;
+  *pp = (*pp)->next_cons_p_;
+  knip->next_cons_p_ = 0;
   return knip;
 }
 
+
+template<class T> int cons_list_size_i (Cons<T> *l)
+{
+  int i=0;
+  while  (l)
+    {
+      l = l->next_cons_p_;
+       i++;
+    }
+  return i;
+}
+
 /**
 
    Invariants:
 
-   (*tail_) is either the head_ pointer, or a next_ pointer from the list.
+   (*loose_cons_p_p_) is either the head_cons_p_ pointer, or a next_cons_p_ pointer from the list.
    
-   **tail_ == NULL
+   **loose_cons_p_p_ == NULL
  */
 
 template<class T>
 class Cons_list
 {
+#ifdef TAIL
+private:
+  // find tail helper; is this handy?
+  Cons<T> * tail_cons_l_;
+#endif
+  
 public:
-  Cons<T> * head_;
-  Cons<T> ** tail_;
-  Cons_list () { init_list (); }
-  void init_list () {head_ =0; tail_ = &head_; }
+  // make these private?
+  Cons<T> * head_cons_p_;
+  Cons<T> ** loose_cons_p_p_;
+
+
+  Cons_list ()
+    {
+      init ();
+    }
+  void init ()
+    {
+      head_cons_p_ = 0;
+      loose_cons_p_p_ = &head_cons_p_;
+#ifdef TAIL
+      tail_cons_l_ = 0;
+#endif
+    }
   void append (Cons<T> *c)
     {
-      assert (!c->next_);
-      *tail_ = c;
-      while (*tail_)
-       tail_ = &(*tail_)->next_;
+      assert (!c->next_cons_p_);
+#ifndef TAIL
+      *loose_cons_p_p_ = c;
+      while (*loose_cons_p_p_)
+       loose_cons_p_p_ = &(*loose_cons_p_p_)->next_cons_p_;
+#else
+      *loose_cons_p_p_ = c;
+      tail_cons_l_ = *loose_cons_p_p_;
+      while (tail_cons_l_->next_cons_p_)
+       tail_cons_l_ = tail_cons_l_->next_cons_p_;
+      loose_cons_p_p_ = &tail_cons_l_->next_cons_p_;
+#endif
+    }
+  Cons<T>* tail_cons_l ()
+    {
+      assert (!empty_b ());
+#ifndef TAIL
+      Cons<T>* tail_cons_l = head_cons_p_;
+      while (tail_cons_l->next_cons_p_)
+       tail_cons_l = tail_cons_l->next_cons_p_;
+      return tail_cons_l;
+#else
+      return tail_cons_l_;
+#endif
     }
   /**
-     PRE: *pp should either be the head_ pointer, or the next_ pointer
-     from a list cell.
+     PRE: *pp should either be the head_cons_p_ pointer,
+     or the next_cons_p_ pointer from a list cell.
   */
-  Cons<T> *remove_cons (Cons<T> **pp)
+  Cons<T> *remove_cons_p (Cons<T> **pp)
     {
-      if (&(*pp)->next_ == tail_)
-       tail_ = pp;
-
-      return ::remove_cons (pp);
+#ifndef TAIL
+      if (&(*pp)->next_cons_p_ == loose_cons_p_p_)
+       loose_cons_p_p_ = pp;
+#else
+      if (*pp == tail_cons_l_)
+       {
+         //either here
+         tail_cons_l_ = tail_cons_l ();
+         loose_cons_p_p_ = pp;
+       }
+#endif
+
+      return ::remove_cons_p (pp);
+    }
+  bool empty_b ()
+    {
+      return !head_cons_p_;
+    }
+  int size_i ()
+    {
+      return cons_list_size_i (head_cons_p_);
+    }
+  T* head_car_l ()
+    {
+      assert (!empty_b ());
+      return head_cons_p_->car_p_;
+    }
+  T* car_l ()
+    {
+      assert (!empty_b ());
+      return head_cons_p_->car_p_;
+    }
+  T* tail_car_l ()
+    {
+      assert (!empty_b ());
+      // or here?
+#ifndef TAIL
+      return tail_cons_l ()->car_p_;
+#else
+      return tail_cons_l_->car_p_;
+#endif
     }
   void junk ()
     {
-      delete head_;
-      head_ =0;
+      delete head_cons_p_;
+      init ();
+    }
+  ~Cons_list ()
+    {
+      junk ();
     }
-  ~Cons_list () { junk (); }
 };
 
 
@@ -105,19 +198,6 @@ template<class T>
 void
 clone_killing_cons_list (Cons_list<T>&, Cons<T> *src);
 
-template<class T> int cons_list_size_i (Cons<T> *l)
-{
-  int i=0;
-  while  (l)
-    {
-      l = l->next_;
-       i++;
-    }
-  return i;
-}
-
-
-
 
 #endif /* CONS_HH */
 
index f6fcff7bd1946959e820a066b97ab2b5cb01cdd9..8c6c04e9983b3b731ae7558132b63d6ab591f161 100644 (file)
 template<class T>
 Killing_cons<T>::~Killing_cons ()
 {
-  delete car_;
+  delete car_p_;
 }
 
 template<class T>
 void 
 copy_killing_cons_list (Cons_list<T> &dest, Cons<T> *src) 
 {
-  for (; src; src  = src->next_)
+  for (; src; src  = src->next_cons_p_)
     {
-      T *t = new T(*src->car_);
+      T *t = new T(*src->car_p_);
       dest.append ( new Killing_cons<T> (t, 0));
     }
 }
@@ -33,9 +33,9 @@ template<class T>
 void
 clone_killing_cons_list (Cons_list<T> & dest, Cons<T> *src)
 {
-  for (; src; src  = src->next_)
+  for (; src; src  = src->next_cons_p_)
     {
-      T *t = src->car_->clone ();
+      T *t = src->car_p_->clone ();
       dest.append (new Killing_cons<T> (t, 0));      
     }
 }
index 66372945de4cc60ac2e7f8f47049828b83a4bdcc..850b32ec0b8cab0af57a65cf2286ecb595d84bb4 100644 (file)
@@ -73,9 +73,9 @@ Source_file*
 Sources::sourcefile_l (char const* ch_C)
 {
 
-  for (Cons<Source_file> *i = sourcefile_p_list_; i; i = i->next_)
-    if (i->car_->in_b (ch_C))  
-      return i->car_;
+  for (Cons<Source_file> *i = sourcefile_p_list_; i; i = i->next_cons_p_)
+    if (i->car_p_->in_b (ch_C))        
+      return i->car_p_;
   return 0;
 }
 
index ccb0a5ae90bef25ddb078e5c8b4d2105a9309c74..e52027345cc4c28ec05abbba568f231fbbb9b357 100644 (file)
@@ -552,9 +552,9 @@ Midi_track::data_str () const
   String str = Midi_chunk::data_str ();
   if (check_debug && !monitor->silent_b ("Midistrings"))
     str += "\n";
-  for (Cons<Midi_event> *i=event_p_list_.head_; i; i = i->next_) 
+  for (Cons<Midi_event>* i = event_p_list_.head_cons_p_; i; i = i->next_cons_p_) 
     {
-      str += i->car_->str ();
+      str += i->car_p_->str ();
       if (check_debug && !monitor->silent_b ("Midistrings"))
         str += "\n";
     }
index 33ff2188335792d8af0430122b935adf09da8122..f8743948803e1f0d3ec6b851ab08990693c520c5 100644 (file)
 #define UNBOX_PTR(a) SCM_CAR(a)
 #else
 #define MOL_EOL 0
-#define NEXT_CELL(a) ptr->next_
+#define NEXT_CELL(a) ptr->next_cons_p_
 #define CELLTYPE Cons<Atom>*
 #define UNBOX_ATOM(a) a
-#define UNBOX_PTR(a) a->car_
+#define UNBOX_PTR(a) a->car_p_
 #define BOX_ATOM(a) a
 #define NEWCELL(a,b) new Killing_cons<Atom>(a,b)
 #endif
index 0324d8af6c5207acef113262841365fe03c9bd63..a17fad69cf5a7b62fe22248f51380fc0b26ba6e0 100644 (file)
@@ -17,8 +17,8 @@ Moment
 Simultaneous_music::length_mom () const
 {
   Moment dur = 0;
-  for (Cons<Music> *i = music_p_list_p_->head_; i;  i = i->next_)
-    dur = dur >? i->car_->length_mom ();
+  for (Cons<Music> *i = music_p_list_p_->head_cons_p_; i;  i = i->next_cons_p_)
+    dur = dur >? i->car_p_->length_mom ();
 
   return dur;
 }
@@ -27,8 +27,8 @@ void
 Music_sequence::compress (Moment m)
 {
   
-  for (Cons<Music> *i = music_p_list_p_->head_; i;  i = i->next_)
-    i->car_->compress (m);
+  for (Cons<Music> *i = music_p_list_p_->head_cons_p_; i;  i = i->next_cons_p_)
+    i->car_p_->compress (m);
 }
 
 Simultaneous_music::Simultaneous_music(Music_list *p)
@@ -46,9 +46,9 @@ Moment
 Sequential_music::length_mom () const
 {
   Moment last=0;
-  for (Cons<Music> *i = music_p_list_p_->head_; i;  i = i->next_)
+  for (Cons<Music> *i = music_p_list_p_->head_cons_p_; i;  i = i->next_cons_p_)
     {
-      last += i->car_->length_mom ();
+      last += i->car_p_->length_mom ();
     }
   return  last;
 }
@@ -76,9 +76,9 @@ 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_)
+  for (Cons<Music> *i = head_cons_p_; i ; i = i->next_cons_p_)
     {
-      last = i->car_->to_relative_octave (last);
+      last = i->car_p_->to_relative_octave (last);
       if (!count ++ )
        retval = last;
     }
@@ -93,8 +93,8 @@ Music_list::do_relative_octave (Musical_pitch last, bool ret_first)
 Music_list::Music_list (Music_list const &s)
   : Cons_list<Music> (s)
 {
-  init_list ();
-  clone_killing_cons_list (*this, s.head_);
+  init ();
+  clone_killing_cons_list (*this, s.head_cons_p_);
 }
 
 
@@ -116,9 +116,9 @@ Request_chord::Request_chord()
 Musical_pitch
 Request_chord::to_relative_octave (Musical_pitch last)
 {
-  for (Cons<Music> *i = music_p_list_p_->head_; i ; i = i->next_)
+  for (Cons<Music> *i = music_p_list_p_->head_cons_p_; i ; i = i->next_cons_p_)
     {
-      if (Melodic_req *m= dynamic_cast <Melodic_req *> (i->car_))
+      if (Melodic_req *m= dynamic_cast <Melodic_req *> (i->car_p_))
        {
          Musical_pitch &pit = m->pitch_;
          pit.to_relative_octave (last);
index 6f50bd56b7471dcb02d0fc5294be996a14c78e3f..52ed3fecce83e604c9b6ddfdbc61785fac61977c 100644 (file)
@@ -26,16 +26,16 @@ Music_sequence::Music_sequence(Music_list *mlist_p)
 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 (Cons<Music> *i = music_p_list_p_->head_cons_p_; i;  i = i->next_cons_p_)
+    i->car_p_->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 (Cons<Music> *i = music_p_list_p_->head_cons_p_; i;  i = i->next_cons_p_)  
+    i->car_p_->print();
 #endif 
 }
 
index 308c07734d1b784cf41961abbb4df748c5d59c0c..5a46415e69018d5da60ea74030c430c2d34fbb3d 100644 (file)
@@ -99,9 +99,9 @@ Paper_outputter::output_molecule (Molecule const*m, Offset o, char const *nm)
     {
       Atom *i = Atom::atom_l (SCM_CAR(ptr));
 #else
-  for (Cons<Atom> *ptr = m->atom_list_; ptr; ptr = ptr->next_)
+  for (Cons<Atom> *ptr = m->atom_list_; ptr; ptr = ptr->next_cons_p_)
     {
-      Atom * i = ptr->car_;
+      Atom * i = ptr->car_p_;
 #endif
       Offset a_off = i->off_;
       a_off += o;
index f25b63eea11c5d25175cb7bb27007667938f3202..c9b1909b25c99814748e6af5045d0fd64d7f053f 100644 (file)
@@ -125,8 +125,8 @@ Performance::print() const
 #ifndef NPRINT
   DOUT << "Performance { ";
   DOUT << "Items: ";
-  for (Cons<Audio_element>* i =audio_elem_p_list_; i; i = i->next_)
-    i->car_->print ();
+  for (Cons<Audio_element>* i =audio_elem_p_list_; i; i = i->next_cons_p_)
+    i->car_p_->print ();
   DOUT << "}";
 #endif
 }
index 8a3cbdf59724680c5564c48e0c1a5f466a797983..06a033696c4b4d4574e66955aa6551b598a245e2 100644 (file)
@@ -45,9 +45,9 @@ Repeat_engraver::do_try_music (Music* m)
       Moment alt_mom = now_mom () + repeat_length_mom;
       if (repeat_length_mom)
        {
-         for (Cons<Music> *i (alt->music_p_list_p_->head_); i && i->next_; i = i->next_)
+         for (Cons<Music> *i (alt->music_p_list_p_->head_cons_p_); i && i->next_cons_p_; i = i->next_cons_p_)
            {
-             stop_mom += i->car_->length_mom ();
+             stop_mom += i->car_p_->length_mom ();
              if (dynamic_cast<Simultaneous_music *> (alt))
                break;
            }
@@ -71,23 +71,23 @@ Repeat_engraver::do_try_music (Music* m)
       if (prop.length_i ())
        span_mom = prop.to_rat ();
 
-      int alt_i = r->repeats_i_ + 1 - cons_list_size_i (alt->music_p_list_p_->head_ ) >? 1;
-      for (Cons<Music> *i = alt->music_p_list_p_->head_; i ; i = i->next_)
+      int alt_i = r->repeats_i_ + 1 - cons_list_size_i (alt->music_p_list_p_->head_cons_p_ ) >? 1;
+      for (Cons<Music> *i = alt->music_p_list_p_->head_cons_p_; i ; i = i->next_cons_p_)
         {
-         alternative_music_arr_.push (i->car_);
+         alternative_music_arr_.push (i->car_p_);
          alternative_start_mom_arr_.push (alt_mom);
          if (span_mom)
            alternative_stop_mom_arr_.push (alt_mom + span_mom);
          else
-           alternative_stop_mom_arr_.push (alt_mom + i->car_->length_mom ());
+           alternative_stop_mom_arr_.push (alt_mom + i->car_p_->length_mom ());
          String str;
-         if ((alt_i != 1) && (alt_i != r->repeats_i_) && (i == alt->music_p_list_p_->head_))
+         if ((alt_i != 1) && (alt_i != r->repeats_i_) && (i == alt->music_p_list_p_->head_cons_p_))
            str = "1.-";
          str += to_str (alt_i) + ".";
          alt_i++;
          alternative_str_arr_.push (str);
          if (!dynamic_cast<Simultaneous_music *> (alt))
-           alt_mom += i->car_->length_mom ();
+           alt_mom += i->car_p_->length_mom ();
        }
       return true;
     }
index ca103ee062132c131563a3ef012a7c02301d67a1..0aacb6ce0420f28edbb3b74072e77ea9f58cba75 100644 (file)
@@ -63,17 +63,17 @@ 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 (Cons<Music> *i = elt_l ()->music_p_list_p_->head_cons_p_; i; i = i->next_cons_p_)
        {
-         if (Request * req_l = dynamic_cast<Request*> (i->car_))
+         if (Request * req_l = dynamic_cast<Request*> (i->car_p_))
            {
              bool gotcha = report_to_l()->try_music (req_l);
              if (!gotcha)
                req_l->warning (_f ("junking request: `%s\'", classname( req_l)));
            }
          else
-           i->car_->warning (_f ("Huh? Not a Request: `%s\'",
-                                  classname (i->car_)));
+           i->car_p_->warning (_f ("Huh? Not a Request: `%s\'",
+                                  classname (i->car_p_)));
        }
       first_b_ = false;
     }
index b1a9ab61987cba7f4b72ee9b1a61f0f2a5f54277..3a32f9b0a6bfe152d11a053bc73505fcf467e3f4 100644 (file)
@@ -28,7 +28,7 @@ Sequential_music_iterator::Sequential_music_iterator ()
 void
 Sequential_music_iterator::construct_children()
 {
-  cursor_ = dynamic_cast<Sequential_music const*> (music_l_)->music_p_list_p_->head_;
+  cursor_ = dynamic_cast<Sequential_music const*> (music_l_)->music_p_list_p_->head_cons_p_;
   
   while (cursor_)
     {
@@ -50,16 +50,16 @@ Sequential_music_iterator::leave_element()
 {
   delete iter_p_;
   iter_p_ =0;
-  Moment elt_time = cursor_->car_->length_mom ();
+  Moment elt_time = cursor_->car_p_->length_mom ();
   here_mom_ += elt_time;
-  cursor_ =cursor_->next_;
+  cursor_ =cursor_->next_cons_p_;
 }
 
 void
 Sequential_music_iterator::start_next_element()
 {
   assert (!iter_p_);
-  iter_p_ = get_iterator_p (cursor_->car_);
+  iter_p_ = get_iterator_p (cursor_->car_p_);
 }
 
 void
index b83e5eaee85f38ecf78ef96af66a279baeeb732a..8872bd1ebe5341b89a774e1c15a5d4d38321f628 100644 (file)
@@ -27,9 +27,9 @@ Simultaneous_music_iterator::construct_children()
   int j = 0;
   Simultaneous_music const *sim = dynamic_cast<Simultaneous_music const*> (music_l_);
 
-  for (Cons<Music> *i = sim->music_p_list_p_->head_; i;  i = i->next_, j++)
+  for (Cons<Music> *i = sim->music_p_list_p_->head_cons_p_; i;  i = i->next_cons_p_, j++)
     {
-      Music_iterator * mi = get_iterator_p (i->car_);
+      Music_iterator * mi = get_iterator_p (i->car_p_);
       if (mi->ok()) 
        {
          if  (sim->translator_type_str_.empty_b ())
@@ -46,25 +46,25 @@ void
 Simultaneous_music_iterator::do_print() const
 {
 #ifndef NPRINT
-  for (Cons<Music_iterator> *p = children_p_list_.head_; p; p = p->next_)
-    p->car_->print();
+  for (Cons<Music_iterator> *p = children_p_list_.head_cons_p_; p; p = p->next_cons_p_)
+    p->car_p_->print();
 #endif
 }
 
 void
 Simultaneous_music_iterator::do_process_and_next (Moment until)
 {
-  for (Cons<Music_iterator> **pp = &children_p_list_.head_; *pp; )
+  for (Cons<Music_iterator> **pp = &children_p_list_.head_cons_p_; *pp; )
     {
-      Music_iterator * i = (*pp)->car_;
+      Music_iterator * i = (*pp)->car_p_;
       if  (i->next_moment() == until) 
        {
          i->process_and_next (until);
        }
       if (!i->ok())
-       delete children_p_list_.remove_cons (pp);
+       delete children_p_list_.remove_cons_p (pp);
       else
-       pp = &(*pp)->next_;
+       pp = &(*pp)->next_cons_p_;
     }
   Music_iterator::do_process_and_next (until);
 }
@@ -78,8 +78,8 @@ Simultaneous_music_iterator::next_moment() const
   Moment next;
   next.set_infinite (1);
   
-  for (Cons<Music_iterator> *p = children_p_list_.head_; p; p = p->next_)
-    next = next <? p->car_->next_moment() ;
+  for (Cons<Music_iterator> *p = children_p_list_.head_cons_p_; p; p = p->next_cons_p_)
+    next = next <? p->car_p_->next_moment() ;
   return next;
 }
 
@@ -88,6 +88,6 @@ Simultaneous_music_iterator::next_moment() const
 bool
 Simultaneous_music_iterator::ok() const
 {
-  return children_p_list_.head_;
+  return children_p_list_.head_cons_p_;
 }
 
index bd1247758226cd9974b2f9086b4bffd18957468b..4b7c39b5b59748c9d198824ba96534a11123bfa3 100644 (file)
@@ -68,9 +68,9 @@ Spring_spacer::handle_loose_cols()
   Union_find connected (cols_.size());
   Array<int> fixed;
   
-  for (Cons<Idealspacing> *i  = ideal_p_list_; i; i = i->next_)
+  for (Cons<Idealspacing> *i  = ideal_p_list_; i; i = i->next_cons_p_)
     {
-      connected.connect (i->car_->cols_drul_[LEFT],i->car_->cols_drul_[RIGHT]);
+      connected.connect (i->car_p_->cols_drul_[LEFT],i->car_p_->cols_drul_[RIGHT]);
     }
   for (int i = 0; i < cols_.size(); i++)
     if (cols_[i].fixed_b())
@@ -240,9 +240,9 @@ Spring_spacer::make_matrices (Matrix &quad, Vector &lin, Real &c) const
   lin.fill (0);
   c = 0;
 
-  for (Cons<Idealspacing> *p =ideal_p_list_; p; p = p->next_)
+  for (Cons<Idealspacing> *p =ideal_p_list_; p; p = p->next_cons_p_)
     {
-      Idealspacing *i = p->car_;
+      Idealspacing *i = p->car_p_;
       int l = i->cols_drul_[LEFT];
       int r = i->cols_drul_[RIGHT];
 
@@ -296,9 +296,9 @@ Real
 Spring_spacer::calculate_energy_f (Vector solution) const
 {
   Real e = 0.0;
-  for (Cons<Idealspacing>*p =ideal_p_list_; p; p = p->next_)
+  for (Cons<Idealspacing>*p =ideal_p_list_; p; p = p->next_cons_p_)
     {
-      Idealspacing * i = p->car_;
+      Idealspacing * i = p->car_p_;
       e += i->energy_f(solution(i->cols_drul_[RIGHT]) - solution(i->cols_drul_[LEFT]));
     }
 
@@ -421,14 +421,14 @@ Spring_spacer::loosen_column (int idx)
 
   while (*pp)
     {
-      Idealspacing *j = (*pp)->car_;
+      Idealspacing *j = (*pp)->car_p_;
       if (j->cols_drul_[LEFT] == idx|| j->cols_drul_[RIGHT] == idx)
        {
-         delete remove_cons (pp);
+         delete remove_cons_p (pp);
        }
       else
        {
-         pp = &(*pp)->next_;
+         pp = &(*pp)->next_cons_p_;
        }
     }
   c.ugh_b_ = true;
@@ -453,9 +453,9 @@ Spring_spacer::print() const
       cols_[i].print();
     }
 
-  for (Cons<Idealspacing> *p =ideal_p_list_; p; p = p->next_)
+  for (Cons<Idealspacing> *p =ideal_p_list_; p; p = p->next_cons_p_)
     {
-      p->car_->print();
+      p->car_p_->print();
     }
 #endif
 }
index a3fec11395ed5ddb1bd9717b1356d4ef8ca355e9..fcb11f859bd849ad7b580d7838b6b0746075f6da 100644 (file)
@@ -91,9 +91,9 @@ Translator_group::set_element (String s, bool add)
 bool
 Translator_group::removable_b() const
 {
-  for (Cons<Translator> *p = trans_p_list_.head_; p; p = p->next_)
+  for (Cons<Translator> *p = trans_p_list_.head_cons_p_; p; p = p->next_cons_p_)
     {
-      if (dynamic_cast <Translator_group *> (p->car_))
+      if (dynamic_cast <Translator_group *> (p->car_p_))
        return false;
     }
 
@@ -224,10 +224,10 @@ Link_array<Translator_group>
 Translator_group::group_l_arr () const
 {
   Link_array<Translator_group> groups;
-  for (Cons<Translator> *p = trans_p_list_.head_; p; p = p->next_)
+  for (Cons<Translator> *p = trans_p_list_.head_cons_p_; p; p = p->next_cons_p_)
     {
-      if (dynamic_cast <Translator_group *> (p->car_))
-       groups.push (dynamic_cast <Translator_group *> (p->car_));
+      if (dynamic_cast <Translator_group *> (p->car_p_))
+       groups.push (dynamic_cast <Translator_group *> (p->car_p_));
     }
   return groups;
 }
@@ -236,10 +236,10 @@ Link_array<Translator>
 Translator_group::nongroup_l_arr () const
 {
   Link_array<Translator> groups;
-  for (Cons<Translator> *p = trans_p_list_.head_; p; p = p->next_)
+  for (Cons<Translator> *p = trans_p_list_.head_cons_p_; p; p = p->next_cons_p_)
     {
-      if (!dynamic_cast <Translator_group *> (p->car_))
-       groups.push (p->car_);
+      if (!dynamic_cast <Translator_group *> (p->car_p_))
+       groups.push (p->car_p_);
     }
   return groups;
 }
@@ -266,11 +266,11 @@ Translator_group::remove_translator_p (Translator*trans_l)
 {
   assert (trans_l);
   
-  for (Cons<Translator> **pp = &trans_p_list_.head_; *pp; pp = &(*pp)->next_)
-    if ((*pp)->car_ == trans_l)
+  for (Cons<Translator> **pp = &trans_p_list_.head_cons_p_; *pp; pp = &(*pp)->next_cons_p_)
+    if ((*pp)->car_p_ == trans_l)
       {
-       Cons<Translator> *r = trans_p_list_.remove_cons (pp);
-       r->car_ =0;
+       Cons<Translator> *r = trans_p_list_.remove_cons_p (pp);
+       r->car_p_ =0;
        trans_l->daddy_trans_l_ =0;
        delete r;
        return trans_l;
@@ -328,16 +328,16 @@ Translator_group::get_default_interpreter()
 void
 Translator_group::each (Method_pointer method)
 {
-  for (Cons<Translator> *p = trans_p_list_.head_; p; p = p->next_)
-    (p->car_->*method) ();
+  for (Cons<Translator> *p = trans_p_list_.head_cons_p_; p; p = p->next_cons_p_)
+    (p->car_p_->*method) ();
 }
 
 
 void
 Translator_group::each (Const_method_pointer method) const
 {
-  for (Cons<Translator> *p = trans_p_list_.head_; p; p = p->next_)
-    (p->car_->*method) ();
+  for (Cons<Translator> *p = trans_p_list_.head_cons_p_; p; p = p->next_cons_p_)
+    (p->car_p_->*method) ();
 }
 
 void
index 3679ef600796be31a80d6df42e6549314ca573d9..d873e198df29fcbc8f5e15c5dcd63e511cb9fcd9 100644 (file)
@@ -11,7 +11,7 @@
 #define MIDI_TRACK_PARSER_HH
 
 #include "proto.hh"
-#include "plist.hh"
+#include "cons.hh"
 #include "moment.hh"
 #include "mi2mu-proto.hh"
 #include "midi-parser.hh"
@@ -36,7 +36,7 @@ private:
 
   Moment at_mom_;
   Byte running_byte_;
-  Link_list<Mudela_note*> open_note_l_list_;
+  Cons_list<Mudela_note> open_note_l_list_;
   Mudela_staff* mudela_staff_p_;
   Midi_parser_info* track_info_p_;
 };
index b1ab97c24bb37c4f35b8833943b29f85829d93c5..a09cebb4694291d9fc5c074a5bbcd4887859eaaa 100644 (file)
@@ -9,7 +9,7 @@
 #include "proto.hh"
 #include "mi2mu-proto.hh"
 #include "moment.hh"
-#include "plist.hh"
+#include "cons.hh"
 
 /// (mudela_column)
 class Mudela_column 
@@ -18,9 +18,9 @@ public:
     Mudela_column (Mudela_score* mudela_score_l, Moment mom);
 
     void add_item (Mudela_item* mudela_item_l);
-    Moment at_mom();
+    Moment at_mom ();
 
-    Link_list<Mudela_item*> mudela_item_l_list_;
+    Cons_list<Mudela_item> mudela_item_l_list_;
     Moment at_mom_;
     Mudela_score* mudela_score_l_;
 };
index 6dce94333df8aca2c37ffba363e9b2df2efb13bd..e1b52b7368a8252d6d36ef7fe9bddb690a906269 100644 (file)
 class Mudela_item 
 {
 public:
-    Mudela_item (Mudela_column* mudela_column_l);
-    virtual ~Mudela_item ();
+  Mudela_item (Mudela_column* mudela_column_l);
+  virtual ~Mudela_item ();
     
-    virtual Moment at_mom();
-    virtual Moment duration_mom();
-    void output (Mudela_stream& mudela_stream_r);
-    virtual String str() = 0;
+  virtual Moment at_mom ();
+  virtual Moment duration_mom ();
+  void output (Mudela_stream& mudela_stream_r);
+  virtual String str () = 0;
 
-    Mudela_column* mudela_column_l_;
+  Mudela_column* mudela_column_l_;
 };
 
 class Mudela_key : public Mudela_item 
 {
 public:
-    Mudela_key (int accidentals_i, int minor_i);
+  Mudela_key (int accidentals_i, int minor_i);
 
-    String notename_str (int pitch_i);
-    virtual String str();
+  String notename_str (int pitch_i);
+  virtual String str ();
 
-//private:
-    int accidentals_i_;
-    int minor_i_;
+  //private:
+  int accidentals_i_;
+  int minor_i_;
 };
 
 class Mudela_time_signature : public Mudela_item 
 {
 public:
-    Mudela_time_signature (int num_i, int den_i, int division_4_i, int count_32_i);
+  Mudela_time_signature (int num_i, int den_i, int division_4_i, int count_32_i);
 
-    Duration i2_dur (int time_i, int division_1_i);
-    int clocks_1_i();
-    int den_i();
-    int num_i();
-    virtual String str();
-    Moment bar_mom();
+  Duration i2_dur (int time_i, int division_1_i);
+  int clocks_1_i ();
+  int den_i ();
+  int num_i ();
+  virtual String str ();
+  Moment bar_mom ();
 
 private:
-    Real sync_f_;
-    Duration sync_dur_;
-    int clocks_1_i_;
-    int num_i_;
-    int den_i_;
+  Real sync_f_;
+  Duration sync_dur_;
+  int clocks_1_i_;
+  int num_i_;
+  int den_i_;
 };
 
 class Mudela_note : public Mudela_item 
 {
 public:
-    Mudela_note (Mudela_column* mudela_column_l, int channel_i, int pitch_i, int dyn_i);
+  Mudela_note (Mudela_column* mudela_column_l, int channel_i, int pitch_i, int dyn_i);
 
-    Duration duration();
-    virtual Moment duration_mom();
-    virtual String str();
+  Duration duration ();
+  virtual Moment duration_mom ();
+  virtual String str ();
     
-//    int const c0_pitch_i_c_ = 60; // huh?
-    static int const c0_pitch_i_c_ = 48;
+  //    int const c0_pitch_i_c_ = 60; // huh?
+  static int const c0_pitch_i_c_ = 48;
 
-    static bool const simple_plet_b_s = false;
-    int channel_i_;
-    int pitch_i_;
-    Mudela_column* end_column_l_;
+  static bool const simple_plet_b_s = false;
+  int channel_i_;
+  int pitch_i_;
+  Mudela_column* end_column_l_;
 };
 
 class Mudela_skip : public Mudela_item 
 {
 public:
-    Mudela_skip (Mudela_column* mudela_column_l, Moment skip_mom);
+  Mudela_skip (Mudela_column* mudela_column_l, Moment skip_mom);
 
-    Duration duration();
-    virtual Moment duration_mom();
-    virtual String str();
+  Duration duration ();
+  virtual Moment duration_mom ();
+  virtual String str ();
 
 private:
-    Moment mom_;
+  Moment mom_;
 };
 
 
 class Mudela_tempo : public Mudela_item 
 {
 public:
-    Mudela_tempo (int useconds_per_4_i);
+  Mudela_tempo (int useconds_per_4_i);
 
-    int get_tempo_i (Moment moment);
-    virtual String str();
-    int useconds_per_4_i();
+  int get_tempo_i (Moment moment);
+  virtual String str ();
+  int useconds_per_4_i ();
 
 private:
-    int useconds_per_4_i_;
-    Moment seconds_per_1_mom_;
+  int useconds_per_4_i_;
+  Moment seconds_per_1_mom_;
 };
 
 class Mudela_text : public Mudela_item 
 {
 public:
-    enum Type { 
-       TEXT = 1, COPYRIGHT, TRACK_NAME, INSTRUMENT_NAME, LYRIC, 
-       MARKER, CUE_POINT
-    };
-    Mudela_text (Mudela_text::Type type,  String str);
-    virtual String str();
-
-//private:
-    Type type_;
-    String text_str_;
+  enum Type { 
+    TEXT = 1, COPYRIGHT, TRACK_NAME, INSTRUMENT_NAME, LYRIC, 
+    MARKER, CUE_POINT
+  };
+  Mudela_text (Mudela_text::Type type,  String str);
+  virtual String str ();
+
+  //private:
+  Type type_;
+  String text_str_;
 };
 
 #endif // MUDELA_ITEM_HH
index 4d0992b35c2556d722a786cbb1de3a3123727a1a..87e901b7097118258db2569cd54082d5b3450a75 100644 (file)
@@ -8,45 +8,43 @@
 
 #include "mi2mu-proto.hh"
 #include "proto.hh"
-#include "plist.hh"
+#include "cons.hh"
 #include "parray.hh"
 
 /// (mudela_score)
 class Mudela_score {
 public:
-    Mudela_score (int format_i, int tracks_i, int tempo_i);
-    ~Mudela_score();
+  Mudela_score (int format_i, int tracks_i, int tempo_i);
+  ~Mudela_score ();
 
-    void add_item (Mudela_item* mudela_item_p);
-    void add_staff (Mudela_staff* mudela_staff_p);
+  void add_item (Mudela_item* mudela_item_p);
+  void add_staff (Mudela_staff* mudela_staff_p);
 
-    Mudela_column* find_column_l (Moment mom);
-    Mudela_column* get_column_l (Moment mom);
+  Mudela_column* find_column_l (Moment mom);
+  Mudela_column* get_column_l (Moment mom);
 
-    void output (String filename_str);
-    void process();
+  void output (String filename_str);
+  void process ();
 
-    // ugh
-    Mudela_key* mudela_key_l_;
-    Mudela_time_signature* mudela_time_signature_l_;
-    Mudela_tempo* mudela_tempo_l_;
+  // ugh
+  Mudela_key* mudela_key_l_;
+  Mudela_time_signature* mudela_time_signature_l_;
+  Mudela_tempo* mudela_tempo_l_;
 
 private:
-    void filter_tempo();
-    void quantify_columns();
-    void quantify_durations();
-    void settle_columns();
+  void filter_tempo ();
+  void quantify_columns ();
+  void quantify_durations ();
+  void settle_columns ();
 
-    Pointer_list<Mudela_staff*> mudela_staff_p_list_;
-   // wants Pointer_array!
-//    Pointer_list<Mudela_column*> mudela_column_p_list_;
-    Link_array<Mudela_column> column_l_array_;
+  Cons_list<Mudela_staff> mudela_staff_p_list_;
+  Link_array<Mudela_column> column_l_array_;
 
-// ugh, ugh, ugh
+  // ugh, ugh, ugh
 public:
-    int format_i_;
-    int tracks_i_;
-    int tempo_i_;
+  int format_i_;
+  int tracks_i_;
+  int tempo_i_;
 };
 
 #endif // MUDELA_SCORE_HH
index 4b4fd75c60e6719f2515465db1e0e059c35ee3b0..8c0afa044a4b53d6ca51ec133c9492445d5d9dbf 100644 (file)
@@ -8,20 +8,21 @@
 
 #include "mi2mu-proto.hh"
 #include "proto.hh"
-#include "plist.hh"
+#include "cons.hh"
 #include "string.hh"
 
 /// (mudela_staff)
-class Mudela_staff {
+class Mudela_staff
+{
 public:
   Mudela_staff (int number_i, String copyright_str, String track_name_str, String instrument_str);
 
   void add_item (Mudela_item* mudela_item_p);
-  void eat_voice (Link_list<Mudela_item*>& items);
-  String id_str();
-  String name_str();
+  void eat_voice (Cons_list<Mudela_item>& items);
+  String id_str ();
+  String name_str ();
   void output (Mudela_stream& mudela_stream_r);
-  void process();
+  void process ();
 
   String copyright_str_;
   String instrument_str_;
@@ -34,8 +35,8 @@ public:
 private:
   void output_mudela_begin_bar (Mudela_stream& mudela_stream_r, Moment now_mom, int bar_i);
 
-  Pointer_list<Mudela_voice*> mudela_voice_p_list_;
-  Pointer_list<Mudela_item*> mudela_item_p_list_;
+  Cons_list<Mudela_voice> mudela_voice_p_list_;
+  Cons_list<Mudela_item> mudela_item_p_list_;
 };
 
 #endif // MUDELA_STAFF_HH
index 28b4efcdb99e31bea3fe68f5b8b4ef3e2d315e48..a8612013681b27b00aaaf4106ca84dabbeb31486 100644 (file)
@@ -7,22 +7,23 @@
 #define MUDELA_VOICE_HH
 
 #include "mi2mu-proto.hh"
-#include "plist.hh"
+#include "cons.hh"
 
 /// (mudela_voice)
-class Mudela_voice {
+class Mudela_voice
+{
 public:
-    Mudela_voice (Mudela_staff* mudela_staff_l);
+  Mudela_voice (Mudela_staff* mudela_staff_l);
 
-    void add_item (Mudela_item* mudela_item_l);
-    Moment begin_mom();
-    Moment end_mom();
+  void add_item (Mudela_item* mudela_item_l);
+  Moment begin_mom ();
+  Moment end_mom ();
 
-    void output (Mudela_stream& mudela_stream_r);
+  void output (Mudela_stream& mudela_stream_r);
 
 private:
-    Mudela_staff* mudela_staff_l_;
-    Link_list<Mudela_item*> mudela_item_l_list_;
+  Mudela_staff* mudela_staff_l_;
+  Cons_list<Mudela_item> mudela_item_l_list_;
 };
 
 #endif // MUDELA_VOICE_HH
index ff7d4453d49f55fd9cab08c386c9b33a53c6973f..2b34868c47df1a215f11bb8c9be99380e0ac7ee0 100644 (file)
@@ -53,19 +53,17 @@ Midi_track_parser::note_end (Mudela_column* col_l, int channel_i, int pitch_i, i
 
   assert (col_l);
 
-  for (PCursor<Mudela_note*> i (open_note_l_list_.top ()); i.ok (); )
+  for (Cons<Mudela_note>** pp = &open_note_l_list_.head_cons_p_; *pp;)
     {
-      if ((i->pitch_i_ == pitch_i) && (i->channel_i_ == channel_i))
+      Cons<Mudela_note>* i = *pp;
+      if ((i->car_p_->pitch_i_ == pitch_i) && (i->car_p_->channel_i_ == channel_i))
        {
-         i->end_column_l_ = col_l;
-         // LOGOUT(DEBUG_ver) << "Note: " << pitch_i;
-         // LOGOUT(DEBUG_ver) << "; " << i->mudela_column_l_->at_mom_;
-         // LOGOUT(DEBUG_ver) << ", " << i->end_column_l_->at_mom_ << '\n';
-         i.remove_p();
+         i->car_p_->end_column_l_ = col_l;
+         delete open_note_l_list_.remove_cons_p (pp);
          return;
        }
       else
-       i++;
+       pp = &i->next_cons_p_;
     }
   warning (_f ("junking note-end event: channel = %d, pitch = %d", 
               channel_i, pitch_i));
@@ -76,11 +74,11 @@ Midi_track_parser::note_end_all (Mudela_column* col_l)
 {
   // find
   assert (col_l);
-  for (PCursor<Mudela_note*> i (open_note_l_list_.top ()); i.ok (); )
+  for (Cons<Mudela_note>* i = open_note_l_list_.head_cons_p_; i; i = i->next_cons_p_)
     {
-      i->end_column_l_ = col_l;
-      i.remove_p ();
+      i->car_p_->end_column_l_ = col_l;
     }
+  open_note_l_list_.init ();
 }
 
 Mudela_staff*
@@ -169,13 +167,14 @@ Midi_track_parser::parse_event (Mudela_column* col_l)
        {
          Mudela_note* p = new Mudela_note (col_l, channel_i, pitch_i, dyn_i);
          item_p = p;
-         open_note_l_list_.bottom ().add (p);
+         open_note_l_list_.append (new Cons<Mudela_note> (p, 0));
        }
       else
        {
          note_end (col_l, channel_i, pitch_i, dyn_i);
        }
     }
+    
   // POLYPHONIC_AFTERTOUCH     [\xa0-\xaf]
   else if ((byte >= 0xa0) && (byte <= 0xaf))
     {
index 5a00e8831054ce0d4f4c66cc54eaa730b6d875dc..833b351f81fe5ec67e905f61696b20295f796f26 100644 (file)
@@ -14,7 +14,7 @@ Mudela_column::Mudela_column (Mudela_score* mudela_score_l, Moment mom)
 void 
 Mudela_column::add_item (Mudela_item* mudela_item_l)
 {
-  mudela_item_l_list_.bottom().add (mudela_item_l);
+   mudela_item_l_list_.append (new Cons<Mudela_item> (mudela_item_l, 0));
 }
 
 Moment
index a18fe02d92acfc140cd7f8fd21d59f9009b600a0..9ec6f46dc85aca3d7a9e0875fd3b5f58711d2430 100644 (file)
@@ -14,9 +14,7 @@
 #include "mudela-staff.hh"
 #include "mudela-stream.hh"
 
-// ugh, cygnus' b19 gcc
-#include "list.tcc"
-#include "cursor.tcc"
+#include "killing-cons.tcc"
 
 //static Mudela_key key_c (0, 0);
 static Mudela_time_signature time_sig_4 (4, 2, 24, 8);
@@ -35,32 +33,25 @@ Mudela_score::Mudela_score (int format_i, int tracks_i, int tempo_i)
   mudela_tempo_l_ = &tempo_60;
 }
 
-Mudela_score::~Mudela_score()
+Mudela_score::~Mudela_score ()
 {
 }
 
 void
 Mudela_score::add_item (Mudela_item* mudela_item_p)
 {
-  mudela_staff_p_list_.bottom()->add_item (mudela_item_p);
+  mudela_staff_p_list_.tail_car_l ()->add_item (mudela_item_p);
 }
 
 void
 Mudela_score::add_staff (Mudela_staff* mudela_staff_p)
 {
-  mudela_staff_p_list_.bottom().add (mudela_staff_p);
+  mudela_staff_p_list_.append (new Killing_cons<Mudela_staff> (mudela_staff_p, 0));
 }
 
 Mudela_column*
 Mudela_score::find_column_l (Moment mom)
 {
-#if 0
-  // should do binary search
-  for (int i = 0; i < column_l_array_.size (); i++ )
-    if ( column_l_array_[i]->at_mom () == mom )
-      return column_l_array_[i];
-  return 0;
-#else
   int upper_i = max (0, column_l_array_.size () - 1);
   int lower_i = 0;
   int i = 0; //upper_i;
@@ -73,7 +64,7 @@ Mudela_score::find_column_l (Moment mom)
        upper_i = i;
       else
        lower_i = i;
-      if ((upper_i == lower_i) || (i == column_l_array_.size () - 1))
+      if ( (upper_i == lower_i) || (i == column_l_array_.size () - 1))
        {
          // we don't do inserts
          assert (0);
@@ -85,7 +76,6 @@ Mudela_score::find_column_l (Moment mom)
     }
   assert (0);
   return 0;
-#endif
 }
 
 Mudela_column*
@@ -93,7 +83,7 @@ Mudela_score::get_column_l (Moment mom)
 {
   int i;
   Mudela_column *c=0;
-  for (i=column_l_array_.size() - 1; !c && i >=0; i--)
+  for (i=column_l_array_.size () - 1; !c && i >=0; i--)
     {
       if (column_l_array_ [i]->at_mom () == mom )
        c = column_l_array_[i];
@@ -114,115 +104,97 @@ Mudela_score::get_column_l (Moment mom)
 void
 Mudela_score::output (String filename_str)
 {
-  LOGOUT(NORMAL_ver) << _f ("Lily output to %s...", filename_str) << endl;
+  LOGOUT (NORMAL_ver) << _f ("Lily output to %s...", filename_str) << endl;
 
   // ugh, ugly midi type 1 fix
-  if  ( (mudela_staff_p_list_.size() == 1) && !mudela_staff_p_list_.top()->number_i_)
-    mudela_staff_p_list_.top()->number_i_ = 1;
+  if ( (mudela_staff_p_list_.size_i () == 1)
+       && !mudela_staff_p_list_.car_l ()->number_i_)
+    mudela_staff_p_list_.car_l ()->number_i_ = 1;
 
   int track_i = 0;
   Mudela_stream mudela_stream (filename_str);
-  for  (PCursor<Mudela_staff*> i (mudela_staff_p_list_); i.ok(); i++)
+  for (Cons<Mudela_staff>* i = mudela_staff_p_list_.head_cons_p_; i; i = i->next_cons_p_)
     {
-      LOGOUT(NORMAL_ver) << _ ("track ") << track_i++ << ": " << flush;
-      i->output (mudela_stream);
+      LOGOUT (NORMAL_ver) << _ ("track ") << track_i++ << ": " << flush;
+      i->car_p_->output (mudela_stream);
       mudela_stream << '\n';
-      LOGOUT(NORMAL_ver) << endl;
+      LOGOUT (NORMAL_ver) << endl;
     }
 
   mudela_stream << "\\score{\n";
-  if  (mudela_staff_p_list_.size() > 1)
+  if (mudela_staff_p_list_.size_i () > 1)
     mudela_stream << "< \n";
-  for  (PCursor<Mudela_staff*> i (mudela_staff_p_list_); i.ok(); i++)
+  for (Cons<Mudela_staff>* i = mudela_staff_p_list_.head_cons_p_; i; i = i->next_cons_p_)
     {
-      if  ( (mudela_staff_p_list_.size() != 1)
-           &&  (i == mudela_staff_p_list_.top()))
+      if ( (mudela_staff_p_list_.size_i () != 1)
+           && (i->car_p_ == mudela_staff_p_list_.car_l ()))
        continue;
-      mudela_stream << "\\type Staff = \"" << i->id_str() << "\" ";
-      mudela_stream << String ("\\" +  i->id_str ()) << "\n";
+      mudela_stream << "\\type Staff = \"" << i->car_p_->id_str () << "\" ";
+      mudela_stream << String ("\\" +  i->car_p_->id_str ()) << "\n";
     }
-  if  (mudela_staff_p_list_.size() > 1)
+  if (mudela_staff_p_list_.size_i () > 1)
     mudela_stream << ">\n";
 
-#if 0
   mudela_stream << "\\paper{}\n";
-#else
-  /*
-    let's put some auto-beam stuff in place as long as it's optional
-  */
-  mudela_stream << "\\paper{\n";
-  mudela_stream << "\\translator{\n";
-  mudela_stream << "\\VoiceContext\n";
-  mudela_stream << "\\consists \"Auto_beam_engraver\";\n";
-  mudela_stream << "beamAuto = 1.;\n";
-  mudela_stream << "beamAutoEnd8 = \"2/4\";\n";
-  mudela_stream << "beamAutoEnd16 = \"1/4\";\n";
-  mudela_stream << "beamAutoEnd32 = \"1/4\";\n";
-  mudela_stream << "}\n";
-  mudela_stream << "}\n";
-#endif
 
   mudela_stream << "\\midi{\n";
   // let's not use silly 0 track
-  mudela_staff_p_list_.bottom()->mudela_tempo_l_->output (mudela_stream);
+  mudela_staff_p_list_.tail_car_l ()->mudela_tempo_l_->output (mudela_stream);
   mudela_stream << "}\n";
 
   mudela_stream << "}\n";
 }
 
 void
-Mudela_score::process()
+Mudela_score::process ()
 {
-  LOGOUT(NORMAL_ver) << '\n' << _ ("Processing...") << endl;
+  LOGOUT (NORMAL_ver) << '\n' << _ ("Processing...") << endl;
 
-  LOGOUT(DEBUG_ver) << "columns\n";
-  //  for  (PCursor<Mudela_column*> i (mudela_column_p_list_); i.ok(); i++)
-  //   LOGOUT(DEBUG_ver) << "At: " << i->at_mom() << '\n';
+  LOGOUT (DEBUG_ver) << "columns\n";
 
-  settle_columns();
-  filter_tempo();
-  quantify_columns();
-  quantify_durations();
+  settle_columns ();
+  filter_tempo ();
+  quantify_columns ();
+  quantify_durations ();
 
-  LOGOUT(NORMAL_ver) << '\n' << _ ("Creating voices...") << endl;
+  LOGOUT (NORMAL_ver) << '\n' << _ ("Creating voices...") << endl;
   int track_i = 0;
-  for  (PCursor<Mudela_staff*> i (mudela_staff_p_list_); i.ok(); i++)
+  for (Cons<Mudela_staff>* i = mudela_staff_p_list_.head_cons_p_; i; i = i->next_cons_p_)
     {
-      LOGOUT(NORMAL_ver) << _ ("track ") << track_i++ << ": " << flush;
-      i->process();
-      LOGOUT(NORMAL_ver) << endl;
+      LOGOUT (NORMAL_ver) << _ ("track ") << track_i++ << ": " << flush;
+      i->car_p_->process ();
+      LOGOUT (NORMAL_ver) << endl;
     }
 }
 
 void
-Mudela_score::filter_tempo()
+Mudela_score::filter_tempo ()
 {
-  LOGOUT(NORMAL_ver) << '\n' << _ ("NOT Filtering tempo...") << endl;
+  LOGOUT (NORMAL_ver) << '\n' << _ ("NOT Filtering tempo...") << endl;
 }
 
 void
-Mudela_score::quantify_columns()
+Mudela_score::quantify_columns ()
 {
   // ugh
-  if  (Duration_convert::no_quantify_b_s)
+  if (Duration_convert::no_quantify_b_s)
     {
-      LOGOUT(NORMAL_ver) << '\n' << _("NOT Quantifying columns...") << endl;
+      LOGOUT (NORMAL_ver) << '\n' << _ ("NOT Quantifying columns...") << endl;
       return;
     }
 
-  LOGOUT(NORMAL_ver) << '\n' << _("Quantifying columns...") << endl;
+  LOGOUT (NORMAL_ver) << '\n' << _ ("Quantifying columns...") << endl;
 
   int current_bar_i = 0;
-  Moment bar_mom = mudela_time_signature_l_->bar_mom();
+  Moment bar_mom = mudela_time_signature_l_->bar_mom ();
 
   int n = 5 >? Duration_convert::no_smaller_than_i_s;
   n = Duration_convert::type2_i (n);
   Moment s = Moment (1, n);
-  Moment sh = Moment (1, 2 * n);
-  for  (int i = 0; i < column_l_array_.size(); i++)
+  for (int i = 0; i < column_l_array_.size (); i++)
     {
       column_l_array_ [i]->at_mom_ =
-       s * Moment( (int) ( (column_l_array_ [i]->at_mom()) / s));
+       s * Moment ( (int) ( (column_l_array_ [i]->at_mom ()) / s));
 
       int bar_i = (int) (column_l_array_ [i]->at_mom () / bar_mom) + 1;
       if (bar_i > current_bar_i)
@@ -231,32 +203,21 @@ Mudela_score::quantify_columns()
          current_bar_i = bar_i;
        }
     }
-  LOGOUT(NORMAL_ver) << endl;
+  LOGOUT (NORMAL_ver) << endl;
 }
 
 void
-Mudela_score::quantify_durations()
+Mudela_score::quantify_durations ()
 {
-  //    LOGOUT(NORMAL_ver) << '\n' << "Quantifying durations..." << endl;
+  //    LOGOUT (NORMAL_ver) << '\n' << "Quantifying durations..." << endl;
 }
 
 void
-Mudela_score::settle_columns()
+Mudela_score::settle_columns ()
 {
-  //    LOGOUT(NORMAL_ver) << '\n' << "NOT Settling columns..." << endl;
-  //    return;
-  LOGOUT(NORMAL_ver) << '\n' << _("Settling columns...") << endl;
-
-#if 0
-  assert (!column_l_array_.size());
-  int n = mudela_column_p_list_.size();
-  // huh?
-  //    column_l_array_.set_size (n);
-  for  (PCursor<Mudela_column*> i (mudela_column_p_list_); i.ok(); i++)
-    column_l_array_.push (*i);
-#endif
+  LOGOUT (NORMAL_ver) << '\n' << _ ("Settling columns...") << endl;
 
-  int n = column_l_array_.size();
+  int n = column_l_array_.size ();
 
   int start_i = 0;
   int end_i = 0;
@@ -265,22 +226,22 @@ Mudela_score::settle_columns()
   smallest_dur.durlog_i_ =  6;
   Moment const noise_mom = Duration_convert::dur2_mom (smallest_dur)
     / Moment (2);
-  for  (int i = 0; i < n; i++)
+  for (int i = 0; i < n; i++)
     {
-      if  (!start_i)
+      if (!start_i)
        {
          start_i = end_i = i;
-         start_mom = column_l_array_ [i]->at_mom();
+         start_mom = column_l_array_ [i]->at_mom ();
          continue;
        }
 
       // find all columns within noise's distance
-      while  ( (i < n)
-              &&  (column_l_array_ [i]->at_mom() - start_mom < noise_mom))
+      while ( (i < n)
+              && (column_l_array_ [i]->at_mom () - start_mom < noise_mom))
        end_i = ++i;
 
       // bluntly set all to time of first in group
-      for  (int j = start_i; j < end_i; j++)
+      for (int j = start_i; j < end_i; j++)
        column_l_array_ [j]->at_mom_ = start_mom;
 
       start_i = end_i = 0;
index 3c92577895a9c9ae7ff39ac5b51e6cf8ec814f75..4f9964250de067b214c2fade738bdb7ffff85bef 100644 (file)
@@ -17,6 +17,8 @@
 #include "mudela-voice.hh"
 #include "mudela-score.hh"
 
+#include "killing-cons.tcc"
+
 extern Mudela_score* mudela_score_l_g;
 
 Mudela_staff::Mudela_staff (int number_i, String copyright_str, String track_name_str, String instrument_str)
@@ -33,51 +35,53 @@ Mudela_staff::Mudela_staff (int number_i, String copyright_str, String track_nam
 void
 Mudela_staff::add_item (Mudela_item* mudela_item_p)
 {
-  mudela_item_p_list_.bottom().add (mudela_item_p);
-  if  (mudela_item_p->mudela_column_l_)
+  mudela_item_p_list_.append (new Killing_cons <Mudela_item> (mudela_item_p, 0));
+  if (mudela_item_p->mudela_column_l_)
     mudela_item_p->mudela_column_l_->add_item (mudela_item_p);
 }
 
 void
-Mudela_staff::eat_voice (Link_list<Mudela_item*>& items)
+Mudela_staff::eat_voice (Cons_list<Mudela_item>& items)
 {
   Mudela_voice* voice_p = new Mudela_voice (this);
-  mudela_voice_p_list_.bottom().add (voice_p);
+  mudela_voice_p_list_.append (new Killing_cons<Mudela_voice> (voice_p, 0));
 
-  //    Moment mom = items.top()->at_mom();
+  //    Moment mom = items.top ()->at_mom ();
   Moment mom = 0;
 
-  for  (PCursor<Mudela_item*> i (items); i.ok();)
+  for (Cons<Mudela_item>** pp = &items.head_cons_p_; *pp;)
     {
-      LOGOUT(DEBUG_ver) << "At: " << i->at_mom ().str () << "; ";
-      LOGOUT(DEBUG_ver) << "dur: " << i->duration_mom ().str () << "; ";
-      LOGOUT(DEBUG_ver) << "mom: " << mom.str () << " -> ";
-      if  (i->at_mom() > mom)
+      Cons<Mudela_item>* i = *pp;
+      LOGOUT (DEBUG_ver) << "At: " << i->car_p_->at_mom ().str () << "; ";
+      LOGOUT (DEBUG_ver) << "dur: " << i->car_p_->duration_mom ().str () << "; ";
+      LOGOUT (DEBUG_ver) << "mom: " << mom.str () << " -> ";
+      if (i->car_p_->at_mom () > mom)
        {
-         Moment dur = i->at_mom() - mom;
+         Moment dur = i->car_p_->at_mom () - mom;
          // ugh, need score
          Mudela_column* start = mudela_score_l_g->find_column_l (mom);
          voice_p->add_item (new Mudela_skip (start, dur));
-         mom = i->at_mom();
+         mom = i->car_p_->at_mom ();
        }
-      if  (i->at_mom() == mom)
+      if (i->car_p_->at_mom () == mom)
        {
-         mom = i->at_mom() + i->duration_mom();
-         voice_p->add_item (i.remove_p());
-         // ugh
+         mom = i->car_p_->at_mom () + i->car_p_->duration_mom ();
+         Cons<Mudela_item>* c = items.remove_cons_p (pp);
+         voice_p->add_item (c->car_p_);
+         delete c;
        }
-      else if  (i.ok())
-       i++;
-      LOGOUT(DEBUG_ver) << "mom: " << mom.str () << '\n';
+      else if (*pp)
+       pp = &i->next_cons_p_;
+      LOGOUT (DEBUG_ver) << "mom: " << mom.str () << '\n';
     }
 }
 
 String
-Mudela_staff::id_str()
+Mudela_staff::id_str ()
 {
   String id (name_str ());
   char *cp = id.ch_l ();
-  char *end = cp + id.length_i();
+  char *end = cp + id.length_i ();
   for (;cp < end; cp++)
     {
       if (!isalpha (*cp))
@@ -89,9 +93,9 @@ Mudela_staff::id_str()
 }
 
 String
-Mudela_staff::name_str()
+Mudela_staff::name_str ()
 {
-  if  (name_str_.length_i())
+  if (name_str_.length_i ())
     return name_str_;
   return String ("track") + to_str (char ('A' - 1 + number_i_));
 }
@@ -101,40 +105,40 @@ Mudela_staff::name_str()
 void
 Mudela_staff::output (Mudela_stream& mudela_stream_r)
 {
-  mudela_stream_r << id_str() << " = \\notes";
-  mudela_stream_r <<  (mudela_voice_p_list_.size() > 1 ? "<" : "{");
+  mudela_stream_r << id_str () << " = \\notes";
+  mudela_stream_r << (mudela_voice_p_list_.size_i () > 1 ? "<" : "{");
   mudela_stream_r << '\n';
   mudela_stream_r << _ ("% midi copyright:") << copyright_str_ << '\n';
   mudela_stream_r << _ ("% instrument:") << instrument_str_ << '\n';
 
   // don't use last duration mode
   //  mudela_stream_r << "\\duration 4;\n";
-  if  (mudela_voice_p_list_.size() == 1)
-    mudela_voice_p_list_.top()->output (mudela_stream_r);
+  if (mudela_voice_p_list_.size_i () == 1)
+    mudela_voice_p_list_.car_l ()->output (mudela_stream_r);
   else
-    for  (PCursor<Mudela_voice*> i (mudela_voice_p_list_); i.ok(); i++)
+      for (Cons<Mudela_voice>* i = mudela_voice_p_list_.head_cons_p_; i; i = i->next_cons_p_)
       {
        mudela_stream_r << "{ ";
-       i->output (mudela_stream_r);
+       i->car_p_->output (mudela_stream_r);
        mudela_stream_r << "} ";
       }
 
-  mudela_stream_r <<  (mudela_voice_p_list_.size() > 1 ? "\n>" : "\n}");
-  mudela_stream_r << " % " << name_str() << '\n';
+  mudela_stream_r << (mudela_voice_p_list_.size_i () > 1 ? "\n>" : "\n}");
+  mudela_stream_r << " % " << name_str () << '\n';
 }
 
 void
 Mudela_staff::output_mudela_begin_bar (Mudela_stream& mudela_stream_r, Moment now_mom, int bar_i)
 {
-  Moment bar_mom = mudela_time_signature_l_->bar_mom();
+  Moment bar_mom = mudela_time_signature_l_->bar_mom ();
   Moment into_bar_mom = now_mom - Moment (bar_i - 1) * bar_mom;
-  if  (bar_i > 1)
+  if (bar_i > 1)
     {
-      if  (!into_bar_mom)
+      if (!into_bar_mom)
        mudela_stream_r << "|\n";
     }
   mudela_stream_r << "% " << String_convert::i2dec_str (bar_i, 0, ' ');
-  if  (into_bar_mom)
+  if (into_bar_mom)
     mudela_stream_r << ":" << Duration_convert::dur2_str (Duration_convert::mom2_dur (into_bar_mom));
   mudela_stream_r << '\n';
 }
@@ -144,13 +148,13 @@ Mudela_staff::output_mudela_begin_bar (Mudela_stream& mudela_stream_r, Moment no
 void
 Mudela_staff::output_mudela_rest (Mudela_stream& mudela_stream_r, Moment begin_mom, Moment end_mom)
 {
-  Moment bar_mom = mudela_time_signature_l_->bar_mom();
+  Moment bar_mom = mudela_time_signature_l_->bar_mom ();
   Moment now_mom = begin_mom;
 
   int begin_bar_i = (int) (now_mom / bar_mom) + 1;
   int end_bar_i = (int) (end_mom / bar_mom) + 1;
 
-  if  (end_bar_i == begin_bar_i)
+  if (end_bar_i == begin_bar_i)
     {
       output_mudela_rest_remain (mudela_stream_r, end_mom - begin_mom);
       return;
@@ -161,14 +165,14 @@ Mudela_staff::output_mudela_rest (Mudela_stream& mudela_stream_r, Moment begin_m
 
   //fill current bar
   Moment begin_bar_mom = Moment (begin_bar_i - 1) * bar_mom;
-  if  (now_mom > begin_bar_mom)
+  if (now_mom > begin_bar_mom)
     {
       int next_bar_i = (int) (now_mom / bar_mom) + 2;
       Moment next_bar_mom = Moment (next_bar_i - 1) * bar_mom;
       assert (next_bar_mom <= end_mom);
 
       Moment remain_mom = next_bar_mom - now_mom;
-      if  (remain_mom > Moment (0))
+      if (remain_mom > Moment (0))
        {
          output_mudela_rest_remain (mudela_stream_r, remain_mom);
          now_mom += remain_mom;
@@ -179,28 +183,28 @@ Mudela_staff::output_mudela_rest (Mudela_stream& mudela_stream_r, Moment begin_m
 
   // fill whole bars
   int count_i = end_bar_i - bar_i;
-  for  (int i = 0; i < count_i; i++)
+  for (int i = 0; i < count_i; i++)
     {
       int begin_bar_i = check_begin_bar_i (now_mom, bar_i);
-      if  (begin_bar_i)
+      if (begin_bar_i)
        output_mudela_begin_bar (mudela_stream_r, now_mom, begin_bar_i);
       mudela_stream_r << "r1 ";
       //       *mudela_stream_r.os_p_ << flush;
-      if  (begin_bar_i)
-       LOGOUT(NORMAL_ver) << begin_bar_i << flush;
+      if (begin_bar_i)
+       LOGOUT (NORMAL_ver) << begin_bar_i << flush;
       bar_i = check_end_bar_i (now_mom, bar_i);
       now_mom += bar_mom;
     }
 
   // use "int i" here, and gcc 2.7.2 hits internal compiler error
   int ii = check_begin_bar_i (now_mom, bar_i);
-  if  (ii)
+  if (ii)
     output_mudela_begin_bar (mudela_stream_r, now_mom, ii);
 
   //    bar_i = check_end_bar_i (now_mom, bar_i);
 
   Moment remain_mom = end_mom - Moment (end_bar_i - 1) * bar_mom;
-  if  (remain_mom > Moment (0))
+  if (remain_mom > Moment (0))
     {
       output_mudela_rest_remain (mudela_stream_r, remain_mom);
       now_mom += remain_mom;
@@ -211,24 +215,24 @@ Mudela_staff::output_mudela_rest (Mudela_stream& mudela_stream_r, Moment begin_m
 void
 Mudela_staff::output_mudela_rest_remain (Mudela_stream& mudela_stream_r, Moment mom)
 {
-  if  (Duration_convert::no_quantify_b_s)
+  if (Duration_convert::no_quantify_b_s)
     {
       Duration dur = Duration_convert::mom2_dur (mom);
-      mudela_stream_r << "r" << dur.str() << " ";
-      //       assert (mom == dur.mom());
-      assert (mom == dur.length());
+      mudela_stream_r << "r" << dur.str () << " ";
+      //       assert (mom == dur.mom ());
+      assert (mom == dur.length ());
       return;
     }
 
   Duration dur = Duration_convert::mom2standardised_dur (mom);
-  if  (dur.type_i_>-10)
-    mudela_stream_r << "r" << dur.str() << " ";
+  if (dur.type_i_>-10)
+    mudela_stream_r << "r" << dur.str () << " ";
 }
 #endif
 
 
 void
-Mudela_staff::process()
+Mudela_staff::process ()
 {
   /*
      group items into voices
@@ -239,10 +243,11 @@ Mudela_staff::process()
   mudela_time_signature_l_ = mudela_score_l_g->mudela_time_signature_l_;
   mudela_tempo_l_ = mudela_score_l_g->mudela_tempo_l_;
 
-  Link_list<Mudela_item*> items;
-  for  (PCursor<Mudela_item*> i (mudela_item_p_list_); i.ok(); i++)
-    items.bottom().add (*i);
+  Cons_list<Mudela_item> items;
+  for (Cons<Mudela_item>* i = mudela_item_p_list_.head_cons_p_; i; i = i->next_cons_p_)
+    //items.bottom ().add (*i);
+    items.append (new Cons<Mudela_item> (i->car_p_, 0));
 
-  while  (items.size())
+  while (!items.empty_b ())
     eat_voice (items);
 }
index 6f92d03f2257fd3a4e8258dba6db7d2c79f06d63..92c9b2ef3ef17954784ce5839274f9d4c90b10c0 100644 (file)
@@ -19,21 +19,21 @@ Mudela_voice::Mudela_voice (Mudela_staff* mudela_staff_l)
 void
 Mudela_voice::add_item (Mudela_item* mudela_item_l)
 {
-  mudela_item_l_list_.bottom().add (mudela_item_l);
+  mudela_item_l_list_.append (new Cons<Mudela_item> (mudela_item_l, 0));
 }
 
 Moment 
-Mudela_voice::begin_mom()
+Mudela_voice::begin_mom ()
 {
-  return mudela_item_l_list_.size() ? 
-    mudela_item_l_list_.top()->at_mom() : Moment (0);
+  return !mudela_item_l_list_.empty_b () ? 
+    mudela_item_l_list_.car_l ()->at_mom () : Moment (0);
 }
 
 Moment 
-Mudela_voice::end_mom()
+Mudela_voice::end_mom ()
 {
-  return mudela_item_l_list_.size() ? 
-    mudela_item_l_list_.bottom()->at_mom() : Moment (0);
+  return !mudela_item_l_list_.empty_b () ? 
+    mudela_item_l_list_.tail_car_l ()->at_mom () : Moment (0);
 }
 
 static int const FAIRLY_LONG_VOICE_i = 6;
@@ -41,37 +41,37 @@ static int const FAIRLY_LONG_VOICE_i = 6;
 void
 Mudela_voice::output (Mudela_stream& mudela_stream_r)
 {
-  if  (!mudela_item_l_list_.size())
+  if (mudela_item_l_list_.empty_b ())
     return;
   
-  if  (mudela_item_l_list_.size() > FAIRLY_LONG_VOICE_i)
+  if (mudela_item_l_list_.size_i () > FAIRLY_LONG_VOICE_i)
     mudela_stream_r << '\n';
 
   int current_bar_i = 0;
-  Moment bar_mom = mudela_staff_l_->mudela_time_signature_l_->bar_mom();
+  Moment bar_mom = mudela_staff_l_->mudela_time_signature_l_->bar_mom ();
 
-  for  (PCursor<Mudela_item*> i (mudela_item_l_list_); i.ok(); i++) 
+  for (Cons<Mudela_item>* i = mudela_item_l_list_.head_cons_p_; i; i = i->next_cons_p_)
     {
-      Moment at_mom = i->mudela_column_l_->at_mom();
+      Moment at_mom = i->car_p_->mudela_column_l_->at_mom ();
       int bar_i = (int) (at_mom / bar_mom) + 1;
-      if  (bar_i > current_bar_i) 
+      if (bar_i > current_bar_i) 
        {
-         if  (current_bar_i) 
+         if (current_bar_i) 
            {
-             if  (at_mom == Moment (bar_i - 1) * bar_mom)
+             if (at_mom == Moment (bar_i - 1) * bar_mom)
                mudela_stream_r << "|";
              mudela_stream_r << "\n% ";
              mudela_stream_r << String_convert::i2dec_str (bar_i, 0, ' ');
              mudela_stream_r << '\n';
            }
-         LOGOUT(NORMAL_ver) << "[" << bar_i << "]" << flush; 
+         LOGOUT (NORMAL_ver) << "[" << bar_i << "]" << flush; 
          current_bar_i = bar_i;
        }
 
-      mudela_stream_r << **i;
+      mudela_stream_r << *i->car_p_;
     }
 
-  if  (mudela_item_l_list_.size() > FAIRLY_LONG_VOICE_i)
+  if (mudela_item_l_list_.size_i () > FAIRLY_LONG_VOICE_i)
     mudela_stream_r << '\n';
 }
 
index 7d99a4b9205ab294a96327e02c9044a195de6429..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,32 +0,0 @@
-//
-// template.cc -- implementemplate
-// ugh: must have unique name for Cygnus' gcc:
-// liblily.a(template.o): In function `GLOBAL_$I$template.cc':
-// template.cc:28: multiple definition of `global constructors keyed to template.cc'
-//
-// copyright 1997 Jan Nieuwenhuizen <janneke@gnu.org>
-
-#include "proto.hh"
-#include "list.hh"
-#include "list.tcc"
-#include "cursor.tcc"
-
-class istream;
-class ostream;
-
-#include "mudela-item.hh"
-#include "mudela-column.hh"
-#include "mudela-staff.hh"
-#include "mudela-voice.hh"
-#include "mudela-staff.hh"
-#include "mudela-score.hh"
-#include "pcursor.hh"
-#include "plist.hh"
-#include "pcursor.tcc"
-#include "plist.tcc"
-
-POINTERLIST_INSTANTIATE(Mudela_item);
-POINTERLIST_INSTANTIATE(Mudela_staff);
-POINTERLIST_INSTANTIATE(Mudela_voice);
-POINTERLIST_INSTANTIATE(Mudela_column);
-POINTERLIST_INSTANTIATE(Mudela_score);