]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lookup.cc
patch::: 1.3.130.jcn1
[lilypond.git] / lily / lookup.cc
index 9d85d63ba9ec3282c8703e3e2174dfc515f4e861..1e24db5da75f95619e93c0dbbbe94f46545412a5 100644 (file)
 
   source file of the GNU LilyPond music typesetter
 
-  (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 
   Jan Nieuwenhuizen <janneke@gnu.org>
 
   TODO
-      Read spacing info from AFMs
       Glissando
 */
+#include <math.h>
+#include <ctype.h>
 
-#include "lookup.hh"
-#include "debug.hh"
+#include "warn.hh"
 #include "dimensions.hh"
-#include "symtable.hh"
-#include "scalar.hh"
-#include "paper-def.hh"
+#include "bezier.hh"
 #include "string-convert.hh"
+#include "file-path.hh"
 #include "main.hh"
 #include "lily-guile.hh"
+#include "molecule.hh"
+#include "lookup.hh"
+#include "font-metric.hh"
 
-Lookup::Lookup ()
-{
-  paper_l_ = 0;
-  symtables_p_ = new Symtables;
-  afm_p_ =0;
-}
-
-Lookup::Lookup (Lookup const& s)
-{
-  font_ = s.font_;
-  font_path_ = s.font_path_;
-  paper_l_ = s.paper_l_;
-  symtables_p_ = new Symtables (*s.symtables_p_);
-  afm_p_ = 0;
-}
-
-Lookup::Lookup (Symtables const& s)
-{
-  font_ = s.font_;
-  font_path_ = s.font_path_;
-  paper_l_ = 0;
-  symtables_p_ = new Symtables (s);
-  afm_p_ = 0;
-}
-
-Lookup::~Lookup ()
-{
-  delete afm_p_;
-  delete symtables_p_;
-}
-
-Atom
-Lookup::accidental (int j) const
-{
-  return afm_find (String ("accidentals") + String ("-") + to_str (j));
-}
-
-void
-Lookup::add (String s, Symtable*p)
-{
-  symtables_p_->add (s, p);
-}
-
-Atom
-Lookup::afm_find (String s) const
+Molecule 
+Lookup::beam (Real slope, Real width, Real thick) 
 {
-  if (!afm_p_)
-    {
-      *mlog << "[" << font_path_;
-      ( (Lookup*)this)->afm_p_ = new Adobe_font_metric (read_afm (font_path_));
-      *mlog << "]" << flush ;
-      DOUT << this->afm_p_->str ();
-    }
-  Adobe_font_char_metric m = afm_p_->find_char (s);
+  Real height = slope * width; 
+  Real min_y = (0 <? height) - thick/2;
+  Real max_y = (0 >? height) + thick/2;
 
-  Atom a;
-  if (m.code () < 0)
-    return a;
   
-  a.dim_ = m.B_;
-  a.dim_[X_AXIS] *= 1 / 1000.0;
-  a.dim_[Y_AXIS] *= 1 / 1000.0;
-  Array<Real> arr;
-  arr.push (m.code ());
-  a.lambda_ = lambda_scm ("char", arr);
-  a.font_ = font_;
-  return a;
-}
-
-Atom
-Lookup::ball (int j) const
-{
-  if (j > 2)
-    j = 2;
 
-  return afm_find (String ("balls") + String ("-") + to_str (j));
-}
+  Box b( Interval (0, width),
+        Interval (min_y, max_y));
 
-Atom
-Lookup::bar (String str, Real h) const
-{
-  Array<Real> arr;
-  arr.push (h);
-  Atom a = (*symtables_p_) ("bars")->lookup (str);
-  a.lambda_ = lambda_scm (a.str_, arr);
-  a.dim_.y () = Interval (-h/2, h/2);
-  a.font_ = font_;
-  return a;
-}
-
-Atom 
-Lookup::beam (Real slope, Real width, Real thick) const
-{
-  Atom a (ps_beam (slope, width, thick));
-  Real height = slope * width; 
-  Real min_y = (0 <? height) - thick/2;
-  Real max_y = (0 >? height) + thick/2;
   
-  a.dim_[X_AXIS] = Interval (0, width);
-  a.dim_[Y_AXIS] = Interval (min_y, max_y);
-  return a;
+  SCM at = gh_list (ly_symbol2scm ("beam"),
+                   gh_double2scm (width),
+                   gh_double2scm (slope),
+                   gh_double2scm (thick),
+                   SCM_UNDEFINED);
+  return Molecule (b, at);
 }
 
-Atom
-Lookup::clef (String st) const
-{
-  return afm_find (String ("clefs") + String ("-") + st);
-}
 
-Atom
-Lookup::dashed_slur (Array<Offset> controls, Real thick, Real dash) const
-{
-  assert (controls.size () == 8);
-
-  Real dx = controls[3].x () - controls[0].x ();
-  Real dy = controls[3].y () - controls[0].y ();
-
-  Atom a;
-  a.font_ = font_;
-  a.dim_[X_AXIS] = Interval (0, dx);
-  a.dim_[Y_AXIS] = Interval (0 <? dy,  0 >? dy);
-
-  // (lambda (o) (dashed-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 ("dashed-slur"),
-    gh_cons (gh_double2scm (thick), gh_cons (gh_double2scm (dash),
-    ly_list1 (ly_list2 (ly_quote (),
-    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)))))))))));
-
-  return a;
-}
 
