]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.59
authorfred <fred>
Sun, 24 Mar 2002 19:42:07 +0000 (19:42 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:42:07 +0000 (19:42 +0000)
Documentation/MANIFESTO.pod
init/register.ini
lily/include/note-column.hh
lily/include/slur.hh
lily/p-score.cc
lily/slur-reg.cc
lily/slur.cc

index 7808c4bb192be5b8125ff770ad64b0651ce93a8a..2ceaf525c1be5cdc2e216dc34927c4b3c883c241 100644 (file)
@@ -29,6 +29,11 @@ Generate high-quality output. Ideally it should be of a professional
 quality. We'd like to render Herbert Chlapiks words, "Fine music
 setting is not possible without a knowledgeable printer,"  untrue.
 
+=item *
+
+Make a  which system which fully tweakable. It should be possible to
+typeset a book on how not to typeset music. 
+
 =back 
 
 =head1 LILYPOND
index 4168de973dfe02102a7d4cb23d6fa3a28f4919a3..154800fdc7890b0f97d62452b5912176d6a196d9 100644 (file)
@@ -9,6 +9,7 @@ melodicregs = \inputregister {
        \inputregister {Local_key_register}
        \inputregister { Staff_sym_register }
        \inputregister { Collision_register }
+       \inputregister { Rest_collision_register }
        \inputregister {
                Voice_group_registers
                \inputregister { Dynamic_register }
@@ -16,9 +17,10 @@ melodicregs = \inputregister {
                \inputregister { Text_register }
                \inputregister { Script_register }
                \inputregister { Note_column_register }
+               \inputregister { Slur_register }
                \inputregister { Voice_registers
                        \inputregister { Notehead_register }
-                       \inputregister { Slur_register }
+                       \inputregister { Tie_register }
                }
        }
 }
index ba118fcbde3129209796df8302fb1c476113df91..b5af0185284e18a6bc6ed14b9d1352443548c155 100644 (file)
 /** a struct for treating a group of noteheads (noteheads, stem
   (chord) and scripts ) as a single entity.  */
 class Note_column : public Script_column {
-    /// link to the stem. For setting default direction
-    Stem * stem_l_;
     void do_pre_processing();
 public:
+        /// link to the stem. For setting default direction
+    Stem * stem_l_;
+
     bool h_shift_b_;
     
     Array<Notehead*> head_l_arr_;
index c8363075c4569bde2fe96e71f44b5fe628c84111..68f073e10f4d32f2ad4c48bc914002c335ef5474 100644 (file)
@@ -8,26 +8,21 @@
 #define SLUR_HH
 
 #include "directional-spanner.hh"
-#include "fproto.hh"
+#include "lily-proto.hh"
 #include "varray.hh"
+#include "bow.hh"
 
-struct Slur : Directional_spanner {
+class Slur : public Bow {
+public:
+    Array<Note_column*> encompass_arr_;
 
-    Array<Notehead*> encompass;
-
-    bool open_left, open_right;                        
-
-    /* *************** */
-    Offset center() const;
-    Slur();
     void do_post_processing();
     void do_pre_processing();
-    void add(Notehead*);
+    void add(Note_column*);
     void set_default_dir();
 
     Spanner* do_break_at( PCol*, PCol*) const; 
 private:
-    Molecule*brew_molecule_p()const;
     NAME_MEMBERS(Slur);
 };
 
index 6f1b3627658bc51e7092858c954d0d1ba64e79c5..37090b77dbb395e768c1c9850d976f8b6889c85c 100644 (file)
@@ -253,10 +253,10 @@ PScore::process()
 {
     clean_cols();
     print();
-    *mlog << "Preprocessing ... " <<flush;
+    *mlog << "Preprocessing elements... " <<flush;
     preprocess();
     *mlog << "\nCalculating column positions ... " <<flush;
     calc_breaking();
-    *mlog << "\nPostprocessing ..." << endl;
+    *mlog << "\nPostprocessing elements..." << endl;
     postprocess();
 }
index 9498dd4c7c2b667a6492959c22819957a7e0db9d..a9acf3b67bd70920ace3cd79e7ae0e134c9d4812 100644 (file)
 #include "slur-reg.hh"
 #include "slur.hh"
 #include "debug.hh"
-#include "notehead.hh"
+#include "note-column.hh"
+
+bool
+Slur_register::acceptable_request_b(Request*req_l)
+{
+    return req_l->musical() && req_l->musical()->slur();
+}
 
 bool
 Slur_register::try_request(Request *req_l)
@@ -26,12 +32,12 @@ Slur_register::try_request(Request *req_l)
 void
 Slur_register::acknowledge_element(Staff_elem_info info)
 {
-    if (info.elem_l_->name() == Notehead::static_name()) { 
-       Notehead *head_p =(Notehead*) info.elem_l_ ;// ugh
+    if (info.elem_l_->name() == Note_column::static_name()) { 
+       Note_column *col_l =(Note_column*) info.elem_l_ ;// ugh
        for (int i = 0; i < slur_l_stack_.size(); i++)
-           slur_l_stack_[i]->add(head_p );
+           slur_l_stack_[i]->add(col_l );
        for (int i = 0; i < end_slur_l_arr_.size(); i++)
-           end_slur_l_arr_[i]->add(head_p);
+           end_slur_l_arr_[i]->add(col_l);
     }
 }
 /*
index 6bc5c1b24b98082dc3f1e3911dba480842b277da..a47679a3f4fa7eabf6b97c2911b4e35ca5c0dc24 100644 (file)
@@ -1,3 +1,11 @@
+/*
+  slur.cc -- implement  Slur
+
+  source file of the LilyPond music typesetter
+
+  (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
 /*
 
   TODO:
@@ -10,7 +18,8 @@
 #include "scalar.hh"
 #include "lookup.hh"
 #include "paper-def.hh"
-#include "notehead.hh"
+#include "note-column.hh"
+#include "stem.hh"
 #include "p-col.hh"
 #include "molecule.hh"
 #include "debug.hh"
 
 
 
-Slur::Slur()
-{
-    open_right=open_left=false;
-}
-
-Offset
-Slur::center() const
-{
-    int pos1 = encompass.top()->position_i_;
-    int pos2 = encompass[0]->position_i_;
-
-    int dy =  pos1-pos2;
-
-    Real w = width().length();
-
-    return Offset(w/2,dy * paper()->internote());
-}
-
 void
-Slur::add(Notehead*n)
+Slur::add(Note_column*n)
 {
-    encompass.push(n);
+    encompass_arr_.push(n);
     add_dependency(n);
 }
 
 void
 Slur::set_default_dir()
 {
-    int sumpos=0;
-    for (int i=0; i < encompass.size(); i ++) {
-       sumpos += encompass[i]->position_i_;
+    dir_i_ = -1;
+    for (int i=0; i < encompass_arr_.size(); i ++) {
+       if (encompass_arr_[i]->dir_i_ < 0) {
+           dir_i_ =1;
+           break;
+       }
     }
-
-    /* should consult stems */
-    Real meanpos = sumpos/Real(encompass.size());
-    if (meanpos < 5)           // todo
-       dir_i_ = -1;
-    else
-       dir_i_ = 1;    
 }
 
 void
 Slur::do_pre_processing()
 {
-    right_col_l_  = encompass.top()->pcol_l_;
-    left_col_l_ = encompass[0]->pcol_l_;    
+    right_col_l_  = encompass_arr_.top()->pcol_l_;
+    left_col_l_ = encompass_arr_[0]->pcol_l_;    
 }
 
 Spanner*
@@ -72,16 +59,11 @@ Slur::do_break_at(PCol*l, PCol*r) const
     assert(l->line_l_ == r->line_l_);
     Slur*ret = new Slur(*this);
 
-    ret->encompass.set_size(0);
-    for (int i =0; i < encompass.size(); i++) {
-       if (encompass[i]->pcol_l_->line_l_==l->line_l_)
-           ret->encompass.push(encompass[i]);
+    ret->encompass_arr_.set_size(0);
+    for (int i =0; i < encompass_arr_.size(); i++) {
+       if (encompass_arr_[i]->pcol_l_->line_l_==l->line_l_)
+           ret->encompass_arr_.push(encompass_arr_[i]);
     }
-    if (right_col_l_ != r)
-       ret->open_right = true;
-    if (left_col_l_ != l)
-       ret->open_left = true;
-
 
     return ret;
 }
@@ -91,49 +73,8 @@ Slur::do_post_processing()
 {
     if (!dir_i_)
        set_default_dir();
+    Real inter_f = paper()->internote();
+    left_pos_i_ = encompass_arr_[0]->stem_l_->height()[dir_i_]/inter_f;
+    right_pos_i_ = encompass_arr_.top()->stem_l_->height()[dir_i_]/inter_f;
 }
-
-Molecule*
-Slur::brew_molecule_p() const
-{
-    Molecule*output = new Molecule;
-
-    int minp=1000, maxp=-1000; // todo    
-    for (int i=0; i<encompass.size(); i++) {
-       minp = encompass[i]->position_i_ <? minp;
-       maxp = encompass[i]->position_i_ >? maxp;
-    }
-    assert(encompass.size()>0);        // todo
-    
-    Notehead *lnote_p =encompass[0];
-    Notehead *rnote_p =encompass.top();
-    int lpos_i = lnote_p->position_i_;
-    int rpos_i = rnote_p->position_i_;
-    Offset  left_off(lnote_p->x_dir_i_, lpos_i + 2*dir_i_);
-    Offset right_off(lnote_p->x_dir_i_, rpos_i + 2*dir_i_);
-    if (!lnote_p->extremal_i_)
-       left_off += Offset(0.5, -dir_i_);
-    if (!rnote_p->extremal_i_)
-       right_off+= Offset(-0.5, -dir_i_);
-    
-    int dy = int(right_off.y - left_off.y);
-    
-    Real nw_f = paper()->note_width();
-    Real nh_f = paper()->internote();
-    Real w = width().length();
-    
-    w+= (right_off.x - left_off.x) * nw_f ;
-    Real round_w = w;          // slur lookup rounds the slurwidth .
-    
-    Symbol sl = paper()->lookup_l()->slur(dy , round_w, dir_i_);
-
-    Real error = w-round_w;
-    
-    Atom a(sl);
-    a.translate(Offset((left_off.x + 0.5 )*nw_f + error/2,
-                      left_off.y * nh_f));
-    output->add(a);
-    return output;
-}
-
 IMPLEMENT_STATIC_NAME(Slur);