+1.3.15.hwn1
+===========
+
+ * Fixed bug in stem code. Stem in chords works again. Small
+stem cleanups.
+
+ * Use element properties for Staff_symbol.
+
+ * \property sparseTies (boolean). Only make one tie in the
+middle for tied chords.
+
+ * Junked Directional_spanner, Column_info.
+Directional_element now is element interface `Directional_element_interface'
+
+ * cleanup: use to_boolean () iso. gh_boolean_p && gh_bool2scm
+
+pl 15.jcn4
+ - removed old notename2scm conversion
+ - beam-dir-algorithm through scm
+ - bfs paper-scm
+ - bf: knee-stemlengths
+
+pl 15.jcn3
+ - moved poor man's stem arrays to scm
+
+pl 15.jcn2
+ - beam quanting using scm lists
+
+pl 14.hwn1jcn1
+ - chord-name uses scm members
+ - bfs: knee with different mults, interstaff knee, auto-knee
+
+**********
pl 14.hwn1
- specialize duration.cc for lily, move out of lib/
- stem cleanup
pl 13.jcn1
- bezier-bow fix
-***********
+**********
pl 12.hwn1
- polynomial.hh
- bf: generic properties
- use smobs for font metric tables/hashes.
- nl.po bf
-************
-
+**********
pl 11.jcn3
- small beam fixes (interstaff knees still broken)
- bf's: if (Foo b = bar != 1)
- beam cleanup
-************
+*********
pl 10.uu1
- various small bfs
- bf: alignment reversed
- steminfo to properties
- dropped internote dim for stem-beams
-**********
+*********
pl 9.hwn1
- abstracting Staff_symbol_referencer to an interface.
- quantised_position for staccato dots.
- junk Score_element::do_{width,height}: set callbacks directly.
- merge Score_element, Graphical_element
- merge Axis_group_element, Graphical_axis_group
- - junk pointer fields fromScore_element derived classes
+ - junk pointer fields from Score_element derived classes
- junk obsolete do_substitute_dependency code.
**********
--- /dev/null
+
+\context Voice {
+\property Voice.sparseTies = ##t
+c'' <c e g> ~ <c e g> }
#include "note-column.hh"
#include "local-key-item.hh"
#include "warn.hh"
+#include "directional-element-interface.hh"
/**
catch notes, and put them in a row.
SCM al = get_property ("graceAlignPosition", 0);
if (isdir_b (al))
{
- align_item_p_->set_direction (to_dir (al));
+ directional_element (align_item_p_).set (to_dir (al));
}
typeset_element (align_item_p_);
Allow already started autobeam to end
*/
SCM on = get_property ("noAutoBeaming", 0);
- if (gh_boolean_p (on) && gh_scm2bool (on))
+ if (to_boolean (on))
return;
if (begin_mom)
{
bool gr = e->get_elt_property ("grace") == SCM_BOOL_T;
SCM wg =get_property ("weAreGraceContext",0);
- return (gh_boolean_p (wg) && gh_scm2bool (wg)) == gr;
+ return (to_boolean (wg)) == gr;
}
void
/*
Don't (start) auto-beam over empty stems; skips or rests
*/
- if (!stem_l->first_head ())
+ if (!stem_l->heads_i ())
{
if (stem_l_arr_p_)
end_beam ();
urg. Why did I implement this?
*/
SCM prop = get_property ("barAtLineStart", 0);
- if (gh_boolean_p (prop) && gh_scm2bool (prop))
+ if (to_boolean (prop))
{
bar_p_->set_elt_property ("at-line-start", SCM_BOOL_T);
}
if (!now_mom ())
{
SCM prop = get_property ("barAtLineStart", 0);
- if (!gh_boolean_p (prop) && gh_scm2bool (prop))
+ if (!to_boolean (prop))
return;
}
bool bar_existed = bar_p_;
Bar_script_engraver::do_creation_processing ()
{
SCM prop = get_property (type_ + "HangOnClef", 0);
- if (gh_boolean_p (prop) && gh_scm2bool (prop))
+ if (to_boolean (prop))
{
hang_on_clef_b_ = true;
}
bool stem_grace = stem_l->get_elt_property ("grace") == SCM_BOOL_T;
SCM wg =get_property ("weAreGraceContext",0);
- bool wgb= gh_boolean_p (wg) && gh_scm2bool (wg);
+ bool wgb= to_boolean (wg);
if (wgb!= stem_grace)
return;
#include "lookup.hh"
#include "bezier-bow.hh"
#include "main.hh"
+#include "directional-element-interface.hh"
Bow::Bow ()
{
if (gh_number_p (d))
a = lookup_l ()->dashed_slur (one, thick, gh_scm2int (d));
else
- a = lookup_l ()->slur (one, get_direction () * thick, thick);
+ a = lookup_l ()->slur (one, directional_element (this).get () * thick, thick);
return new Molecule (a);
}
Bow::get_curve () const
{
Bezier_bow b (paper_l (),
- get_encompass_offset_arr (), get_direction ());
+ get_encompass_offset_arr (), directional_element (this).get ());
return b.get_curve ();
}
return;
SCM bp=item_l->remove_elt_property ("breakable");
- bool breakable = (gh_boolean_p (bp) && gh_scm2bool (bp));
+ bool breakable = (to_boolean (bp));
if (!breakable)
return ;
*/
#include "staff-symbol-referencer.hh"
+#include "directional-element-interface.hh"
#include "breathing-sign.hh"
#include "string.hh"
Breathing_sign::Breathing_sign ()
{
- set_direction (UP);
set_elt_property ("breakable", SCM_BOOL_T);
}
-
-
Molecule*
Breathing_sign::do_brew_molecule_p () const
{
{
Real dl = Staff_symbol_referencer_interface (this).staff_space();
- translate_axis(2.0 * dl * get_direction (), Y_AXIS);
+ translate_axis(2.0 * dl * directional_element(this).get (), Y_AXIS);
}
/*
TODO.
*/
- Note_head * nu_l= cu_l->first_head(); // cu_l->head_l_arr_[0];
- Note_head * nd_l = cd_l->first_head(); // cd_l->head_l_arr_.top();
-
-
+ Note_head * nu_l= cu_l->first_head();
+ Note_head * nd_l = cd_l->first_head();
int downpos = cd_l->head_positions_interval ()[BIGGER];
int uppos = cu_l->head_positions_interval ()[SMALLER];
while ((flip (&d))!= UP);
}
-
do
{
for (int i=0; i < clash_groups[d].size (); i++)
*/
-#include "directional-element.hh"
+#include "directional-element-interface.hh"
-Directional_element::Directional_element ()
+Directional_element_interface::Directional_element_interface (Score_element const *s)
{
+ elt_l_ = (Score_element*)s;
}
+bool
+Directional_element_interface::has_interface_b () const
+{
+ return isdir_b (elt_l_->get_elt_property ("direction"));
+}
+
+
+
+
Direction
-Directional_element::get_direction () const
+Directional_element_interface::get () const
{
// return dir_;
- SCM d= get_elt_property ("direction");
+ SCM d= elt_l_->get_elt_property ("direction");
if (!isdir_b(d))
return CENTER;
}
void
-Directional_element::set_direction (Direction d)
+Directional_element_interface::set (Direction d)
+{
+ elt_l_->set_elt_property ("direction", gh_int2scm (d));
+}
+
+Directional_element_interface
+directional_element (Score_element const*s)
{
- set_elt_property ("direction", gh_int2scm (d));
+ return s;
}
#include "rhythmic-head.hh"
#include "group-interface.hh"
#include "staff-symbol-referencer.hh"
+#include "directional-element-interface.hh"
void
Dot_column::add_dots (Dots *d)
Group_interface gi (this, "dots");
gi.set_interface ();
- set_direction (RIGHT);
+ directional_element (this).set (RIGHT);
set_axes(X_AXIS,X_AXIS);
}
#include "paper-def.hh"
#include "lookup.hh"
#include "staff-symbol-referencer.hh"
+#include "directional-element-interface.hh"
Dots::Dots ()
{
}
else
{
- if (!get_direction ())
- set_direction (UP);
+ if (!directional_element (this).get ())
+ directional_element (this).set (UP);
Staff_symbol_referencer_interface si (this);
int p = int (si.position_f ());
if (!(p % 2))
- si.set_position (p + get_direction ());
+ si.set_position (p + directional_element (this).get ());
}
}
Molecule*
#include "extender-spanner.hh"
Extender_spanner::Extender_spanner ()
- : Directional_spanner ()
+ : Spanner ()
{
dx_f_drul_[LEFT] = dx_f_drul_[RIGHT] = 0.0;
dim_cache_[Y_AXIS]->set_callback (Dimension_cache::point_dimension_callback);
#include "dimension-cache.hh"
Hyphen_spanner::Hyphen_spanner ()
- : Directional_spanner ()
+ : Spanner ()
{
dx_f_drul_[LEFT] = dx_f_drul_[RIGHT] = 0.0;
#define BEAM_HH
#include "lily-proto.hh"
-#include "directional-spanner.hh"
+#include "spanner.hh"
/** a beam connects multiple stems.
Beam adjusts the stems its owns to make sure that they reach the
beam and that point in the correct direction (urg?)
-elt property:
-
-damping: amount of beam slope damping. (int)
-
-should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams
-
-slope_quantisation: 'none, 'normal or 'traditional
+ elt_properties:
+ y-position: real (position of left edge)
+ height: real (dy)
+ damping: amount of beam slope damping. (int)
+ should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams
*/
-class Beam : public Directional_spanner
+class Beam : public Spanner
{
public:
#ifndef BOW_HH
#define BOW_HH
-#include "directional-spanner.hh"
+#include "spanner.hh"
/**
Base class for anything that looks like a slur.
dy_f_drul_ , dx_f_drul_
*/
-class Bow : public Directional_spanner
+class Bow : public Spanner
{
public:
Bow ();
#include "item.hh"
#include "parray.hh"
-#include "directional-element.hh"
-class Breathing_sign : public Item,
- public Directional_element
+class Breathing_sign : public Item
{
public:
VIRTUAL_COPY_CONS(Score_element);
#include "item.hh"
#include "direction.hh"
-#include "pointer.hh"
+
/**
Set a clef in a staff.
#include "axis-group-item.hh"
#include "tuple.hh"
-
+//junkme, use SCM conses.
typedef Tuple<Score_element*, Real> Shift_tup;
/**
#ifndef CRESCENDO_HH
#define CRESCENDO_HH
-#include "directional-spanner.hh"
+#include "spanner.hh"
/**
The hairpin symbol. (cresc)
(normal spanner?)
*/
-class Crescendo : public Directional_spanner {
+class Crescendo : public Spanner {
public:
int grow_dir_;
--- /dev/null
+/*
+ directional-element.hh -- declare Directional_element
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#ifndef DIRECTIONAL_ELEMENT_HH
+#define DIRECTIONAL_ELEMENT_HH
+
+#include "score-element.hh"
+
+struct Directional_element_interface
+{
+
+public:
+ Score_element *elt_l_;
+
+ Directional_element_interface (Score_element const *);
+ void set (Direction d);
+ Direction get () const;
+ bool has_interface_b () const;
+ // bool set_interface ();
+};
+
+Directional_element_interface directional_element (Score_element const*);
+
+#endif /* DIRECTIONAL_ELEMENT_HH */
+
-/*
- directional-element.hh -- declare Directional_element
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
-#ifndef DIRECTIONAL_ELEMENT_HH
-#define DIRECTIONAL_ELEMENT_HH
-
-#include "score-element.hh"
-
-struct Directional_element : public virtual Score_element
-{
- void set_direction (Direction d);
- Direction get_direction () const;
-
- VIRTUAL_COPY_CONS(Score_element);
- Directional_element ();
-};
-
-#endif /* DIRECTIONAL_ELEMENT_HH */
-/*
- directional-spanner.hh -- part of GNU LilyPond
-
- (c) 1996--1999 Han-Wen Nienhuys
-*/
-
-#ifndef DIRECTIONALSPANNER_HH
-#define DIRECTIONALSPANNER_HH
-
-#include "spanner.hh"
-#include "directional-element.hh"
-
-/** a spanner which can be pointing "up" or "down".
-
- JUNKME
- */
-class Directional_spanner : public Spanner, public Directional_element {
-public:
- /// offset of "center" relative to left-column/0-pos of staff
- // virtual Offset center() const;
- virtual Direction get_default_dir() const;
- VIRTUAL_COPY_CONS(Score_element);
-protected:
- virtual void do_pre_processing();
-};
-
-#endif // DIRECTIONALSPANNER_HH
+#error
#include "item.hh"
-#include "directional-element.hh"
/**
The dots to go with a notehead/rest. A separate class, since they
are a party in collision resolution.
*/
class Dots :
- public Item,
- public Directional_element
+ public Item
{
protected:
virtual Molecule * do_brew_molecule_p () const;
virtual void do_post_processing ();
public:
+ // junkme.
int dots_i_;
Dots ();
#ifndef EXTENDER_SPANNER_HH
#define EXTENDER_SPANNER_HH
-#include "directional-spanner.hh"
+#include "spanner.hh"
/**
simple extender line
extend beond, lasting the whole duration of the melissima
(as in MUP, urg).
*/
-class Extender_spanner : public Directional_spanner
+class Extender_spanner : public Spanner
{
public:
Extender_spanner ();
#ifndef HYPHEN_SPANNER_HH
#define HYPHEN_SPANNER_HH
-#include "directional-spanner.hh"
+#include "spanner.hh"
/**
centred hyphen
The length of the hyphen line should stretch based on the
size of the gap between syllables.
*/
-class Hyphen_spanner : public Directional_spanner
+class Hyphen_spanner : public Spanner
{
public:
Hyphen_spanner ();
#include "direction.hh"
SCM ly_str02scm (char const*c);
-SCM ly_eval_str (char const*c);
+SCM ly_eval_str (String s);
SCM ly_symbol2scm (char const *);
String ly_symbol2string (SCM);
SCM ly_set_x (String name , SCM val);
bool isdir_b (SCM s);
Direction to_dir (SCM s);
+bool to_boolean (SCM s);
void init_ly_protection ();
unsigned int ly_scm_hash (SCM s);
SCM index_cell (SCM cellp, Direction d);
SCM index_set_cell (SCM cellp, Direction d, SCM val);
+template<class T>SCM array_to_scm (Array<T> arr);
+template<class T>void scm_to_array (SCM s, Array<T>* arr);
+
+//URG how templates suck!
+SCM to_scm (int i);
+void scm_to (SCM s, int* i);
+
+SCM to_scm (Real r);
+void scm_to (SCM s, Real* r);
+
/*
snarfing.
*/
} _ ## name ## _scm_initter; \
/* end define */
-
-
#endif // LILY_GUILE_HH
struct Command_tie_engraver;
struct Crescendo ;
struct Dimension_cache;
-struct Directional_spanner;
+struct Spanner;
struct Dot_column;
struct Dots;
struct Durational_req;
#define NOTE_HEAD_SIDE_HH
#include "item.hh"
-#include "directional-element.hh"
/**
be next to noteheads.
*/
-class Note_head_side: public virtual Item, public virtual Directional_element
+class Note_head_side: public virtual Item
{
public:
-
Note_head_side ();
bool supported_b () const;
void add_support (Item*);
#include "spanner.hh"
#include "item.hh"
-#include "directional-element.hh"
-
struct Side_position_interface
{
Score_element * elt_l_;
Real staff_space () const;
Staff_symbol * staff_symbol_l () const;
- int lines_i () const;
+ int line_count () const;
Real position_f () const;
};
class Staff_symbol : public Spanner
{
public:
- /// this many lines.
- int no_lines_i_;
- Real staff_space_;
- Real staff_space ();
-
-
- Staff_symbol ();
+ Real staff_space () const;
int steps_i() const;
+ int line_count () const;
protected:
VIRTUAL_COPY_CONS(Score_element);
virtual Molecule* do_brew_molecule_p() const;
- virtual void do_print() const;
};
#endif // STAFFSYM_HH
class Stem_tremolo : public Item {
protected:
Stem * stem_l () const;
- virtual void do_print () const;
virtual Molecule *do_brew_molecule_p () const;
static Interval dim_callback (Dimension_cache const*);
public:
- int abbrev_flags_i_;
Stem_tremolo ();
void set_stem (Stem *);
};
#include "array.hh"
#include "moment.hh"
#include "molecule.hh"
-#include "directional-element.hh"
#include "stem-info.hh"
/**the rule attached to the ball.
*/
-class Stem : public Item,
- public Directional_element
+class Stem : public Item
{
public:
/// log of the duration. Eg. 4 -> 16th note -> 2 flags
*/
Beam* beam_l () const;
Note_head * first_head () const;
+ Drul_array<Note_head*> extremal_heads () const;
+
Score_element * support_head () const;
Stem ();
Stem_info calc_stem_info () const;
Real chord_start_f () const;
-
+ Direction get_direction () const;
int type_i () const;
void set_stemend (Real);
Direction get_default_dir() const;
+
int get_center_distance(Direction) const;
- Real get_default_stemlen() const;
+ int heads_i () const;
+
+ bool invisible_b() const;
+
+ /// heads that the stem encompasses (positions)
+ Interval head_positions() const;
+protected:
+ friend class Stem_tremolo; // ugh.
+ Real get_default_stem_end_position () const;
void position_noteheads();
- Real stem_end_position () const;
+ Real stem_end_position () const;
// todo: cleanup, naming
Real note_delta_f () const;
-
- bool invisible_b() const;
-
- /// heads that the stem encompasses (positions)
- Interval_t<int> head_positions() const;
-
protected:
Molecule flag () const;
class Text_item : public Item
{
public:
+ // junkme.
String text_str_;
VIRTUAL_COPY_CONS (Score_element);
{
public:
Tie ();
- void set_head (Direction, Note_head*head_l);
+ void set_head (Direction, Item*head_l);
VIRTUAL_COPY_CONS(Score_element);
Note_head* head (Direction) const;
#define Tuplet_spanner_HH
#include "pointer.hh"
-#include "directional-spanner.hh"
+#include "spanner.hh"
/** supportable plet: triplets, eentweetjes, ottava, etc.
todo: handle breaking elegantly.
*/
-class Tuplet_spanner : public Directional_spanner
+class Tuplet_spanner : public Spanner
{
public:
Tuplet_spanner ();
void add_column (Note_column*);
void add_beam (Beam*);
-
+ /*
+ JUNKME.
+ */
String number_str_;
bool parallel_beam_b_;
if (dynamic_cast <Clef_change_req *> (info.req_l_))
{
SCM c = get_property ("createKeyOnClefChange", 0);
- if (gh_boolean_p (c) && gh_scm2bool (c))
+ if (to_boolean (c))
create_key ();
}
else if (dynamic_cast<Bar *> (info.elem_l_)
key_.clear ();
SCM prop = get_property ("keyOctaviation", 0);
- key_.multi_octave_b_ = gh_boolean_p (prop) && gh_scm2bool (prop);
+ key_.multi_octave_b_ = to_boolean (prop);
accidental_idx_arr_.clear ();
}
SCM
-ly_eval_str (char const*c)
+ly_eval_str (String s)
{
// this all really sucks, guile should take char const* arguments!
- return gh_eval_str ((char*)c);
+ return gh_eval_str ((char*)s.ch_C ());
}
return s;
}
-SCM
-array_to_list (SCM *a , int l)
-{
- SCM list = SCM_EOL;
- for (int i= l; i--; )
- {
- list = gh_cons (a[i], list);
- }
- return list;
-}
-
SCM
ly_warning (SCM str)
{
}
+SCM
+to_scm (int i)
+{
+ return gh_int2scm (i);
+}
+
+void
+scm_to (SCM s, int* i)
+{
+ // urg
+ *i = gh_number_p (s) ? gh_scm2int (s) : 0;
+}
+
+SCM
+to_scm (Real r)
+{
+ return gh_double2scm (r);
+}
+
+void
+scm_to (SCM s, Real* r)
+{
+ // urg
+ *r = gh_number_p (s) ? gh_scm2double (s) : 0;
+}
+
+
+bool
+to_boolean (SCM s)
+{
+ return gh_boolean_p (s) && gh_scm2bool (s);
+}
if (!key_item_p_ && mel_l_arr_.size())
{
SCM f = get_property ("forgetAccidentals",0);
- bool forget = gh_boolean_p (f) && gh_scm2bool(f);
+ bool forget = to_boolean (f);
for (int i=0; i < mel_l_arr_.size(); i++)
{
Item * support_l = support_l_arr_[i];
if (time_C_ && !time_C_->measure_position ())
{
SCM n = get_property ("noResetKey",0);
- bool no_res = gh_boolean_p (n) && gh_scm2bool (n);
+ bool no_res = to_boolean (n);
if (!no_res && key_grav_l_)
local_key_= key_grav_l_->key_;
}
}
Molecule
-Lookup::accordion (SCM s, Real interline_f) const
+Lookup::accordion (SCM s, Real staff_space) const
{
Molecule m;
String sym = ly_scm2string(gh_car (s));
if (reg.left_str(1) == "F")
{
Molecule d = afm_find("scripts-accDot");
- d.translate_axis(interline_f * 2.5 PT, Y_AXIS);
+ d.translate_axis(staff_space * 2.5 PT, Y_AXIS);
m.add_molecule(d);
reg = reg.right_str(reg.length_i()-1);
}
if (eflag & 0x02)
{
Molecule d = afm_find("scripts-accDot");
- d.translate_axis(interline_f * 1.5 PT, Y_AXIS);
+ d.translate_axis(staff_space * 1.5 PT, Y_AXIS);
m.add_molecule(d);
}
if (eflag & 0x04)
{
Molecule d = afm_find("scripts-accDot");
- d.translate_axis(interline_f * 1.5 PT, Y_AXIS);
- d.translate_axis(0.8 * interline_f PT, X_AXIS);
+ 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 = afm_find("scripts-accDot");
- d.translate_axis(interline_f * 1.5 PT, Y_AXIS);
- d.translate_axis(-0.8 * interline_f PT, X_AXIS);
+ 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 = afm_find("scripts-accDot");
- d.translate_axis(0.5 * interline_f PT, Y_AXIS);
- d.translate_axis(0.4 * interline_f PT, X_AXIS);
+ 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 * interline_f PT, X_AXIS);
+ 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 = afm_find("scripts-accDot");
- d.translate_axis(0.5 * interline_f PT, Y_AXIS);
+ d.translate_axis(0.5 * staff_space PT, Y_AXIS);
m.add_molecule(d);
reg = reg.right_str(reg.length_i()-1);
}
if (reg.left_str(1) == "F")
{
Molecule d = afm_find("scripts-accDot");
- d.translate_axis(interline_f * 1.5 PT, Y_AXIS);
+ 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 = afm_find("scripts-accDot");
- d.translate_axis(interline_f * 0.5 PT, Y_AXIS);
+ d.translate_axis(staff_space * 0.5 PT, Y_AXIS);
m.add_molecule(d);
}
}
if (reg.left_str(1) == "T")
{
Molecule d = afm_find("scripts-accDot");
- d.translate_axis(interline_f * 2.5 PT, Y_AXIS);
+ 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) == "F")
{
Molecule d = afm_find("scripts-accDot");
- d.translate_axis(interline_f * 1.5 PT, Y_AXIS);
+ 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 = afm_find("scripts-accDot");
- d.translate_axis(interline_f * 0.5 PT, Y_AXIS);
- d.translate_axis(0.4 * interline_f PT, X_AXIS);
+ 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 * interline_f PT, X_AXIS);
+ 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 = afm_find("scripts-accDot");
- d.translate_axis(interline_f * 0.5 PT, Y_AXIS);
+ d.translate_axis(staff_space * 0.5 PT, Y_AXIS);
m.add_molecule(d);
reg = reg.right_str(reg.length_i()-1);
}
if (reg.left_str(1) == "T")
{
Molecule d = afm_find("scripts-accDot");
- d.translate_axis(interline_f * 3.5 PT, Y_AXIS);
+ 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 = afm_find("scripts-accDot");
- d.translate_axis(interline_f * 2.5 PT, Y_AXIS);
+ 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 = afm_find("scripts-accDot");
- d.translate_axis(interline_f * 2 PT, Y_AXIS);
- d.translate_axis(interline_f PT, X_AXIS);
+ 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 = afm_find("scripts-accDot");
- d.translate_axis(interline_f * 1.5 PT, Y_AXIS);
+ 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 = afm_find("scripts-accDot");
- d.translate_axis(interline_f * 0.5 PT, Y_AXIS);
+ d.translate_axis(staff_space * 0.5 PT, Y_AXIS);
m.add_molecule(d);
reg = reg.right_str(reg.length_i()-1);
}
SCM plain (get_property ("melismaBusy", 0));
SCM slur (get_property ("slurMelismaBusy", 0));
SCM tie (get_property ("tieMelismaBusy", 0));
- return (gh_boolean_p (plain) && gh_scm2bool (plain))
- || (gh_boolean_p (slur) && gh_scm2bool (slur))
- || (gh_boolean_p (tie) && gh_scm2bool (tie));
+ return (to_boolean (plain))
+ || (to_boolean (slur))
+ || (to_boolean (tie));
}
return false;
}
#include "warn.hh"
SCM
-Moment::mark_smob (SCM s)
+Moment::mark_smob (SCM)
{
return SCM_EOL;
}
}
mol_p->add_molecule (s);
- Real interline_f
+ Real staff_space
= staff_symbol_referencer_interface (this).staff_space ();
if (measures_i_ == 1 && rest_symbol)
{
- mol_p->translate_axis (interline_f, Y_AXIS);
+ mol_p->translate_axis (staff_space, Y_AXIS);
}
else if (measures_i_ > 1)
{
Molecule s (lookup_l ()->text ("number", to_str (measures_i_), paper_l ()));
s.align_to (X_AXIS, CENTER);
- s.translate_axis (3.0 * interline_f, Y_AXIS);
+ s.translate_axis (3.0 * staff_space, Y_AXIS);
mol_p->add_molecule (s);
}
mol_p->translate_axis (x_off, X_AXIS);
Real dist =
minimum_dist + -d * (beamy - rest_dim) >? 0;
- int stafflines = si.lines_i ();
+ int stafflines = si.line_count ();
// move discretely by half spaces.
int discrete_dist = int (ceil (dist ));
*/
+#include "directional-element-interface.hh"
+
#include "side-position-interface.hh"
#include "note-head-side.hh"
void
Staff_symbol_referencer_interface si (this);
Real inter_f = si.staff_space ()/2;
- int sz = si.lines_i ()-1;
+ int sz = si.line_count ()-1;
Real p = si.position_f ();
int streepjes_i = abs (p) < sz
? 0
/* FIXME
staff_space = rcol->rest_l_arr[0]->staff_space ();
*/
- Real internote_f = staff_space/2;
+ Real half_staff_space_f = staff_space/2;
Real minimum_dist = paper_l ()->get_var ("restcollision_minimum_dist")
- * internote_f;
+ * half_staff_space_f;
/*
assumption: ref points are the same.
// FIXME
- int stafflines = 5; // rcol->rest_l_arr[0]->lines_i ();
+ int stafflines = 5; // rcol->rest_l_arr[0]->line_count;
// move discretely by half spaces.
{
Staff_symbol_referencer_interface si(this);
ledger_b = abs(si.position_f () - (2* balltype_i () - 1))
- > si.lines_i ();
+ > si.line_count ();
}
String style;
}
SCM wg = get_property ("weAreGraceContext",0);
- bool wegrace = gh_boolean_p (wg) && gh_scm2bool (wg);
+ bool wegrace = to_boolean (wg);
if (!wegrace)
for (int i=0; i < grace_slur_endings_.size(); i++)
Rhythmic_column_engraver::acknowledge_element (Score_element_info i)
{
SCM wg = get_property ("weAreGraceContext",0);
- bool wegrace = gh_boolean_p (wg) && gh_scm2bool (wg);
+ bool wegrace = to_boolean (wg);
if ((wegrace !=
(i.elem_l_->get_elt_property ("grace") != SCM_UNDEFINED))
&& !dynamic_cast<Slur*> (i.elem_l_))
void
Score_element::output_processing ()
{
- if (get_elt_property ("transparent") != SCM_UNDEFINED)
+ if (to_boolean (get_elt_property ("transparent")))
return;
// we're being silly here.
stafy.set_direction (l->get_direction ());
SCM axisprop = get_property ("scriptHorizontal",0);
- bool xaxis = gh_boolean_p (axisprop) && gh_scm2bool (axisprop);
+ bool xaxis = to_boolean (axisprop);
if (xaxis)
stafy.set_axis (X_AXIS);
else
}
slur_l_stack_.clear ();
SCM wg = get_property ("weAreGraceContext",0);
- bool wgb = gh_boolean_p (wg) && gh_scm2bool (wgb);
+ bool wgb = to_boolean (wg);
if (!wgb)
for (int i=0; i < requests_arr_.size(); i++)
{
{
new_slur_req_l_arr_.clear();
SCM m = get_property ("automaticMelismata",0);
- if (gh_boolean_p (m) && gh_scm2bool (m))
+ if (to_boolean (m))
{
set_melisma (slur_l_stack_.size ());
}
* broken slur should have uniform trend
*/
+#include "directional-element-interface.hh"
#include "group-interface.hh"
#include "slur.hh"
#include "lookup.hh"
{
Offset o;
Stem* stem_l = col->stem_l ();
+ Direction dir = directional_element (this).get ();
+
if (!stem_l)
{
warning (_ ("Slur over rest?"));
o[X_AXIS] = col->hpos_f ();
- o[Y_AXIS] = col->extent (Y_AXIS)[get_direction ()];
+ o[Y_AXIS] = col->extent (Y_AXIS)[dir];
return o;
}
-
+ Direction stem_dir = directional_element (stem_l).get ();
o[X_AXIS] = stem_l->hpos_f ();
/*
Simply set x to middle of notehead
*/
- o[X_AXIS] -= 0.5 * stem_l->get_direction () * col->extent (X_AXIS).length ();
+ o[X_AXIS] -= 0.5 * stem_dir * col->extent (X_AXIS).length ();
- if ((stem_l->get_direction () == get_direction ())
+ if ((stem_dir == dir)
&& !stem_l->extent (Y_AXIS).empty_b ())
{
- o[Y_AXIS] = stem_l->extent (Y_AXIS)[get_direction ()];
+ o[Y_AXIS] = stem_l->extent (Y_AXIS)[dir];
}
else
{
- o[Y_AXIS] = col->extent (Y_AXIS)[get_direction ()];
+ o[Y_AXIS] = col->extent (Y_AXIS)[dir];
}
/*
leave a gap: slur mustn't touch head/stem
*/
- o[Y_AXIS] += get_direction () * paper_l ()->get_var ("slur_y_free");
+ o[Y_AXIS] += dir * paper_l ()->get_var ("slur_y_free");
o[Y_AXIS] += calc_interstaff_dist (stem_l, this);
return o;
}
Group_interface__extract_elements (this, (Note_column*)0, "note-columns");
- if (!get_direction ())
- set_direction (get_default_dir ());
+ if (!directional_element (this).get ())
+ directional_element (this).set (get_default_dir ());
/*
Slur and tie placement [OSU]
y = length >= 5ss : y next interline - d * 0.25 ss
*/
- Real interline_f = paper_l ()->get_var ("interline");
- Real internote_f = interline_f / 2;
+ Real staff_space = paper_l ()->get_var ("interline");
+ Real half_staff_space = staff_space / 2;
Real x_gap_f = paper_l ()->get_var ("slur_x_gap");
Real y_gap_f = paper_l ()->get_var ("slur_y_gap");
note_column_drul[RIGHT] = encompass_arr.top ();
bool fix_broken_b = false;
+
+ Direction my_dir = directional_element (this).get ();
+
Direction d = LEFT;
do
{
no beam getting in the way
*/
if ((stem_l->extent (Y_AXIS).empty_b ()
- || !((stem_l->get_direction () == get_direction ()) && (get_direction () != d)))
- && !((get_direction () == stem_l->get_direction ())
+ || !((stem_l->get_direction () == my_dir) && (my_dir != d)))
+ && !((my_dir == stem_l->get_direction ())
&& stem_l->beam_l () && (stem_l->beam_count (-d) >= 1)))
{
dx_f_drul_[d] = spanned_drul_[d]->extent (X_AXIS).length () / 2;
dx_f_drul_[d] -= d * x_gap_f;
- if (stem_l->get_direction () != get_direction ())
+ if (stem_l->get_direction () != my_dir)
{
- dy_f_drul_[d] = note_column_drul[d]->extent (Y_AXIS)[get_direction ()];
+ dy_f_drul_[d] = note_column_drul[d]->extent (Y_AXIS)[my_dir];
}
else
{
dy_f_drul_[d] = stem_l->chord_start_f ()
- + get_direction () * internote_f;
+ + my_dir * half_staff_space;
}
- dy_f_drul_[d] += get_direction () * y_gap_f;
+ dy_f_drul_[d] += my_dir * y_gap_f;
}
/*
side attached to (visible) stem
*/
if (stem_l->beam_l () && (stem_l->beam_count (-d) >= 1))
{
- dy_f_drul_[d] = stem_l->extent (Y_AXIS)[get_direction ()];
- dy_f_drul_[d] += get_direction () * 2 * y_gap_f;
+ dy_f_drul_[d] = stem_l->extent (Y_AXIS)[my_dir];
+ dy_f_drul_[d] += my_dir * 2 * y_gap_f;
}
/*
side attached to notehead, with stem getting in the way
dx_f_drul_[d] -= d * x_gap_f;
dy_f_drul_[d] = stem_l->chord_start_f ()
- + get_direction () * internote_f;
- dy_f_drul_[d] += get_direction () * y_gap_f;
+ + my_dir * half_staff_space;
+ dy_f_drul_[d] += my_dir * y_gap_f;
}
}
}
Real slope_ratio_f = abs (dy_f / dx_f);
if (slope_ratio_f > slope_damp_f)
{
- Direction d = (Direction)(- get_direction () * (sign (dy_f)));
+ Direction d = (Direction)(- my_dir * (sign (dy_f)));
if (!d)
d = LEFT;
Real damp_f = (slope_ratio_f - slope_damp_f) * dx_f;
must never change sign of dy
*/
damp_f = damp_f <? abs (dy_f);
- dy_f_drul_[d] += get_direction () * damp_f;
+ dy_f_drul_[d] += my_dir * damp_f;
}
/*
Real height_ratio_f = abs (height_f / width_f);
if (height_ratio_f > height_damp_f)
{
- Direction d = (Direction)(- get_direction () * (sign (dy_f)));
+ Direction d = (Direction)(- my_dir * (sign (dy_f)));
if (!d)
d = LEFT;
/* take third step */
*/
if (abs (dy_f / dx_f ) < slope_damp_f)
{
- dy_f_drul_[-d] += get_direction () * damp_f;
- dy_f_drul_[d] += get_direction () * damp_f;
+ dy_f_drul_[-d] += my_dir * damp_f;
+ dy_f_drul_[d] += my_dir * damp_f;
}
/*
don't change slope too much, would have been catched by slope damping
else
{
damp_f = damp_f <? abs (dy_f/2);
- dy_f_drul_[d] += get_direction () * damp_f;
+ dy_f_drul_[d] += my_dir * damp_f;
}
}
}
Note_column * nc = note_column_drul[d];
if (nc == spanned_drul_[d]
&& nc->stem_l ()
- && nc->stem_l ()->get_direction () == get_direction ()
- && abs (nc->stem_l ()->extent (Y_AXIS)[get_direction ()]
+ && nc->stem_l ()->get_direction () == my_dir
+ && abs (nc->stem_l ()->extent (Y_AXIS)[my_dir]
- dy_f_drul_[d] + (d == LEFT ? 0 : interstaff_f))
<= snap_f)
{
snapx_f_drul[d] = nc->stem_l ()->hpos_f ()
- spanned_drul_[d]->relative_coordinate (0, X_AXIS);
- snapy_f_drul[d] = nc->stem_l ()->extent (Y_AXIS)[get_direction ()]
+ snapy_f_drul[d] = nc->stem_l ()->extent (Y_AXIS)[my_dir]
+ interstaff_interval[d]
- + get_direction () * 2 * y_gap_f;
+ + my_dir * 2 * y_gap_f;
snapped_b_drul[d] = true;
}
else
{
Staff_symbol_referencer_interface si (this);
- return (si.lines_i () -1) * si.staff_space ();
+ return (si.line_count () -1) * si.staff_space ();
}
}
void
Staff_symbol_engraver::do_removal_processing()
{
- SCM l (get_property ("numberOfStaffLines", 0));
- if (gh_number_p(l))
- {
- span_p_->no_lines_i_ = gh_scm2int (l);
- }
-
- SCM sz (get_property ("staffLineLeading", 0));
- if (gh_number_p(sz))
- {
- span_p_->staff_space_ = gh_scm2double (sz);
- }
- else
- {
- span_p_->staff_space_ = paper_l ()->get_var ("interline");
- }
span_p_->set_bounds(RIGHT,get_staff_info().command_pcol_l ());
typeset_element (span_p_);
span_p_ =0;
s.elem_l_->add_dependency (span_p_); // UGH. UGH. UGH
SCM ss =s.elem_l_->remove_elt_property ("staff-support");
- if (gh_boolean_p (ss) && gh_scm2bool (ss))
+ if (to_boolean (ss))
{
Side_position_interface si (s.elem_l_);
if (si.has_interface_b ())
int
-Staff_symbol_referencer_interface::lines_i () const
+Staff_symbol_referencer_interface::line_count () const
{
Staff_symbol *st = staff_symbol_l ();
- return st ? st->no_lines_i_ : 5;
+ return st ? st->line_count () : 0;
}
Staff_symbol*
{
Staff_symbol * st = staff_symbol_l ();
if (st)
- return st->staff_space_;
+ return st->staff_space ();
else if (elt_l_->pscore_l_ && elt_l_->paper_l ())
elt_l_->paper_l ()->get_var ("interline");
#include "item.hh"
-Staff_symbol::Staff_symbol ()
-{
- no_lines_i_ = 5;
- staff_space_ = 5.0 PT;
-}
-
-void
-Staff_symbol::do_print() const
-{
-#ifndef NPRINT
- Spanner::do_print();
- DEBUG_OUT << "lines: " << no_lines_i_;
-#endif
-}
-
Molecule*
Staff_symbol::do_brew_molecule_p() const
{
Score_element * common
= spanned_drul_[LEFT]->common_refpoint (spanned_drul_[RIGHT], X_AXIS);
-
-#if 0
- Interval r = spanned_drul_[RIGHT]->extent (X_AXIS);
- Interval l = spanned_drul_[LEFT]->extent (X_AXIS);
- Real left_shift =l.empty_b () ? 0.0: l[LEFT];
- Real right_shift =r.empty_b () ? 0.0: r[RIGHT];
-#endif
Real width =
// right_shift - left_shift
+ spanned_drul_[RIGHT]->relative_coordinate (common , X_AXIS)
Molecule rule = lookup_l ()->filledbox (Box (Interval (0,width),
Interval (-t/2, t/2)));
- Real height = (no_lines_i_-1) * staff_space_ /2;
+ int l = line_count ();
+
+ Real height = (l-1) * staff_space () /2;
Molecule * m = new Molecule;
- for (int i=0; i < no_lines_i_; i++)
+ for (int i=0; i < l; i++)
{
Molecule a (rule);
- a.translate_axis (height - i * staff_space_, Y_AXIS);
+ a.translate_axis (height - i * staff_space (), Y_AXIS);
m->add_molecule (a);
}
- // m->translate_axis (left_shift, X_AXIS);
return m;
}
-
int
Staff_symbol::steps_i() const
{
- return no_lines_i_*2;
+ return line_count () * 2;
}
+
+int
+Staff_symbol::line_count () const
+{
+ return gh_scm2int (get_elt_property ("line-count"));
+}
+
Real
-Staff_symbol::staff_space ()
+Staff_symbol::staff_space ()const
{
- return staff_space_;
+ return gh_scm2double (get_elt_property ("staff-space"));
}
{
abbrev_p_ = new Stem_tremolo;
announce_element (Score_element_info (abbrev_p_, abbrev_req_l_));
- abbrev_p_->abbrev_flags_i_ =intlog2 (t) - (duration_log>? 2);
+ abbrev_p_->set_elt_property ("tremolo-flags", gh_int2scm (intlog2 (t) - (duration_log>? 2)));
}
}
#include "offset.hh"
#include "dimension-cache.hh"
#include "staff-symbol-referencer.hh"
-
+#include "directional-element-interface.hh"
Stem_tremolo::Stem_tremolo ()
{
set_elt_property ("stem", SCM_EOL);
- abbrev_flags_i_ = 1;
}
-void
-Stem_tremolo::do_print () const
-{
- DEBUG_OUT << "abbrev_flags_i_ " << abbrev_flags_i_;
-}
Stem *
Stem_tremolo::stem_l ()const
Real interbeam_f = paper_l ()->interbeam_f (mult);
Real w = gh_scm2double (get_elt_property ("beam-width"));
Real space = Staff_symbol_referencer_interface (st).staff_space ();
- Real internote_f = space / 2;
+ Real half_staff_space = space / 2;
Real beam_f = gh_scm2double (get_elt_property ("beam-thickness"));
int beams_i = 0;
Molecule a (lookup_l ()->beam (dydx, w, beam_f));
a.translate (Offset (-w/2, w / 2 * dydx));
+ int abbrev_flags = 1;
+ {
+ SCM a = get_elt_property ("abbrev-flags");
+ if (gh_number_p (a))
+ abbrev_flags = gh_scm2int (a);
+ }
Molecule *beams= new Molecule;
- for (int i = 0; i < abbrev_flags_i_; i++)
+ for (int i = 0; i < abbrev_flags; i++)
{
Molecule b (a);
b.translate_axis (interbeam_f * i, Y_AXIS);
if (st->beam_l ())
{
beams->translate (Offset(st->hpos_f () - hpos_f (),
- st->stem_end_position () * internote_f -
- st->beam_l ()->get_direction () * beams_i * interbeam_f));
+ st->stem_end_position () * half_staff_space -
+ directional_element (st->beam_l ()).get () * beams_i * interbeam_f));
}
else
{
Side_position_interface stafy (text);
SCM axisprop = get_property ("scriptHorizontal",0);
- if (gh_boolean_p (axisprop) && gh_scm2bool (axisprop))
+ if (to_boolean (axisprop))
{
stafy.set_axis (X_AXIS);
// text->set_parent (ss, Y_AXIS);
text->set_elt_property ("style", ly_str02scm (r->style_str_.ch_C()));
SCM empty = get_property ("textEmptyDimension", 0);
- if (gh_boolean_p (empty) && gh_scm2bool (empty))
+ if (to_boolean (empty))
{
text->set_empty (X_AXIS);
}
{
now_heads_.sort (CHead_melodic_tuple::pitch_compare);
stopped_heads_.sort(CHead_melodic_tuple::pitch_compare);
- int i=0;
- int j=0;
- int tie_count=0;
- while ( i < now_heads_.size () && j < stopped_heads_.size ())
+
+ SCM head_list = SCM_EOL;
+
+ int j = stopped_heads_.size ()-1;
+ int i = now_heads_.size ()-1;
+
+ while (i >= 0 && j >=0)
{
int comp
= Musical_pitch::compare (now_heads_[i].req_l_->pitch_ ,
if (comp)
{
- (comp < 0) ? i ++ : j++;
+ (comp < 0) ? j -- : i--;
continue;
}
else
{
- tie_count ++;
-
- /* don't go around recreating ties that were already
- made. Not infallible. Due to reordering in sort (),
- we will make the wrong ties when noteheads are
- added. */
- if (tie_count > tie_p_arr_.size ())
- {
- Tie * p = new Tie;
- p->set_head (LEFT, stopped_heads_[j].head_l_);
- p->set_head (RIGHT, now_heads_[i].head_l_);
- tie_p_arr_.push (p);
- announce_element (Score_element_info (p, req_l_));
- }
- i++;
- j++;
-
+ head_list = gh_cons (gh_cons (stopped_heads_[j].head_l_->self_scm_,
+ now_heads_[i].head_l_->self_scm_),
+ head_list);
+
+ past_notes_pq_. insert (now_heads_[i]);
+ now_heads_.del (i);
+ stopped_heads_.del (j);
+ i--;
+ j--;
}
}
+
+ SCM sparse = get_property ("sparseTies", 0);
+ if (to_boolean (sparse))
+ {
+ int i = scm_ilength (head_list);
+
+ if (!i)
+ return;
+
+ SCM pair = gh_list_ref (head_list, gh_int2scm (i/2));
+
+ Tie * p = new Tie;
+ p->set_head (LEFT, dynamic_cast<Item*> (unsmob_element (gh_car (pair))));
+ p->set_head (RIGHT, dynamic_cast<Item*> (unsmob_element (gh_cdr (pair))));
+
+ tie_p_arr_.push (p);
+ announce_element (Score_element_info (p, req_l_));
+ }
+ else for (SCM s = head_list; gh_pair_p (s); s = gh_cdr (s))
+ {
+ Tie * p = new Tie;
+ p->set_head (LEFT, dynamic_cast<Item*> (unsmob_element (gh_caar (s))));
+ p->set_head (RIGHT, dynamic_cast<Item*> (unsmob_element (gh_cdar (s))));
+
+ tie_p_arr_.push (p);
+ announce_element (Score_element_info (p, req_l_));
+ }
+
if (!tie_p_arr_.size ())
{
req_l_->warning (_ ("No ties were created!"));
Tie_engraver::do_post_move_processing ()
{
SCM m = get_property ("automaticMelismata",0);
- if (gh_boolean_p (m) && gh_scm2bool (m))
+ if (to_boolean (m))
{
set_melisma (false);
}
#include "paper-column.hh"
#include "debug.hh"
#include "staff-symbol-referencer.hh"
+#include "directional-element-interface.hh"
void
-Tie::set_head (Direction d, Note_head * head_l)
+Tie::set_head (Direction d, Item * head_l)
{
assert (!head (d));
index_set_cell (get_elt_property ("heads"), d, head_l->self_scm_);
return;
}
- Real interline_f = paper_l ()->get_var ("interline");
- Real internote_f = interline_f / 2;
+ Real staff_space = paper_l ()->get_var ("interline");
+ Real half_staff_space = staff_space / 2;
Real x_gap_f = paper_l ()->get_var ("tie_x_gap");
Real y_gap_f = paper_l ()->get_var ("tie_y_gap");
? Staff_symbol_referencer_interface (head (LEFT)).position_f ()
: Staff_symbol_referencer_interface (head (RIGHT)).position_f () ;
- Real y_f = internote_f * ypos;
+ Real y_f = half_staff_space * ypos;
int ypos_i = int (ypos);
Real dx_f = extent (X_AXIS).length () + dx_f_drul_[RIGHT] - dx_f_drul_[LEFT];
+ Direction dir = directional_element (this).get();
if (dx_f < paper_l ()->get_var ("tie_staffspace_length"))
{
if (abs (ypos_i) % 2)
- y_f += get_direction () * internote_f;
- y_f += get_direction () * y_gap_f;
+ y_f += dir * half_staff_space;
+ y_f += dir * y_gap_f;
}
else
{
if (! (abs (ypos_i) % 2))
- y_f += get_direction () * internote_f;
- y_f += get_direction () * internote_f;
- y_f -= get_direction () * y_gap_f;
+ y_f += dir * half_staff_space;
+ y_f += dir * half_staff_space;
+ y_f -= dir * y_gap_f;
}
dy_f_drul_[LEFT] = dy_f_drul_[RIGHT] = y_f;
return "|";
SCM nonauto = get_property ("barNonAuto", 0);
- if (!gh_boolean_p (nonauto) && gh_scm2bool (nonauto))
+ if (!to_boolean (nonauto))
{
SCM always = get_property ("barAlways", 0);
if (!measure_position ()
- || (gh_boolean_p (always) && gh_scm2bool (always)))
+ || (to_boolean (always)))
{
SCM def=get_property ("defaultBarType" ,0);
return (gh_string_p (def))? ly_scm2string (def) : "";
// urg: multi bar rests: should always process whole of first bar?
SCM tim = get_property ("timing", 0);
- bool timb = gh_boolean_p (tim) && gh_scm2bool (tim);
+ bool timb = to_boolean (tim);
if (timb && allbars)
{
Moment barleft = (measure_length () - measure_position ());
}
SCM cad = get_property ("timing", 0);
- bool c= gh_boolean_p (cad ) && gh_scm2bool (cad);
+ bool c= to_boolean (cad );
Moment len = measure_length ();
while (c && *measposp >= len)
{
bool grace= (i.elem_l_->get_elt_property ("grace") != SCM_UNDEFINED);
SCM wg = get_property ("weAreGraceContext",0);
- bool wgb = gh_boolean_p (wg) && gh_scm2bool (wg);
+ bool wgb = to_boolean (wg);
if (grace != wgb)
return;
if (bar_arr.top ()->type_str_.length_i () > 1)
no_vertical_end = false;
- Real interline_f = paper_l ()->get_var ("interline");
- Real internote_f = interline_f/2;
+ Real staff_space = paper_l ()->get_var ("interline");
+ Real half_staff_space = staff_space/2;
Real t = paper_l ()->get_var ("volta_thick");
- Real dx = internote_f;
+ Real dx = half_staff_space;
Real w = spanner_length() - dx - get_broken_left_end_align ();
Real h = paper_l()->get_var ("volta_spanner_height");
Molecule volta (lookup_l ()->volta (h, w, t, no_vertical_start, no_vertical_end));
Molecule two (lookup_l ()->text ("number", "2", paper_l ()));
Real gap = two.dim_.x ().length () / 2;
Offset off (num.dim_.x ().length () + gap,
- h / internote_f - gap);
+ h / half_staff_space - gap);
num.translate (off);
mol_p->add_molecule (volta);
mol_p->add_molecule (num);
interbeam = (2.0 * \interline + \stafflinethickness - \beam_thickness) / 2.0;
interbeam4 = (3.0 * \interline - \beam_thickness) / 3.0;
-
-
-% stems and beams
-%
-% poor man's array size
-stem_max = 3.0;
-
-%{ Specify length of stems for notes in the staff
-that don't have beams.
- Measured in staff positions.
-%}
-stem_length0 = 7.;
-stem_length1 = 5.;
-stem_length2 = 4.;
-stem_length3 = 3.;
-
%{
The space taken by a note is determined by the formula
arithmetic_multiplier = 0.9 * \quartwidth ;
-
-% urg.
-% if only these ugly arrays were scm,
-% we could override them in the Grace context
-grace_factor = 0.8;
-grace_stem_length0 = \stem_length0 * \grace_factor;
-grace_stem_length1 = \stem_length1 * \grace_factor;
-grace_stem_length2 = \stem_length2 * \grace_factor;
-grace_stem_length3 = \stem_length3 * \grace_factor;
-
-% only used for beams
-minimum_stem_length0 = 0.0 ; % not used
-minimum_stem_length1 = 3.;
-minimum_stem_length2 = 2.5;
-minimum_stem_length3 = 2.0;
-
-grace_minimum_stem_length0 = 0.0 ; % not used
-grace_minimum_stem_length1 = \minimum_stem_length1 * \grace_factor;
-grace_minimum_stem_length2 = \minimum_stem_length2 * \grace_factor;
-grace_minimum_stem_length3 = \minimum_stem_length3 * \grace_factor;
-
-%{
- stems in unnatural (forced) direction should be shortened,
- according to [Roush & Gourlay]. Their suggestion to knock off
- a whole staffspace seems a bit drastical: we'll do half.
-%}
-
-forced_stem_shorten0 = 1.0;
-forced_stem_shorten1 = \forced_stem_shorten0;
-forced_stem_shorten2 = \forced_stem_shorten1;
-forced_stem_shorten3 = \forced_stem_shorten2;
-
-% don't shorten grace stems, always up
-grace_forced_stem_shorten0 = 0.;
-grace_forced_stem_shorten1 = \grace_forced_stem_shorten0;
-grace_forced_stem_shorten2 = \grace_forced_stem_shorten1;
-grace_forced_stem_shorten3 = \grace_forced_stem_shorten2;
-
-% there are several ways to calculate the direction of a beam
-%
-% * MAJORITY : number count of up or down notes
-% * MEAN : mean centre distance of all notes
-% * MEDIAN : mean centre distance weighted per note
-%
-
-#'beam-dir-algorithm = #'majority %urg.
#'Stem_tremolo::beam-width = 1.5 * \quartwidth ;
-% The beams should be prevented to conflict with the stafflines,
-% especially at small slopes.
-#'slope-quantisation = #'normal
-
-
-
#'Clef_item::visibility-lambda = #postbreak-only-visibility
#'Key_item::visibility-lambda = #postbreak-only-visibility
#'Breathing_sign::visibility-lambda = #non-postbreak-visibility
-
-%{
-dit(code(beam_dir_algorithm)) Specify algorithm for determining
-whether beams go up or down. It is real valued. If set to 2.0 then
-majority selection is used. If set to 3.0, then mean selection is
-used based on the mean center distance. If set to 4.0 then median
-selection is used, based on the median center distance.
-%}
-
-
% catch suspect beam slopes, set slope to zero if
% outer stem is lengthened more than
beam_lengthened = 0.2 * \interline;
%
#'Local_key_item::left-padding = #'0.2
#'Local_key_item::right-padding = #'0.4
+
+#'Staff_symbol::staff-space = \interline ;
+#'Staff_symbol::line-count = #5
(list 'beamSlopeDamping number? 'damping)
(list 'autoKneeGap number? 'auto-knee-gap)
(list 'autoInterstaffKneeGap number? 'auto-interstaff-knee-gap)
- (list 'beamQuantisation symbol? 'slope-quantisation)
(list 'beamDirAlgorithm symbol? 'beam-dir-algorithm)
(list 'beamSlope number? 'height)
(list 'beamVerticalPosition number? 'y-position)
(list 'barSize number? 'bar-size))
)
)
+
+(define staff-symbol-properties
+ (cons "Staff_symbol" (list
+ (list 'numberOfStaffLines number? 'line-count)
+ (list 'staffLineLeading number? 'staff-space)
+ )
+ )
+ )
+
(define generic-breathing-sign-properties
(cons "Breathing_sign"
(list