- return Molecule (b, horizontal_bend);
-}
-
-/*
- * Horizontal Slope:
- *
- * /| ^
- * / | |
- * / | | height
- * / | |
- * / | v
- * | /
- * | /
- * (0,0) x /slope=dy/dx
- * | /
- * |/
- *
- * <----->
- * width
- */
-Molecule
-Lookup::horizontal_slope (Real width, Real slope, Real height)
-{
- SCM width_scm = gh_double2scm (width);
- SCM slope_scm = gh_double2scm (slope);
- SCM height_scm = gh_double2scm (height);
- SCM horizontal_slope = scm_list_n (ly_symbol2scm ("beam"),
- width_scm, slope_scm,
- height_scm, SCM_UNDEFINED);
- Box b (Interval (0, width),
- Interval (-height/2, height/2 + width*slope));
- return Molecule (b, horizontal_slope);
-}
-
-/*
- TODO: junk me.
- */
-Molecule
-Lookup::accordion (SCM s, Real staff_space, Font_metric *fm)
-{
- Molecule m;
- String sym = ly_scm2string (ly_car (s));
- String reg = ly_scm2string (ly_car (ly_cdr (s)));
-
- if (sym == "Discant")
- {
- Molecule r = fm->find_by_name ("accordion-accDiscant");
- m.add_molecule (r);
- if (reg.left_string (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_string (reg.length ()-1);
- }
- int eflag = 0x00;
- if (reg.left_string (3) == "EEE")
- {
- eflag = 0x07;
- reg = reg.right_string (reg.length ()-3);
- }
- else if (reg.left_string (2) == "EE")
- {
- eflag = 0x05;
- reg = reg.right_string (reg.length ()-2);
- }
- else if (reg.left_string (2) == "Eh")
- {
- eflag = 0x04;
- reg = reg.right_string (reg.length ()-2);
- }
- else if (reg.left_string (1) == "E")
- {
- eflag = 0x02;
- reg = reg.right_string (reg.length ()-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_string (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_string (reg.length ()-2);
- }
- if (reg.left_string (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_string (reg.length ()-1);
- }
- }
- else if (sym == "Freebase")
- {
- Molecule r = fm->find_by_name ("accordion-accFreebase");
- m.add_molecule (r);
- if (reg.left_string (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_string (reg.length ()-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);
- }
- }
- else if (sym == "Bayanbase")
- {
- Molecule r = fm->find_by_name ("accordion-accBayanbase");
- m.add_molecule (r);
- if (reg.left_string (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_string (reg.length ()-1);
- }
- /* include 4' reed just for completeness. You don't want to use this. */
- if (reg.left_string (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_string (reg.length ()-1);
- }
- if (reg.left_string (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_string (reg.length ()-2);
- }
- if (reg.left_string (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_string (reg.length ()-1);
- }
- }
- else if (sym == "Stdbase")
- {
- Molecule r = fm->find_by_name ("accordion-accStdbase");
- m.add_molecule (r);
- if (reg.left_string (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_string (reg.length ()-1);
- }
- if (reg.left_string (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_string (reg.length ()-1);
- }
- if (reg.left_string (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_string (reg.length ()-1);
- }
- if (reg.left_string (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_string (reg.length ()-1);
- }
- if (reg.left_string (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_string (reg.length ()-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;