-Atom
-Lookup::dots () const
+Molecule
+Lookup::dashed_slur (Bezier b, Real thick, Real dash)
 {
-  return afm_find (String ("dots") + String ("-") + String ("dot"));
-}
+  SCM l = SCM_EOL;
 
-Atom
-Lookup::dynamic (String st) const
-{
-  return (*symtables_p_) ("dynamics")->lookup (st);
-}
+  for (int i= 4; i -- ;)
+    {
+      l = gh_cons (ly_offset2scm (b.control_[i]), l);
+    }
 
-Atom
-Lookup::fill (Box b) const
-{
-  Atom a;
-  a.dim_ = b;
-  return a;
-}
+  SCM at = (gh_list (ly_symbol2scm ("dashed-slur"),
+                              gh_double2scm (thick), 
+                              gh_double2scm (dash),
+                              ly_quote_scm (l),
+                              SCM_UNDEFINED));
 
-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));
+  Box box (Interval(0,0),Interval( 0,0));
+  return   Molecule (box, at);
 }
 
-void
-Lookup::print () const
-{
-#ifndef NPRINT
-  DOUT << "Lookup {\n";
-  symtables_p_->print ();
-  DOUT << "}\n";
-#endif
-}
 
-Atom
-Lookup::rest (int j, bool o) const
-{
-   return afm_find (String ("rests")
-                   + String ("-") + to_str (j) + (o ? "o" : ""));
-}
 
-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
-Lookup::script (String str) const
+Molecule
+Lookup::blank (Box b) 
 {
-  return afm_find (String ("scripts") + String ("-") + str);
+  return Molecule (b, SCM_EOL);
 }
 
-Atom
-Lookup::special_time_signature (String s, Array<Scalar> arr) const
+
+Molecule
+Lookup::filledbox (Box b ) 
 {
-#if 0
-  String symbolname = "timesig-"+s+"%/%";
-  Atom a (afm_find (lambda_scm (symbolname, arr)));
-  if (!a.empty ()) 
-    return a;
-  // Try if the full name was given
-  a = afm_find ("timesig-"+s);
-  if (!a.empty ()) 
-    return a;
-  // Resort to default layout with numbers
-#endif
-  return time_signature (arr);
+  SCM  at  = (gh_list (ly_symbol2scm ("filledbox"),
+                    gh_double2scm (-b[X_AXIS][LEFT]),
+                    gh_double2scm (b[X_AXIS][RIGHT]),                 
+                    gh_double2scm (-b[Y_AXIS][DOWN]),
+                    gh_double2scm (b[Y_AXIS][UP]),                    
+                    SCM_UNDEFINED));
+
+  return Molecule ( b,at);
 }
 
-Atom
-Lookup::stem (Real y1, Real y2) const
+Molecule
+Lookup::frame (Box b, Real thick)
 {
-  if (y1 > y2)
+  Molecule m;
+  Direction d = LEFT;
+  Axis a = X_AXIS;
+  while (a < NO_AXES)
     {
-      Real t = y1;
-      y1 = y2;
-      y2 = t;
+      do
+       {
+         Axis o = Axis ((a+1)%NO_AXES);
+
+         Box edges;
+         edges[a] = b[a][d] + 0.5 * thick * Interval (-1, 1);
+         edges[o][DOWN] = b[o][DOWN] - thick/2;
+         edges[o][UP] = b[o][UP] + thick/2;      
+         
+         
+         m.add_molecule (filledbox (edges));
+       }
+      while (flip (&d) != LEFT);
     }
-  Atom s;
-
-  s.dim_.x () = Interval (0,0);
-  s.dim_.y () = Interval (y1,y2);
-
-  Array<Real> a;
-
-  Real stem_width = paper_l_->get_var ("stemthickness");
-  a.push (-stem_width /2);
-  a.push (stem_width);
-  a.push (y2);
-  a.push (-y1);
-
-  s.lambda_ = lambda_scm ("stem", a);
-  s.font_ = font_;
-  return s;
-}
-
-Atom
-Lookup::streepje (int type) const
-{
-  if (type > 2)
-    type = 2;
-
-  return  afm_find ("balls" + String ("-") +to_str (type) + "l");
-}
-
-Atom
-Lookup::text (String style, String text) const
-{
-  Array<Scalar> a;
-
-  a.push (text);
-  Atom s =  (*symtables_p_) ("style")->lookup (style);
-  s.lambda_ = lambda_scm (s.str_, a);
-  s.font_ = font_;
-
-  return s;
+  return m;
+  
 }
 
