]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.3.90
authorfred <fred>
Tue, 26 Mar 2002 23:56:03 +0000 (23:56 +0000)
committerfred <fred>
Tue, 26 Mar 2002 23:56:03 +0000 (23:56 +0000)
20 files changed:
input/bugs/different-time.ly
input/bugs/volta.ly
input/scarlatti-paper.ly
input/scarlatti-properties.ly
input/test/auto-change.ly
lily/auto-change-iterator.cc
lily/include/auto-change-iterator.hh
lily/include/beam.hh
lily/include/lily-proto.hh
lily/include/music-iterator.hh
lily/include/musical-request.hh
lily/include/simultaneous-music-iterator.hh
lily/include/slur.hh
lily/note-heads-engraver.cc
lily/rest-engraver.cc
lily/sequential-music-iterator.cc
lily/side-position-interface.cc
lily/simultaneous-music-iterator.cc
ly/property.ly
mutopia/E.Satie/gnossienne-4.ly

index 9733e50271fb8b7fcce5a7566dded87317ce8d17..927fd1af096c409b920d1d845b781492ef3dada4 100644 (file)
@@ -1,3 +1,6 @@
+%
+% irregular spacing.
+
 \score{
     \context PianoStaff <
         \context Staff = upper \notes\relative c''{
index 48889cf91a22095b5e11509ec22a71db8cba21cb..c7d9f933c7ab75320dbe9151cad3829a7eac9d4a 100644 (file)
@@ -17,7 +17,7 @@ voice4 = \notes {
 }
 voicedefault = \notes {
  \property Staff.timeSignatureStyle="C"
- \time 4/4; \key f; 
+ \time 4/4; \key f \major;  
  \tempo 4 = 200;
 }
 \score{
index 8ed8e1e2a79bfec9b04d124da421923dd6f2638a..983c51bfdb5d9ef6eb6ff1f818cff42b2dcb4d7d 100644 (file)
@@ -11,8 +11,8 @@
        forced_stem_shorten3=0.;
        \translator{
                \PianoStaffContext
-               maxVerticalAlign=42.\pt;
-               minVerticalAlign=42.\pt;
+               maxVerticalAlign=8.4;
+               minVerticalAlign=8.4;
        }
        \translator{\StaffContext
        timeSignatureStyle="C";}
index 651de9a37b7c97dde0392acdbf16022feed10948..53b117680d7751e0c0fb738f7030efb6fbff4c21 100644 (file)
@@ -7,8 +7,12 @@ rh=\property Thread.noteHeadStyle=##f
 lh=\property Thread.noteHeadStyle = #'diamond
 n=\property Thread.fontSize=#0  
 sm=\property Thread.fontSize=#-1 
-su=\property Voice.verticalDirection=#1  
-sd=\property Voice.verticalDirection=#-1
+% su=\property Voice.verticalDirection=#1  
+% sd=\property Voice.verticalDirection=#-1
+
+su=\property Voice.basicStemProperties \push #'direction = #1
+sd=\property Voice.basicStemProperties \push #'direction = #-1  
+
 zs=\property Voice.forceHorizontalShift=#0.0
 ls=\property Voice.forceHorizontalShift=#-0.6
 sls=\property Voice.forceHorizontalShift=#-0.22
index 3a27cbe163512fd67a715548abd5a694c28c4830..5d3d34f8e4a36556e77b1c802b8fee8bbe68da56 100644 (file)
@@ -2,7 +2,7 @@
 \score {
        \notes \context PianoStaff <
        \context Staff = "up" {
-               \autochange Staff \relative c' { g4 a  b c d e f g }
+               \autochange Staff \context Voice = VA < \relative c' { g4 a  b c d r4 a g } >
        }
        \context Staff = "down" {
                \clef bass; 
index cd4a350c85267b0d02cccd0afa940ce8417c2d43..cf291348c0695d8c6ea984aa44d0a01dee467c7e 100644 (file)
@@ -66,21 +66,58 @@ Auto_change_iterator::change_to (Music_iterator *it, String to_type,
 
 }
 
-Pitch_interrogate_req* spanish_inquisition; // nobody expects it
+/*
+  Look ahead to find first pitches to determine staff position.
+  WARNING: this means that
 
-void
-Auto_change_iterator::process (Moment m)
+  \autochange Staff \notes { .... \context Staff = otherstaff { .. } .. }
+
+  will confuse the autochanger, since it will not notice that the
+  music for OTHERSTAFF is not his.
+
+  PRECONDITION: this->ok() holds.
+*/
+Array<Musical_pitch>
+Auto_change_iterator::pending_pitch (Moment m) const
 {
-  Music_wrapper_iterator::process (m);
+  Music_iterator * iter = child_iter_p_ ->clone ();
+  Array<Musical_pitch> ps;
+  while (1)
+    {
+      SCM muses = iter->get_music (m);
+      for (SCM s = muses; gh_pair_p (s); s=gh_cdr (s))
+       if (Note_req* nr = dynamic_cast<Note_req*> (unsmob_music (gh_car (s))))
+         {
+           ps.push (nr->pitch_);
+         }
+
+      if (ps.size ())
+       break;
+
+      iter->skip (m);
+      if (!iter->ok())
+       break;
+      
+      m = iter->pending_moment ();
+    }
 
-  if (!spanish_inquisition)
-    spanish_inquisition = new Pitch_interrogate_req;
+  delete iter;
+  return ps;
+}
 
-  Music_iterator *it = try_music (spanish_inquisition);
+void
+Auto_change_iterator::process (Moment m)
+{
+  /*
+    first we get the pitches, then we do the real work.
+    Music_wrapper_iterator::process() might process (and throw away)
+    pitches we need.  */
+  Array<Musical_pitch> ps = pending_pitch (m);
 
-  if (it && spanish_inquisition->pitch_arr_.size ())
+  Music_wrapper_iterator::process (m);
+  if (ps.size ())
     {
-      Musical_pitch p = spanish_inquisition->pitch_arr_[0];
+      Musical_pitch p = ps[0];
       Direction s = Direction (sign(p.steps ()));
       if (s != where_dir_)
        {
@@ -88,11 +125,9 @@ Auto_change_iterator::process (Moment m)
          String to_id =  (s >= 0) ?  "up" : "down";
          Auto_change_music const * auto_mus = dynamic_cast<Auto_change_music const* > (music_l_);
 
-         change_to (it, auto_mus->what_str_, to_id);     
+         change_to (child_iter_p_, auto_mus->what_str_, to_id);          
        }
     }
-
-  spanish_inquisition->pitch_arr_.clear ();
 }
 
 Auto_change_iterator::Auto_change_iterator( )
index 72b463c7efa39bd7ee6aea96f5ec4f420ddeb72b..ac3c8dbd6d752055c911a588021452793846d5d0 100644 (file)
@@ -22,7 +22,11 @@ public:
 protected:
   virtual void process (Moment);  
 
+
+  Array<Musical_pitch> pending_pitch (Moment)const;
 private:
+
+  
   Direction where_dir_;
   void change_to (Music_iterator* , String, String);
 };
index cd917f8d60c4d0f2add069551df003347a41a0df..3ed32fae68a1cdd4928890ba64e511ecd93649b9 100644 (file)
 
    height -- real  (dy)
 
-   damping -- amount of beam slope damping. (int)
-   should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams 
-
-
-   molecule-callback --
 
-   beam-thickness -- weight of beams, in staffspace
+   Read-only
+   =========
+   
+   flag-width-function --
 
-   beam-space-function -- function of type multiplicity -> real (in staffspace)
+   damping -- amount of beam slope damping. (int)
+     should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams 
 
    default-neutral-direction -- which direction to choose if we're in
      the middle of the staff
    
-   after-line-breaking-callback --
+   thickness -- weight of beams, in staffspace
+
+   space-function -- function of type multiplicity -> real (in staffspace)
 
+   beamed-stem-shorten --
+
+   height-quants --
+
+   vertical-position-quant-function --
+
+   dir-function --
+   
    damping -- damping factor (real).
 
    outer-stem-length-limit -- catch suspect beam slopes, set slope to zero if
      outer stem is lengthened more than this (in staffspace)
 
    slope-limit -- set slope to zero if slope is running away steeper than this.
-
 */
 class Beam
 {
index d0de6ff36ba6834d7bd273dc8f3e07ba00b77b3f..b1673f79f1ffb24e5818334d7df02ff40003f4b0 100644 (file)
@@ -132,7 +132,7 @@ class Performance;
 class Performer;
 class Performer_group_performer;
 class Piano_bar_engraver;
-class Pitch_interrogate_req;
+
 class Pitch_squash_engraver;
 class Property_iterator;
 class Rational;
index 1709a5d8e81bec1c212171f594cd8b45438904fd..43d39505d7687b9d3dfb6e432b0eb04da4e46bbe 100644 (file)
   ok () -- events left ?
 
   pending_mom () -- time tag of the next event to be processed.
+    PRECONDITION: this->ok() holds.
   
-  process (M) -- process all at M (Precondition: no events exist before
-    M).  Side-effects:
+  process (M) -- process all at M (Precondition: no events exist
+    before M, this->ok() holds).  Side-effects:
     
     * This removes all events at M from the pending queue.
 
@@ -43,7 +44,7 @@
 
   TODO:
 
-  merge pending_moment and process.
+  merge pending_moment and process?
   
 */
 class Music_iterator
@@ -55,8 +56,6 @@ public:
   VIRTUAL_COPY_CONS (Music_iterator);
 
   Moment music_length_mom () const;
-
-  
   Music_iterator ();
   Music_iterator (Music_iterator const&);
   virtual ~Music_iterator ();
index 7b431130276a424bcc8eaac9e7eb026a3d1be5ab..ee5728441c41752f5e6f4828c3c9f0f66c84a084 100644 (file)
@@ -157,25 +157,6 @@ public:
   VIRTUAL_COPY_CONS (Music);
 };
 
-/**
-   What pitches have ben acked ?
- */
-class Pitch_interrogate_req : public Request
-{
-public:
-  Array<Musical_pitch> pitch_arr_;
-  VIRTUAL_COPY_CONS (Music);
-};
-
-/**
-   What rhythms have ben acked ?
- */
-class Rhythm_interrogate_req : public Request
-{
-public:
-  Array<Duration> duration_arr_;
-  VIRTUAL_COPY_CONS (Music);
-};
 
 
 /**
index e5ecdcd14bf386ee75bbb5e50b25c3441b3c7ee9..1198a7dc84b1527585b67f452c13b3d55c3e9040 100644 (file)
@@ -29,6 +29,7 @@ public:
   virtual Moment pending_moment () const;
   virtual bool ok () const;
   virtual SCM get_music (Moment)const;
+  virtual void skip (Moment);
 
 protected:
   virtual void process (Moment);
index 349b549dad355254ec9b8562d7c84f6ed6cf58f2..44e4ffaccf0d3c92b12f1c01fc139f37c072d7d0 100644 (file)
 
    y-free -- ? 
    
- */
+   control-points --
+
+
+   
+   Read-only
+   =========
+   
+   extremity-rules --
+
+   extremity-offset-alist --
+
+   thickness --
+
+*/
 class Slur
 {
 public:
index c7ad380cac8c99bc6bb37cae0f7fc575a3dac54b..30ccf6e490b1c577a404a6a305e981cb2189541e 100644 (file)
@@ -68,18 +68,6 @@ Note_heads_engraver::do_try_music (Music *m)
     {
       return now_mom () < note_end_mom_;
     }
-  else if (Pitch_interrogate_req *p = dynamic_cast<Pitch_interrogate_req*> (m))
-    {
-      for (int i= note_req_l_arr_.size (); i--;)
-       p->pitch_arr_.push (note_req_l_arr_[i]->pitch_); // GUH UGH UGHUGH.
-      return true;
-    }
-  else if (Rhythm_interrogate_req *r = dynamic_cast<Rhythm_interrogate_req*> (m))
-    {
-      for (int i= note_req_l_arr_.size (); i--;)
-       r->duration_arr_.push (note_req_l_arr_[i]->duration_); // GUH UGH UGHUGH.
-      return true;
-    }
   return false;
   
 }
index 23ff6e776bef31628581a19dec2c6de147d8f62d..40cba4eb9102d4d3a7a1559b87518d887d76fa62 100644 (file)
@@ -99,12 +99,6 @@ Rest_engraver::do_try_music (Music *m)
       rest_req_l_ = r;
       return true;
     }  
-  else if (Rhythm_interrogate_req *r = dynamic_cast<Rhythm_interrogate_req*> (m))
-    {
-      if (rest_req_l_)
-       r->duration_arr_.push (rest_req_l_->duration_); // GUH UGH UGHUGH.
-      return true;
-    }
   return false;
 }
 
index bfeb3cd9254c92f01d42cf0d7fbb5971907a2e86..de480844e5b105677b42830671a8caa56cf1f37c 100644 (file)
@@ -32,14 +32,7 @@ Sequential_music_iterator::Sequential_music_iterator (Sequential_music_iterator
 
 Sequential_music_iterator::~Sequential_music_iterator()
 {
-  if (iter_p_)
-    {
-#if 0
-      if (iter_p_->ok () )
-       music_l_->origin ()->warning (_ ("Must stop before this music ends"));
-#endif
-      delete iter_p_;
-    }
+  delete iter_p_;
 }
 
 void
@@ -81,25 +74,19 @@ Sequential_music_iterator::descend_to_child ()
 
 
 /*
+  Retrieve all music (starting at HERE), until a music with length L >
+  0 is found.  From the precondition, we know that UNTIL is later than
+  the earliest event. Hence we know
   
-  
-  Hier staat in feite: haal alle muziek op (startend op tijd HERE) tot
-  je iets met lengte L > 0 tegenkomt.  Aangezien de preconditie is dat
-  UNTIL het eerstvolgende event is, weet je (per definitie)
-
   L >= (UNTIL - HERE)
 
-  en iets wat hierna komt (op tijd T) komt dus na tijd
+  so something that comes after this thing with L > 0 happens after
 
   HERE + L >= HERE + (UNTIL - HERE) = UNTIL
 
-  Dus als je een L>0 tegenkomt, wil je de rest niet meer. Aangezien
-  alles wat tot nu toe hebt gespaard op HERE begint, is dat precies wat
-  je nodig hebt.
-
-  Misschien kan je deze comment erbij stoppen, en moeten we de
-  eigenschappen van het muziek datatype wat formaliseren, zodat deze
-  redenering helderder is.
+  Hence all events after the one with L>0 are uninteresting, so we
+  ignore them.
+  
 */
 
 SCM
@@ -142,7 +129,6 @@ Sequential_music_iterator::get_music (Moment until)const
 void
 Sequential_music_iterator::skip (Moment until)
 {
-  SCM curs = cursor_;
   while (1)
     {
       Moment l =iter_p_->music_length_mom ();
@@ -156,12 +142,12 @@ Sequential_music_iterator::skip (Moment until)
       delete iter_p_;
       iter_p_ =0;
 
-      curs = gh_cdr (curs);
+      cursor_ = gh_cdr (cursor_);
 
-      if (!gh_pair_p (curs))
+      if (!gh_pair_p (cursor_))
        return ;
       else
-       iter_p_ = get_iterator_p (unsmob_music (gh_car (curs)));
+       iter_p_ = get_iterator_p (unsmob_music (gh_car (cursor_)));
     }
 }
 
index e82bf70465d60084707dab3d3db906cd9f261a0c..bfb4ff7d844331814ef0709e6b52ef43aa46f20c 100644 (file)
@@ -148,7 +148,10 @@ directed_round (Real f, Direction d)
 
 /*
   Callback that quantises in staff-spaces, rounding in the direction
-  of the elements "direction" elt property. */
+  of the elements "direction" elt property.
+
+  Only rounds when we're inside the staff, as determined by
+  Staff_symbol_referencer::staff_radius() */
 Real
 Side_position::quantised_position (Score_element *me, Axis )
 {
@@ -158,9 +161,10 @@ Side_position::quantised_position (Score_element *me, Axis )
     {
       Real p = Staff_symbol_referencer::position_f (me);
       Real rp = directed_round (p, d);
-
+      Real rad = Staff_symbol_referencer::staff_radius (me) *2 ;
       int ip = int  (rp);
-      if ((ip % 2) == 0)
+
+      if (abs (ip) < rad && (ip % 2) == 0)
        {
          ip += d;
          rp += d;
index f860241448d502217871bbe109fe6edea643a556..4cc8d0c31623cc8bfa0d82776dfb38095046947a 100644 (file)
 Simultaneous_music_iterator::Simultaneous_music_iterator ()
 {
   separate_contexts_b_ = false;
-  cursor_i_ = 0;
 }
 
 Simultaneous_music_iterator::Simultaneous_music_iterator (Simultaneous_music_iterator const& src)
   : Music_iterator (src)
 {
-  cursor_i_ = src.cursor_i_;
   separate_contexts_b_ = src.separate_contexts_b_;
-  for (Cons<Music_iterator> *p = children_p_list_.head_; p; p = p->next_)
+  for (Cons<Music_iterator> *p = src.children_p_list_.head_; p; p = p->next_)
     {
       Music_iterator *i = p->car_;
       children_p_list_.append (new Killing_cons<Music_iterator> (i->clone (), 0));
@@ -35,12 +33,6 @@ Simultaneous_music_iterator::~Simultaneous_music_iterator ()
   children_p_list_.junk ();
 }
 
-/*
-  Should roll next () into this as well
-
-
-  huh? --hwn
- */
 SCM
 Simultaneous_music_iterator::get_music (Moment m)const
 {
@@ -105,6 +97,23 @@ Simultaneous_music_iterator::process (Moment until)
     }
 }
 
+void
+Simultaneous_music_iterator::skip (Moment until)
+{
+  for (Cons<Music_iterator> **pp = &children_p_list_.head_; *pp;)
+    {
+      Music_iterator * i = (*pp)->car_;
+      if (i->pending_moment() <= until) 
+       {
+         i->skip (until);
+       }
+      if (!i->ok())
+       delete children_p_list_.remove_cons (pp);
+      else
+       pp = &(*pp)->next_;
+    }
+}
+
 Moment
 Simultaneous_music_iterator::pending_moment() const
 {
@@ -132,3 +141,5 @@ Simultaneous_music_iterator::try_music_in_children (Music *m) const
     b =p->car_->try_music (m);
   return b;
 }
+
+
index cfed38993a5430c0ec5d12728bd242468b654fad..0ac31ec8c632622e91d65a7790decad9f36447a4 100644 (file)
@@ -10,13 +10,16 @@ SEE THE REFERENCE MANUAL FOR EXPLANATIONS.
 
 \version "1.3.59";
 
-%hmm, (these) abbrevs suck, imo
-% i guess they're meant as some form of doco
-% that's what i use them for...
 
+%{
 stemup =        \property Voice.verticalDirection = \up 
 stemboth=      \property Voice.verticalDirection = \center
 stemdown =     \property Voice.verticalDirection = \down
+%}
+
+stemup = \property Voice.basicStemProperties \push #'direction = #1
+stemdown = \property Voice.basicStemProperties \push #'direction = #-1 
+stemboth= \property basicStemProperties \pop #'direction
 
 slurup   = \property Voice.slurVerticalDirection = \up 
 slurboth = \property Voice.slurVerticalDirection = \center
index f3a510c59be7ff9e7eedd142b939f618222d7f27..5b10edcb16d4239da733502e412894d26519f41e 100644 (file)
@@ -61,41 +61,41 @@ basloopje = \notes\relative c{
   d,8( a' d f a d f d a f d )a
 }
 
-accompany = \notes \relative c{
+accompany = \notes \relative c {
   % snapnie, hoevaak relative c heeft ze nodig?
 \notes\relative c \basloopje
 \notes\relative c \basloopje
 \notes\relative c \basloopje
-  \transpose bes \notes\relative c{ \basloopje }
-  \transpose bes \notes\relative c{ \basloopje }
-  \notes\relative c \basloopje
-  \transpose bes \notes\relative c{ \basloopje }
-  \transpose bes \notes\relative c{ \basloopje }
-  \transpose a \notes\relative c{ \basloopje }
-  \transpose bes \notes\relative c{ \basloopje }
-  \transpose a \notes\relative c{ \basloopje }
 \notes\relative c \basloopje
 \notes\relative c \basloopje
+ \basloopje
+ \basloopje
+ \basloopje
+  \transpose bes  \basloopje 
+  \transpose bes  \basloopje 
+   \basloopje
+  \transpose bes  \basloopje 
+  \transpose bes  \basloopje 
+  \transpose a  \basloopje 
+  \transpose bes  \basloopje 
+  \transpose a  \basloopje 
+ \basloopje
+ \basloopje
   % huh? d'
-  \transpose d' \notes\relative c{ \basloopje }
 \notes\relative c \basloopje
 \notes\relative c \basloopje
-  \transpose d' \notes\relative c{ \basloopje }
 \notes\relative c \basloopje
 \notes\relative c \basloopje
-  \transpose e' \notes\relative c{ \basloopje }
 \notes\relative c \basloopje
 \notes\relative c \basloopje
-  \transpose bes \notes\relative c{ \basloopje }
-  \transpose a \notes\relative c{ \basloopje }
 \notes\relative c \basloopje
 \notes\relative c \basloopje
-  \transpose d' \notes\relative c{ \basloopje }
 \notes\relative c \basloopje
-  \transpose d' \notes\relative c{ \basloopje }
 \notes\relative c \basloopje
 \notes\relative c \basloopje
-  \transpose e' \notes\relative c{ \basloopje }
+  \transpose d'  \basloopje 
+ \basloopje
+ \basloopje
+  \transpose d'  \basloopje 
+ \basloopje
+ \basloopje
+  \transpose e'  \basloopje 
+ \basloopje
+ \basloopje
+  \transpose bes  \basloopje 
+  \transpose a  \basloopje 
+ \basloopje
+ \basloopje
+  \transpose d'  \basloopje 
+ \basloopje
+  \transpose d'  \basloopje 
+ \basloopje
+ \basloopje
+  \transpose e'  \basloopje 
   < e1*6/4 b' e> ~ < e b' e> 
 }
 
@@ -104,15 +104,16 @@ accompany = \notes \relative c{
                \context Staff=up < 
                        \global
                        \context Voice=foo {
-                       \property Voice.verticalDirection = #1
-                       \property Voice.scriptVerticalDirection = #1
+                       \stemup
+                       \property Voice.basicScriptProperties \push #'direction = #1
+                       
                        \melody 
                        }
                >
                \context Staff=down <
                        \global
                        \clef bass;
-                       \autochange Staff \accompany
+                       \autochange Staff \context Voice \accompany
                >
        >