]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.1.2
authorfred <fred>
Tue, 26 Mar 2002 21:28:45 +0000 (21:28 +0000)
committerfred <fred>
Tue, 26 Mar 2002 21:28:45 +0000 (21:28 +0000)
Documentation/COPERTINA.in
lily/lookup.cc

index 664aec837e71ca749212daba5ca358a3216f0e89..5344413eca3f8e2a27c99ea01a58a5b3519169dc 100644 (file)
@@ -1,7 +1,8 @@
-LilyPond è il tipografo musicale del progetto GNU.   Questo programma è
-fatto per stampare belle partiture da un documento definito per musica.
-Può anche suonare le prestazioni meccaniche ad un documento MIDI.  Le
-caratteristiche includono i personali multipli, tester, chiavi, suoni,
-lirica, lingua potente dell' input, cadenze, fasci, archi, tripletti,
-segni di formattazione, estrazione delle parte.  È compresa una seria 
-completa di caratteri musicali.
+LilyPond è il tipografo musicale del progetto GNU. Questo programma
+puo' stampare delle belle partiture a partire da un documento di
+definizioni musicali. Puo' anche creare meccaniche rappresentazioni
+della partitura in un documento in formato MIDI. Le caratteristiche del
+programma includono pentagrammi multipli, segni di divisione, chiavi,
+tasti, parole, versatile linguaggio di definizione, cadenze, legature,
+acciaccature, terzine, segni di formattazione, estrazione delle
+parte. è compresa una seria completa di caratteri musicali.
index c763bb56e1a97ad8093477232ae0fd5bd2faca02..8e1f4f1702ee700565280f6d3faabce9193a3ecd 100644 (file)
@@ -53,10 +53,20 @@ Lookup::~Lookup ()
   delete symtables_p_;
 }
 
-Atom
-Lookup::accidental (int j) const
+Molecule
+Lookup::accidental (int j, bool cautionary) const
 {
-  return afm_find (String ("accidentals") + String ("-") + to_str (j));
+  Molecule m(afm_find (String ("accidentals") + String ("-") + to_str (j)));
+  if (cautionary) 
+    {
+      m.add_at_edge(X_AXIS, LEFT, 
+                    Molecule(afm_find (String ("accidentals") + String ("-("))))
+;
+      m.add_at_edge(X_AXIS, RIGHT, 
+                    Molecule(afm_find (String ("accidentals") + String ("-)"))))
+;
+    }
+  return m;
 }
 
 void
@@ -66,7 +76,7 @@ Lookup::add (String s, Symtable*p)
 }
 
 Atom
-Lookup::afm_find (String s) const
+Lookup::afm_find (String s, bool warn) const
 {
   if (!afm_p_)
     {
@@ -75,7 +85,7 @@ Lookup::afm_find (String s) const
       *mlog << "]" << flush ;
       DOUT << this->afm_p_->str ();
     }
-  Adobe_font_char_metric m = afm_p_->find_char (s);
+  Adobe_font_char_metric m = afm_p_->find_char (s, warn);
 
   Atom a;
   if (m.code () < 0)
@@ -87,6 +97,7 @@ Lookup::afm_find (String s) const
   Array<Real> arr;
   arr.push (m.code ());
   a.lambda_ =  (lambda_scm ("char", arr));
+  a.str_ = "afm_find: " + s;
   a.font_ = font_;
   return a;
 }
@@ -107,6 +118,7 @@ Lookup::bar (String str, Real h) const
   arr.push (h);
   Atom a = (*symtables_p_) ("bars")->lookup (str);
   a.lambda_ =  (lambda_scm (a.str_, arr));
+  a.str_ = "bar";
   a.dim_.y () = Interval (-h/2, h/2);
   a.font_ = font_;
   return a;
@@ -126,6 +138,7 @@ Lookup::beam (Real slope, Real width, Real thick) const
 
   Atom a;
   a.lambda_ =  (lambda_scm ("beam", arr));
+  a.str_ = "beam";
   a.dim_[X_AXIS] = Interval (0, width);
   a.dim_[Y_AXIS] = Interval (min_y, max_y);
   return a;
@@ -162,6 +175,7 @@ Lookup::dashed_slur (Array<Offset> controls, Real thick, Real dash) const
     gh_cons (ly_list2 (gh_double2scm (controls[0].x ()), gh_double2scm (controls[0].y ())),
     SCM_EOL))))))))))));
 
+  a.str_ = "dashed_slur";
   return a;
 }
 
@@ -189,7 +203,8 @@ Atom
 Lookup::flag (int j, Direction d) const
 {
   char c = (d == UP) ? 'u' : 'd';
-  return afm_find (String ("flags") + String ("-") + to_str (c) + to_str (j));
+  Atom a = afm_find (String ("flags") + String ("-") + to_str (c) + to_str (j));
+  return a;
 }
 
 void
