]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.6
authorfred <fred>
Sat, 2 Nov 1996 15:04:44 +0000 (15:04 +0000)
committerfred <fred>
Sat, 2 Nov 1996 15:04:44 +0000 (15:04 +0000)
note.cc
request.hh

diff --git a/note.cc b/note.cc
index 2307729a3cf4ed7935c35fd8c8066d6a366f7697..bb0702f1433eff9c61459a0593f3969ed9e141ac 100644 (file)
--- a/note.cc
+++ b/note.cc
@@ -63,8 +63,6 @@ parse_pitch( const char *a, int &j, int &oct, bool & overide_acc,
        }
 
     
-    mtor << "ov " << overide_acc;
-    
     // notename.
     String nm;
     while (isalpha(a[j])) 
@@ -78,8 +76,9 @@ parse_pitch( const char *a, int &j, int &oct, bool & overide_acc,
        }
         
 
-    lookup_notename(large,small,nm);    
-    mtor << "int "<< large <<" "<<small<<" ";    
+    lookup_notename(large,small,nm);
+    mtor << "override: " << overide_acc;    
+    mtor << "pitch "<< large <<", "<<small<<"\n";    
 }
 
 
@@ -98,13 +97,18 @@ get_note_element(String pitch, String durstr)
     int oct, pit, acc;
     bool forceacc;
     parse_pitch(pitch, i, oct, forceacc, pit, acc);
-
+    char nm =  pit + 'c';
+    if (nm > 'g')
+       nm += 'a' - 'h';
+    rq->name =nm;
+    
     rq->octave = oct;
     rq->accidental = acc;
     rq->forceacc = forceacc;
     rq->balltype = dur;
     rq->dots = dots;
     
+    rq->print();
 
     v->add(rq);
     return v;
@@ -124,7 +128,7 @@ get_rest_element(String, String durstr)
   
     rq->balltype = dur;
     rq->dots = dots;    
-
+    rq->print();
     v->add(rq);
     return v;
 }
index f2dc5f7144f2c6eb3473f965ba9f78815a4df2e2..8ebb1468c01ad316c5df4c90104d87f06b68d841 100644 (file)
@@ -5,14 +5,12 @@
 #include "glob.hh"
 #include "string.hh"
 
+/// a voice element wants something printed
 struct Request {
     Voice_element*elt;
-#if 0
-    enum {
-       UNKNOWN, NOTE, REST, LYRIC, SCRIPT, CHORD, BEAM,
-       BRACKET, STEM, SLUR, CRESC, DECRESC, ABSDYNAMIC
-    } tag;
-#endif
+    
+    /****************/
+
     virtual void print()const ;
     virtual Note_req *note() {return 0;}
     virtual Rest_req *rest() {return 0;}
@@ -53,12 +51,17 @@ struct Request {
     beams/stems to look up the balls it has to connect to.  */
        
 
+/// a request with a duration
 struct Rhythmic_req : Request {
     int balltype;
     int dots;
+    
+    /****************/
+
     Real duration() const;
     Rhythmic_req(Voice_element*);
-    Rhythmic_req*rhythmic() { return this;} 
+    Rhythmic_req*rhythmic() { return this;}
+    void print ()const;
 };
 
 /// Put a note of specified type, height, and with accidental on the staff.
@@ -67,8 +70,14 @@ struct Note_req : Rhythmic_req {
     int octave;
     int accidental;
     bool forceacc;
+    
+    /****************/
+
+    // return height from central c (in halflines)
+    int height()const; 
     Note_req(Voice_element*v);
     Note_req*note() { return this;}
+    virtual void print() const;
 };
 /**
 Staff has to decide if the ball should be hanging left or right. This
@@ -83,7 +92,7 @@ based on ottava commands and the appropriate clef.
 
 ///Put a rest on the staff.
 struct Rest_req : Rhythmic_req {
-
+    void print()const;
     Rest_req(Voice_element*v) : Rhythmic_req(v) {  }
     Rest_req * rest() { return this;}
 };