-Atom
-Lookup::time_signature (Array<Scalar> a) const
-{
-  Atom s ((*symtables_p_) ("param")->lookup ("time_signature"));
-  s.lambda_ = lambda_scm (s.str_, a);
-
-  return s;
-}
 
 /*
-  should be handled via Tex_ code and Lookup::bar ()
+  Make a smooth curve along the points 
  */
-Atom
-Lookup::vbrace (Real &y) const
+Molecule
+Lookup::slur (Bezier curve, Real curvethick, Real linethick) 
 {
-  Atom brace = (*symtables_p_) ("param")->lookup ( "brace");
-  Interval ydims = brace.dim_[Y_AXIS];
-  Real min_y = ydims[LEFT];
-  Real max_y = ydims[RIGHT];
-  Real step = 1.0 PT;
-  if (y < min_y)
+  Real alpha = (curve.control_[3] - curve.control_[0]).arg ();
+  Bezier back = curve;
+
+  back.reverse ();
+  back.control_[1] += curvethick * complex_exp (Offset (0, alpha + M_PI/2));
+  back.control_[2] += curvethick * complex_exp (Offset (0, alpha + M_PI/2));  
+
+  SCM scontrols[8];
+
+  for (int i=4; i--;)
+    scontrols[ i ] = ly_offset2scm(back.control_[i]);
+  for (int i=4 ; i--;)
+    scontrols[i+4] = ly_offset2scm (curve.control_[i]);
+
+  /*
+    Need the weird order b.o. the way PS want its arguments  
+   */
+  int indices[]= {5, 6, 7, 4, 1, 2, 3, 0};
+  SCM list = SCM_EOL;
+  for (int i= 8; i--;  )
     {
-      warning (_ ("piano brace") 
-       + " " + _ ("too small") +  " (" + print_dimen (y) + ")");
-      y = min_y;
+      list = gh_cons (scontrols[indices[i]], list);
     }
-  if (y > max_y)
-    {
-      warning (_ ("piano brace")
-       + " " + _ ("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);
+  SCM at = (gh_list (ly_symbol2scm ("bezier-sandwich"),
+                    ly_quote_scm (list),
+                    gh_double2scm (linethick),
+                    SCM_UNDEFINED));
 
-  brace.font_ = font_;
-
-  return brace;
+  Box b ( curve.extent (X_AXIS), curve.extent (Y_AXIS));
+  return Molecule (b, at);
 }
 
-Atom
-Lookup::hairpin (Real width, bool decresc, bool continued) const
+Molecule
+Lookup::accordion (SCM s, Real staff_space, Font_metric *fm) 
 {
-  Atom a;  
-  Real height = paper_l_->staffheight_f () / 6;
-  String ps;
-  ps += to_str (width) + " " 
-       + to_str (height) + " " 
-    + to_str (continued ? height/2 : 0) + 
-    + " draw_"  + String (decresc ? "de" : "") + "cresc\n";
-  a.str_ = ps;
-
-
-  a.dim_.x () = Interval (0, width);
-  a.dim_.y () = Interval (-2*height, 2*height);
-  a.font_ = font_;
-  return a;
-}
+  Molecule m;
+  String sym = ly_scm2string(gh_car (s));
+  String reg = ly_scm2string(gh_car (gh_cdr(s)));
 
-Atom
-Lookup::plet (Real dy , Real dx, Direction dir) const
-{
-  String ps;
-  
-  
-  ps += String_convert::double_str (dx) + " " 
-    + String_convert::double_str (dy) + " "
-    + String_convert::int_str ( (int)dir) +
-    " draw_plet ";
-
-  Atom s;
-  s.str_ = ps;
-  return s;
-}
-
-Atom
-Lookup::ps_beam (Real slope, Real width, Real thick) const
-{
-  String ps;
-  ps += to_str (width) + " "+ to_str (slope) + " " + to_str (thick)
-    + " draw_beam ";
-
-  Atom s;
-  s.str_ = ps;
-  return s;
-}
-
-Atom
-Lookup::slur (Array<Offset> controls) const
-{
-  assert (controls.size () == 8);
-
-  String ps;
-  
-  Real dx = controls[3].x () - controls[0].x ();
-  Real dy = controls[3].y () - controls[0].y ();
-  Atom a;
-  // (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)))))))))))));
-
-  a.dim_[X_AXIS] = Interval (0, dx);
-  a.dim_[Y_AXIS] = Interval (0 <? dy,  0 >? dy);
-  a.font_ = font_;
-  return a;
-}
-
-Atom
-Lookup::vbracket (Real &y) const
-{
-  Atom a;
-  Real min_y = paper_l_->staffheight_f ();
-  if (y < min_y)
+  if (sym == "Discant")
+    {
+      Molecule r = fm->find_by_name ("accordion-accDiscant");
+      m.add_molecule(r);
+      if (reg.left_str(1) == "F")
+       {
+         Molecule d = fm->find_by_name ("accordion-accDot");
+         d.translate_axis(staff_space * 2.5 PT, Y_AXIS);
+         m.add_molecule(d);
+         reg = reg.right_str(reg.length_i()-1);
+       }
+      int eflag = 0x00;
+      if (reg.left_str(3) == "EEE")
+       {
+         eflag = 0x07;
+         reg = reg.right_str(reg.length_i()-3);
+       }
+      else if (reg.left_str(2) == "EE")
+       {
+         eflag = 0x05;
+         reg = reg.right_str(reg.length_i()-2);
+       }
+      else if (reg.left_str(2) == "Eh")
+       {
+         eflag = 0x04;
+         reg = reg.right_str(reg.length_i()-2);
+       }
+      else if (reg.left_str(1) == "E")
+       {
+         eflag = 0x02;
+         reg = reg.right_str(reg.length_i()-1);
+       }
+      if (eflag & 0x02)
+       {
+         Molecule d = fm->find_by_name ("accordion-accDot");
+         d.translate_axis(staff_space * 1.5 PT, Y_AXIS);
+         m.add_molecule(d);
+       }
+      if (eflag & 0x04)
+       {
+         Molecule d = fm->find_by_name ("accordion-accDot");
+         d.translate_axis(staff_space * 1.5 PT, Y_AXIS);
+         d.translate_axis(0.8 * staff_space PT, X_AXIS);
+         m.add_molecule(d);
+       }
+      if (eflag & 0x01)
+       {
+         Molecule d = fm->find_by_name ("accordion-accDot");
+         d.translate_axis(staff_space * 1.5 PT, Y_AXIS);
+         d.translate_axis(-0.8 * staff_space PT, X_AXIS);
+         m.add_molecule(d);
+       }
+      if (reg.left_str(2) == "SS")
+       {
+         Molecule d = fm->find_by_name ("accordion-accDot");
+         d.translate_axis(0.5 * staff_space PT, Y_AXIS);
+         d.translate_axis(0.4 * staff_space PT, X_AXIS);
+         m.add_molecule(d);
+         d.translate_axis(-0.8 * staff_space PT, X_AXIS);
+         m.add_molecule(d);
+         reg = reg.right_str(reg.length_i()-2);
+       }
+      if (reg.left_str(1) == "S")
+       {
+         Molecule d = fm->find_by_name ("accordion-accDot");
+         d.translate_axis(0.5 * staff_space PT, Y_AXIS);
+         m.add_molecule(d);
+         reg = reg.right_str(reg.length_i()-1);
+       }
+    }
+  else if (sym == "Freebase")
     {
-      warning (_ ("bracket")
-       + " " + _ ("too small") +  " (" + print_dimen (y) + ")");
-//      y = min_y;
+      Molecule r = fm->find_by_name ("accordion-accFreebase");
+      m.add_molecule(r);
+      if (reg.left_str(1) == "F")
+       {
+         Molecule d = fm->find_by_name ("accordion-accDot");
+         d.translate_axis(staff_space * 1.5 PT, Y_AXIS);
+         m.add_molecule(d);
+         reg = reg.right_str(reg.length_i()-1);
+       }
+      if (reg == "E")
+       {
+         Molecule d = fm->find_by_name ("accordion-accDot");
+         d.translate_axis(staff_space * 0.5 PT, Y_AXIS);
+         m.add_molecule(d);
+       }
     }
-  Array<Real> arr;
-  arr.push (y);
-  a.lambda_ = lambda_scm ("bracket", arr);
-  a.dim_[Y_AXIS] = Interval (-y/2,y/2);
-  a.dim_[X_AXIS] = Interval (0,4 PT);
-  return a;
+  else if (sym == "Bayanbase")
+    {
+      Molecule r = fm->find_by_name ("accordion-accBayanbase");
+      m.add_molecule(r);
+      if (reg.left_str(1) == "T")
+       {
+         Molecule d = fm->find_by_name ("accordion-accDot");
+         d.translate_axis(staff_space * 2.5 PT, Y_AXIS);
+         m.add_molecule(d);
+         reg = reg.right_str(reg.length_i()-1);
+       }
+      /* include 4' reed just for completeness. You don't want to use this. */
+      if (reg.left_str(1) == "F")
+       {
+         Molecule d = fm->find_by_name ("accordion-accDot");
+         d.translate_axis(staff_space * 1.5 PT, Y_AXIS);
+         m.add_molecule(d);
+         reg = reg.right_str(reg.length_i()-1);
+       }
+      if (reg.left_str(2) == "EE")
+       {
+         Molecule d = fm->find_by_name ("accordion-accDot");
+         d.translate_axis(staff_space * 0.5 PT, Y_AXIS);
+         d.translate_axis(0.4 * staff_space PT, X_AXIS);
+         m.add_molecule(d);
+         d.translate_axis(-0.8 * staff_space PT, X_AXIS);
+         m.add_molecule(d);
+         reg = reg.right_str(reg.length_i()-2);
+       }
+      if (reg.left_str(1) == "E")
+       {
+         Molecule d = fm->find_by_name ("accordion-accDot");
+         d.translate_axis(staff_space * 0.5 PT, Y_AXIS);
+         m.add_molecule(d);
+         reg = reg.right_str(reg.length_i()-1);
+       }
+    }
+  else if (sym == "Stdbase")
+    {
+      Molecule r = fm->find_by_name ("accordion-accStdbase");
+      m.add_molecule(r);
+      if (reg.left_str(1) == "T")
+       {
+         Molecule d = fm->find_by_name ("accordion-accDot");
+         d.translate_axis(staff_space * 3.5 PT, Y_AXIS);
+         m.add_molecule(d);
+         reg = reg.right_str(reg.length_i()-1);
+       }
+      if (reg.left_str(1) == "F")
+       {
+         Molecule d = fm->find_by_name ("accordion-accDot");
+         d.translate_axis(staff_space * 2.5 PT, Y_AXIS);
+         m.add_molecule(d);
+         reg = reg.right_str(reg.length_i()-1);
+       }
+      if (reg.left_str(1) == "M")
+       {
+         Molecule d = fm->find_by_name ("accordion-accDot");
+         d.translate_axis(staff_space * 2 PT, Y_AXIS);
+         d.translate_axis(staff_space PT, X_AXIS);
+         m.add_molecule(d);
+         reg = reg.right_str(reg.length_i()-1);
+       }
+      if (reg.left_str(1) == "E")
+       {
+         Molecule d = fm->find_by_name ("accordion-accDot");
+         d.translate_axis(staff_space * 1.5 PT, Y_AXIS);
+         m.add_molecule(d);
+         reg = reg.right_str(reg.length_i()-1);
+       }
+      if (reg.left_str(1) == "S")
+       {
+         Molecule d = fm->find_by_name ("accordion-accDot");
+         d.translate_axis(staff_space * 0.5 PT, Y_AXIS);
+         m.add_molecule(d);
+         reg = reg.right_str(reg.length_i()-1);
+       }
+    }
+  /* ugh maybe try to use regular font for S.B. and B.B and only use one font
+     for the rectangle */
+  else if (sym == "SB")
+    {
+      Molecule r = fm->find_by_name ("accordion-accSB");
+      m.add_molecule(r);
+    }
+  else if (sym == "BB")
+    {
+      Molecule r = fm->find_by_name ("accordion-accBB");
+      m.add_molecule(r);
+    }
+  else if (sym == "OldEE")
+    {
+      Molecule r = fm->find_by_name ("accordion-accOldEE");
+      m.add_molecule(r);
+    }
+  else if (sym == "OldEES")
+    {
+      Molecule r = fm->find_by_name ("accordion-accOldEES");
+      m.add_molecule(r);
+    }
+  return m;  
 }
 
-