@@ -212,14 +227,15 @@ Lookup::rest (int j, bool o) const
 Atom
 Lookup::rule_symbol (Real height, Real width) const
 {
-  Atom bs= (*symtables_p_) ("param")->lookup ("rule");
-  Array<Real> args;
-  args.push (height);
-  args.push (width);
-  bs.lambda_ =  (lambda_scm (bs.str_, args));
-  bs.dim_.x () = Interval (0, width);
-  bs.dim_.y () = Interval (0, height);
-  return bs;
+  Atom a = (*symtables_p_) ("param")->lookup ("rule");
+  Array<Real> arr;
+  arr.push (height);
+  arr.push (width);
+  a.lambda_ = (lambda_scm (a.str_, arr));
+  a.str_ = "rule_symbol";
+  a.dim_.x () = Interval (0, width);
+  a.dim_.y () = Interval (0, height);
+  return a;
 }
 
 Atom
@@ -229,24 +245,20 @@ Lookup::script (String str) const
 }
 
 Atom
-Lookup::special_time_signature (String s, Array<Real> arr) const
+Lookup::special_time_signature (String s, Array<int> arr) const
 {
-  String symbolname = "timesig-" + s;
-  if (!arr.empty ())
-    symbolname += to_str (arr[0]);
-  if (arr.size () >1)
-    symbolname += "/" + to_str (arr[1]);
+  // First guess: s contains only the signature style
+  assert (arr.size () >1);
+  String symbolname = "timesig-" + s + to_str (arr[0]) + "/" + to_str (arr[1]);
   
-  Atom a = afm_find (symbolname);
+  Atom a = afm_find (symbolname, false);
   if (!a.empty ()) 
     return a;
 
-#if 0 //guess we covered this
-  // Try if the full name was given
-  a = afm_find ("timesig-"+s);
+  // Second guess: s contains the full signature name
+  a = afm_find ("timesig-"+s, false);
   if (!a.empty ()) 
     return a;
-#endif
 
   // Resort to default layout with numbers
   return time_signature (arr);
@@ -261,22 +273,23 @@ Lookup::stem (Real y1, Real y2) const
       y1 = y2;
       y2 = t;
     }
-  Atom s;
+  Atom a;
 
-  s.dim_.x () = Interval (0,0);
-  s.dim_.y () = Interval (y1,y2);
+  a.dim_.x () = Interval (0,0);
+  a.dim_.y () = Interval (y1,y2);
 
-  Array<Real> a;
+  Array<Real> arr;
 
   Real stem_width = paper_l_->get_var ("stemthickness");
-  a.push (-stem_width /2);
-  a.push (stem_width);
-  a.push (y2);
-  a.push (-y1);
+  arr.push (-stem_width /2);
+  arr.push (stem_width);
+  arr.push (y2);
+  arr.push (-y1);
 
-  s.lambda_ =  (lambda_scm ("stem", a));
-  s.font_ = font_;
-  return s;
+  a.lambda_ = (lambda_scm ("stem", arr));
+  a.str_ = "stem";
+  a.font_ = font_;
+  return a;
 }
 
 Atom
@@ -291,18 +304,20 @@ Lookup::streepje (int type) const
 Atom
 Lookup::text (String style, String text) const
 {
-  Array<Scalar> a;
+  Array<Scalar> arr;
 
-  a.push (text);
-  Atom s =  (*symtables_p_) ("style")->lookup (style);
-  s.lambda_ =  (lambda_scm (s.str_, a));
-  s.font_ = font_;
-
-  return s;
+  arr.push (text);
+  Atom a =  (*symtables_p_) ("style")->lookup (style);
+  a.lambda_ = lambda_scm (a.str_, arr);
+  a.str_ = "text";
+  a.font_ = font_;
+  return a;
+   
 }
+  
 
 Atom
-Lookup::time_signature (Array<Real> a) const
+Lookup::time_signature (Array<int> a) const
 {
   Atom s ((*symtables_p_) ("param")->lookup ("time_signature"));
   s.lambda_ =  (lambda_scm (s.str_, a));
@@ -316,8 +331,8 @@ Lookup::time_signature (Array<Real> a) const
 Atom
 Lookup::vbrace (Real &y) const
 {
-  Atom brace = (*symtables_p_) ("param")->lookup ( "brace");
-  Interval ydims = brace.dim_[Y_AXIS];
+  Atom a = (*symtables_p_) ("param")->lookup ( "brace");
+  Interval ydims = a.dim_[Y_AXIS];
   Real min_y = ydims[LEFT];
   Real max_y = ydims[RIGHT];
   Real step = 1.0 PT;
@@ -325,27 +340,26 @@ Lookup::vbrace (Real &y) const
   if (y < min_y)
     {
       warning (_ ("piano brace") 
-       + " " + _ ("too small") +  " (" + print_dimen (y) + ")");
+              + " " + _ ("too small") +  " (" + print_dimen (y) + ")");
       y = min_y;
     }
   if (y > max_y)
     {
       warning (_ ("piano brace")
-       + " " + _ ("too big") + " (" + print_dimen (y) + ")");
+              + " " + _ ("too big") + " (" + print_dimen (y) + ")");
       y = max_y;
     }
 
   
   int idx = int (rint ( (y- min_y)/step)) + 1;
   
-  Array<Real> a;
-  a.push (idx);
-  brace.lambda_ =  (lambda_scm (brace.str_, a));
-  brace.dim_[Y_AXIS] = Interval (-y/2,y/2);
-
-  brace.font_ = font_;
-
-  return brace;
+  Array<Real> arr;
+  arr.push (idx);
+  a.lambda_ = (lambda_scm (a.str_, arr));
+  a.str_ = "brace";
+  a.dim_[Y_AXIS] = Interval (-y/2,y/2);
+  a.font_ = font_;
+  return a;
 }
 
 Atom
@@ -355,7 +369,7 @@ Lookup::hairpin (Real width, bool decresc, bool continued) const
   Real height = paper_l_->staffheight_f () / 6;
   String ps;
   ps += to_str (width) + " " 
-       + to_str (height) + " " 
+    + to_str (height) + " " 
     + to_str (continued ? height/2 : 0) + 
     + " draw_"  + String (decresc ? "de" : "") + "cresc\n";
   a.str_ = ps;
@@ -378,9 +392,9 @@ Lookup::plet (Real dy , Real dx, Direction dir) const
     + String_convert::int_str ( (int)dir) +
     " draw_plet ";
 
-  Atom s;
-  s.str_ = ps;
-  return s;
+  Atom a;
+  a.str_ = ps;
+  return a;
 }
 
 Atom
@@ -396,18 +410,19 @@ Lookup::slur (Array<Offset> controls) const
  
   // (lambda (o) (slur o '((0.1 0.2) (1.1 1.2) (2.1 2.2) (3.1 3.2) .. )))
   a.lambda_ =  (
-    ly_append (ly_lambda_o (), 
-    ly_list1 (ly_append (ly_func_o ("slur"),
-    ly_list1 (ly_list2 (ly_quote (),
-    gh_cons (ly_list2 (gh_double2scm (controls[5].x ()), gh_double2scm (controls[5].y ())),
-    gh_cons (ly_list2 (gh_double2scm (controls[6].x ()), gh_double2scm (controls[6].y ())),
-    gh_cons (ly_list2 (gh_double2scm (controls[7].x ()), gh_double2scm (controls[7].y ())),
-    gh_cons (ly_list2 (gh_double2scm (controls[4].x ()), gh_double2scm (controls[4].y ())),
-    gh_cons (ly_list2 (gh_double2scm (controls[1].x ()), gh_double2scm (controls[1].y ())),
-    gh_cons (ly_list2 (gh_double2scm (controls[2].x ()), gh_double2scm (controls[2].y ())),
-    gh_cons (ly_list2 (gh_double2scm (controls[3].x ()), gh_double2scm (controls[3].y ())),
-    gh_cons (ly_list2 (gh_double2scm (controls[0].x ()), gh_double2scm (controls[0].y ())),
-    SCM_EOL))))))))))))));
+               ly_append (ly_lambda_o (), 
+                          ly_list1 (ly_append (ly_func_o ("slur"),
+                                               ly_list1 (ly_list2 (ly_quote (),
+                                                                   gh_cons (ly_list2 (gh_double2scm (controls[5].x ()), gh_double2scm (controls[5].y ())),
+                                                                            gh_cons (ly_list2 (gh_double2scm (controls[6].x ()), gh_double2scm (controls[6].y ())),
+                                                                                     gh_cons (ly_list2 (gh_double2scm (controls[7].x ()), gh_double2scm (controls[7].y ())),
+                                                                                              gh_cons (ly_list2 (gh_double2scm (controls[4].x ()), gh_double2scm (controls[4].y ())),
+                                                                                                       gh_cons (ly_list2 (gh_double2scm (controls[1].x ()), gh_double2scm (controls[1].y ())),
+                                                                                                                gh_cons (ly_list2 (gh_double2scm (controls[2].x ()), gh_double2scm (controls[2].y ())),
+                                                                                                                         gh_cons (ly_list2 (gh_double2scm (controls[3].x ()), gh_double2scm (controls[3].y ())),
+                                                                                                                                  gh_cons (ly_list2 (gh_double2scm (controls[0].x ()), gh_double2scm (controls[0].y ())),
+                                                                                                                                           SCM_EOL))))))))))))));
+  a.str_ = "slur";
 
   a.dim_[X_AXIS] = Interval (0, dx);
   a.dim_[Y_AXIS] = Interval (0 <? dy,  0 >? dy);
@@ -423,12 +438,13 @@ Lookup::vbracket (Real &y) const
   if (y < min_y)
     {
       warning (_ ("bracket")
-       + " " + _ ("too small") +  " (" + print_dimen (y) + ")");
-//      y = min_y;
+              + " " + _ ("too small") +  " (" + print_dimen (y) + ")");
+      //      y = min_y;
     }
   Array<Real> arr;
   arr.push (y);
   a.lambda_ =  (lambda_scm ("bracket", arr));
+  a.str_ = "vbracket";
   a.dim_[Y_AXIS] = Interval (-y/2,y/2);
   a.dim_[X_AXIS] = Interval (0,4 PT);
   return a;