+++ /dev/null
-% core dumps
-
-global = \notes {
- \key a \minor;
- \time 6/4;
-}
-
-\score{
- \notes \context PianoStaff <
- \global
- \context Staff=up { c }
- %\context Staff=down { \autochange Staff c }
-% \context Staff=down { c }
- >
- \paper {
- \translator{
- \StaffContext
-
- % other core dump when this is removed?
-% \remove "Time_signature_engraver";
- }
- }
-}
-
+++ /dev/null
-
-\score { \notes { c1 \< \break \! c1 }}
+++ /dev/null
-/*
- axis-item.cc -- implement Axis_group_item
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-#include "axis-group-item.hh"
-#include "paper-column.hh"
-
-
-
-void
-Axis_group_item::do_breakable_col_processing()
-{
-#if 0
- if (!breakable_b ()) // ugh should merge with Item code
- return;
-
- OK();
- copy_breakable_items();
-
-
- Link_array<Score_element> elems = elem_l_arr ();
- for (int i=0; i < elems.size(); i++)
- {
- Item* it_l = dynamic_cast<Item*> (elems[i]);
- Direction j=LEFT;
- do
- {
- Axis_group_item * my_brok
- = dynamic_cast<Axis_group_item*> (find_broken_piece(j));
- Item *new_l = it_l->find_broken_piece (j);
- my_brok->add_element (new_l);
- }
- while (flip(&j)!=LEFT);
- }
-#endif
- Item::do_breakable_col_processing();
-}
-
+++ /dev/null
-/*
- axis-group-spanner.cc -- implement Axis_group_spanner
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "axis-group-spanner.hh"
-#include "debug.hh"
-#include "item.hh"
-#include "paper-column.hh"
-
-/** Do stuff if we're not broken. In this case the last and first
- columns usually are pre- and postbreak respectively,
- so the items from these columns need adjusting.
- */
-void
-Axis_group_spanner::do_break_processing_if_unbroken()
-{
-#if 0
- Link_array<Score_element> elems = elem_l_arr ();
- Line_of_score *my_line = line_l();
- for (int i=0; i < elems.size(); i++)
- {
- if (!elems[i]->line_l())
- {
- Item * item_l = dynamic_cast<Item*> (elems[i]);
- if (item_l
- && item_l->breakable_b ()
- && item_l->break_status_dir() == 0)
- {
- // last two checks are paranoia
- Score_element * broken_item_l =
- item_l->find_broken_piece (my_line);
- add_element (broken_item_l);
- }
-
- Spanner *spanner_l = dynamic_cast<Spanner*> (elems[i]);
- if (spanner_l)
- {
- Score_element *broken_spanner_l =
- spanner_l->find_broken_piece (my_line);
- add_element (broken_spanner_l);
- }
- remove_element (elems[i]);
- }
-
- }
-#endif
-}
-
-void
-Axis_group_spanner::do_break_processing()
-{
- Spanner::do_break_processing ();
-
- bool breaking_self_b = ! Spanner::line_l();
- if (!breaking_self_b)
- {
- do_break_processing_if_unbroken();
- Spanner::do_break_processing();
- return;
- }
-
-#if 0
- break_into_pieces ();
- Link_array<Score_element> loose_elems = elem_l_arr ();
-
- Array<int> axeses;
-
- for (int i=0; i < loose_elems.size (); i++)
- {
- Score_element* elt = loose_elems[i];
- /*
- with which axes do we have to meddle?
- */
- int j =0;
- int as [2];
- for (int a = X_AXIS; a < NO_AXES; ++a)
- if (elt->parent_l (Axis (a)) == this)
- as[j++] = a;
- if (j == 1)
- as[j++] = as[0];
-
- axeses.push (as[0]);
- axeses.push (as[1]);
- }
-
- remove_all();
-
- for (int i=0; i < loose_elems.size(); i++)
- {
- Score_element * elt = loose_elems[i];
- Line_of_score *elt_line = elt->line_l();
-
- Axis a1= (Axis)axeses[2*i]; // ugh.
- Axis a2= (Axis)axeses[2*i+1]; // ugh.
- if (! elt_line)
- {
- /* this piece doesn't know where it belongs.
- Find out if it was broken, and use the broken remains
- */
-
-
- Item *it = dynamic_cast <Item *> (elt) ;
- if (Spanner * sp =dynamic_cast <Spanner *> (elt))
- {
- for (int j =0; j < sp->broken_into_l_arr_.size(); j++)
- {
- Line_of_score *l = sp->broken_into_l_arr_[j]->line_l ();
-
- Axis_group_spanner * my_broken_l
- = dynamic_cast<Axis_group_spanner*>(find_broken_piece (l));
-
- Score_element * broken_span_l
- = sp->find_broken_piece (l);
-
- if (broken_span_l)
- my_broken_l->add_element (broken_span_l, a1, a2);
- }
- }
- else if (it && it->broken_original_b ())
- {
- // broken items
- Direction j=LEFT;
- do
- {
- Item * broken_item = it->find_broken_piece (j);
- Line_of_score * item_line_l = broken_item->line_l() ;
- if (! item_line_l)
- continue;
-
- Axis_group_spanner * v
- = dynamic_cast<Axis_group_spanner*>(find_broken_piece (item_line_l));
- if (v)
- v->add_element (broken_item, a1, a2);
- else
- {
- broken_item->set_elt_property ("transparent", SCM_BOOL_T);
- broken_item->set_empty (X_AXIS); // UGH.
- broken_item->set_empty (Y_AXIS);
- }
-
- }
- while (flip(&j) != LEFT);
- }
- }
- else
- {
- /* this piece *does* know where it belongs.
- Put it in appropriate piece of this spanner
- */
- Axis_group_spanner * my_broken_l
- = dynamic_cast<Axis_group_spanner*> (find_broken_piece (elt->line_l()));
- my_broken_l->add_element (elt, a1, a2);
- }
- }
-
- Spanner::do_break_processing();
-#endif
-}
-
-
-
-
+++ /dev/null
-/*
- chord-tremolo-engraver.hh -- declare Chord_tremolo_engraver
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
- Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-
-#ifndef Chord_tremolo_HH
-#define Chord_tremolo_HH
-
-#include "beam.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 */
-class Chord_tremolo : public Beam {
-public:
- VIRTUAL_COPY_CONS(Score_element);
-
-protected:
- virtual Molecule stem_beams (Stem *here, Stem *next, Stem *prev) const;
-};
-
-#error
-#endif // Chord_tremolo_HH
-
+++ /dev/null
-#ifndef GLOB_HH
-#define GLOB_HH
-#include <assert.h>
-#include <math.h>
-#include "real.hh"
-
-#include "lily-proto.hh"
-#include "const.hh"
-#endif
+++ /dev/null
-/*
- graphical-element.hh -- declare Graphical_element
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef GRAPHICAL_ELEMENT_HH
-#define GRAPHICAL_ELEMENT_HH
-
-#include "offset.hh"
-#include "lily-proto.hh"
-#include "interval.hh"
-#include "virtual-methods.hh"
-#error
-
-
-/** The 2d geometric aspects of a score-element.
- */
-class Graphical_element
-{
-};
-
-#endif // GRAPHICAL_ELEMENT_HH
-
+++ /dev/null
-/*
- staff-side.hh -- declare Staff_side_{element,spanner,item}
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
-
-#ifndef STAFF_SIDE_HH
-#define STAFF_SIDE_HH
-
-
-#include "spanner.hh"
-#include "item.hh"
-#include "staff-symbol-referencer.hh"
-#include "directional-element.hh"
-
-struct Side_position_interface
-{
- Score_element * elt_l_;
-public:
- Side_position_interface (Score_element*);
- static Real side_position (Dimension_cache const *);
- static Real self_alignment (Dimension_cache const *);
- static Real aligned_side (Dimension_cache const *);
- static Real quantised_position (Dimension_cache const*);
- void set_axis (Axis);
- void set_quantised (Axis);
- Axis get_axis () const;
-
- bool supported_b () const;
- bool is_staff_side_b () const;
- void add_support (Score_element*);
-
- Direction get_direction () const;
- void set_direction (Direction);
-};
-
-
-
-#endif /* STAFF_SIDE_HH */
-
+++ /dev/null
-/*
- staff-sym-engraver.hh -- declare Staff_symbol_engraver
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef STAFF_SYMBOL_GRAV_HH
-#define STAFF_SYMBOL_GRAV_HH
-#include "engraver.hh"
-#include "moment.hh"
-
-/**
- Manage the staff symbol.
- */
-class Staff_symbol_engraver : public Engraver {
- Staff_symbol *span_p_;
-public:
- VIRTUAL_COPY_CONS(Translator);
- Staff_symbol_engraver();
-
-protected:
- virtual ~Staff_symbol_engraver();
-
- virtual void acknowledge_element (Score_element_info);
- virtual void do_removal_processing();
- virtual void do_creation_processing();
-
-};
-#endif // STAFF_SYMBOL_GRAV_HH
+++ /dev/null
-/*
- stem-staff-side.hh -- declare Stem_staff_side
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
-
-#ifndef Stem_STAFF_SIDE_HH
-#define Stem_STAFF_SIDE_HH
-
-#error
-
-#include "staff-side.hh"
-/**
- Position self, analogous to Staff_side_item, but use Stem direction
- for determining direction.
-
- Properties:
-
- padding :: Real
-
- Padding in staffline leading
-
- */
-class Stem_staff_side_item : public Staff_side_item
-{
- Stem *stem_l_;
-public:
- Direction relative_dir_;
-
- void set_stem (Stem*);
- Stem_staff_side_item ();
-protected:
- virtual Direction get_default_direction ()const;
- virtual void do_pre_processing ();
- virtual void do_post_processing ();
-};
-
-#endif /* Stem_STAFF_SIDE_HH */
-
+++ /dev/null
-#if 0
-// not finished yet.
-/*
- specialty-engraver.cc -- implement Specialty_engraver
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
-
-
-#include "engraver.hh"
-
-class Specialty_engraver : public Engraver
-{
-
-public:
- VIRTUAL_COPY_CONS(Translator);
-protected:
- void acknowledge_element (Score_element_info);
-};
-
-
-void
-Specialty_engraver::acknowledge_element (Score_element_info )
-{
- /*
- We could do groovy stuff, by inserting our own custom (FUNC,FONT)
- pairs (Atoms in fact) into acknowledged elements.
-
- But not yet. This would be cleaner if we had SCM as properties.
- */
-}
-#endif
+++ /dev/null
-/*
- staff-side.cc -- implement Staff_side_element
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
-
-#include "staff-side.hh"
-#include "staff-symbol.hh"
-#include "debug.hh"
-#include "warn.hh"
-#include "dimensions.hh"
-#include "dimension-cache.hh"
-
-Side_position_interface::Side_position_interface (Score_element *e)
-{
- elt_l_ = e;
-}
-
-
-void
-Side_position_interface::add_support (Score_element*e)
-{
- SCM sup = elt_l_->get_elt_property ("side-support");
- elt_l_->set_elt_property ("side-support",
- gh_cons (e->self_scm_,sup));
-}
-
-
-
-Direction
-Side_position_interface::get_direction () const
-{
- SCM d = elt_l_->get_elt_property ("direction");
- if (isdir_b (d))
- return to_dir (d) ? to_dir (d) : DOWN;
-
- Direction relative_dir = UP;
- SCM reldir = elt_l_->get_elt_property ("side-relative-direction"); // should use a lambda.
- if (isdir_b (reldir))
- {
- relative_dir = to_dir (reldir);
- }
-
- SCM other_elt = elt_l_->get_elt_property ("direction-source");
- Score_element * e = unsmob_element(other_elt);
- if (e)
- {
- return relative_dir * Side_position_interface (e).get_direction ();
- }
-
- return DOWN;
-}
-
-/**
- Callback that does the aligning.
- */
-Real
-Side_position_interface::side_position (Dimension_cache const * c)
-{
- Score_element * me = dynamic_cast<Score_element*> (c->element_l ());
-
- Interval dim;
- Axis axis = c->axis ();
- Score_element *common = me->parent_l (axis);
- SCM support = me->get_elt_property ("side-support");
- for (SCM s = support; s != SCM_EOL; s = gh_cdr (s))
- {
- Score_element * e = unsmob_element ( gh_car (s));
- if (e)
- common = common->common_refpoint (e, axis);
- }
-
- for (SCM s = support; s != SCM_EOL; s = gh_cdr (s))
- {
-
- Score_element * e = unsmob_element ( gh_car (s));
- if (e)
- {
- Real coord = e->relative_coordinate (common, axis);
-
- dim.unite (coord + e->extent (axis));
- }
- }
-
- if (dim.empty_b ())
- {
- dim = Interval(0,0);
- }
-
- Real off = me->parent_l (axis)->relative_coordinate (common, axis);
-
-
- Direction dir = Side_position_interface (me).get_direction ();
-
- SCM pad = me->remove_elt_property ("padding");
- if (pad != SCM_UNDEFINED)
- {
- off += gh_scm2double (pad) * dir;
- }
- Real total_off = dim[dir] + off;
-
- if (fabs (total_off) > 100 CM)
- programming_error ("Huh ? Improbable staff side dim.");
-
- return total_off;
-}
-
-Real
-Side_position_interface::self_alignment (Dimension_cache const *c)
-{
- String s ("self-alignment-");
- Axis ax = c->axis ();
- s += (ax == X_AXIS) ? "X" : "Y";
- Score_element *elm = dynamic_cast<Score_element*> (c->element_l ());
- SCM align (elm->get_elt_property (s));
- if (isdir_b (align))
- {
- Direction d = to_dir (align);
- Interval ext(elm->extent (ax));
- if (d)
- {
- return - ext[d];
- }
- return - ext.center ();
- }
- else
- return 0.0;
-}
-
-
-Real
-directed_round (Real f, Direction d )
-{
- if (d < 0)
- return floor (f);
- else
- return ceil (f);
-}
-
-Real
-Side_position_interface::quantised_position (Dimension_cache const *c)
-{
- Score_element * me = dynamic_cast<Score_element*> (c->element_l ());
- Side_position_interface s(me);
- Direction d = s.get_direction ();
-
- Staff_symbol_referencer *ref = dynamic_cast<Staff_symbol_referencer*> (me);
- if (ref)
- {
- Real p = ref->position_f ();
- Real rp = directed_round (d, p);
-
- int ip = int (p);
- if (!(ip % 2))
- {
- ip += d;
- rp += d;
- }
-
- return (rp - p) * ref->staff_line_leading_f ();
- }
- return 0.0;
-}
-
-Real
-Side_position_interface::aligned_side (Dimension_cache const *c)
-{
- Score_element * me = dynamic_cast<Score_element*> (c->element_l ());
- Side_position_interface s(me);
- Direction d = s.get_direction ();
- Axis ax = c->axis ();
- Real o = side_position (c);
-
- Interval iv = me->extent (ax);
-
- if (!iv.empty_b ())
- {
- o += - iv[-d];
-
- SCM pad = me->get_elt_property ("padding");
- if (gh_number_p (pad))
- o += d *gh_scm2double (pad) ;
- }
- return o;
-}
-
-
-
-
-void
-Side_position_interface::set_axis (Axis a)
-{
- // prop transparent ?
- if (elt_l_->get_elt_property ("side-support") == SCM_UNDEFINED)
- elt_l_->set_elt_property ("side-support" ,SCM_EOL);
-
- elt_l_->dim_cache_[a]->off_callbacks_.push (aligned_side);
-}
-
-
-void
-Side_position_interface::set_quantised (Axis a)
-{
- Dimension_cache * c = elt_l_->dim_cache_[a];
- for (int i=0; i < c->off_callbacks_.size (); i++)
- if (c->off_callbacks_[i] == aligned_side)
- c->off_callbacks_[i] = side_position ;
- c->off_callbacks_.push (quantised_position);
-}
-
-Axis
-Side_position_interface::get_axis () const
-{
- Dimension_cache * c = elt_l_->dim_cache_[X_AXIS];
- for (int i=0 ; i < c->off_callbacks_.size();i ++)
- if (c->off_callbacks_[i] == side_position
- ||c->off_callbacks_[i] == aligned_side)
- return X_AXIS;
-
-
- return Y_AXIS;
-}
-
-void
-Side_position_interface::set_direction (Direction d)
-{
- elt_l_->set_elt_property ("direction", gh_int2scm (d));
-}
-
-bool
-Side_position_interface::is_staff_side_b () const
-{
- return elt_l_->get_elt_property ("side-support") != SCM_UNDEFINED;
-}
-
-bool
-Side_position_interface::supported_b () const
-{
- SCM s =elt_l_->get_elt_property ("side-support");
- return s != SCM_UNDEFINED && s != SCM_EOL;
-}
+++ /dev/null
-/*
- staff-sym-reg.cc -- implement Staff_symbol_engraver
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "staff-sym-engraver.hh"
-#include "staff-symbol.hh"
-#include "score.hh"
-#include "paper-column.hh"
-#include "staff-symbol-referencer.hh"
-#include "paper-def.hh"
-#include "staff-side.hh"
-
-Staff_symbol_engraver::~Staff_symbol_engraver()
-{
- assert (!span_p_);
-}
-
-Staff_symbol_engraver::Staff_symbol_engraver()
-{
- span_p_ = 0;
-}
-
-void
-Staff_symbol_engraver::do_creation_processing()
-{
- span_p_ = new Staff_symbol;
- span_p_->set_bounds(LEFT,get_staff_info().command_pcol_l ());
- announce_element (Score_element_info (span_p_, 0));
-}
-
-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_line_leading_f_ = gh_scm2double (sz);
- }
- else
- {
- span_p_->staff_line_leading_f_ = paper_l ()->get_var ("interline");
- }
- span_p_->set_bounds(RIGHT,get_staff_info().command_pcol_l ());
- typeset_element (span_p_);
- span_p_ =0;
-}
-
-void
-Staff_symbol_engraver::acknowledge_element (Score_element_info s)
-{
- s.elem_l_->set_elt_property ("staff-symbol", span_p_->self_scm_);
- 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))
- {
- Side_position_interface si (s.elem_l_);
- if (si.is_staff_side_b ())
- si.add_support (span_p_);
- }
-}
-
-
-ADD_THIS_TRANSLATOR(Staff_symbol_engraver);
-
+++ /dev/null
-/*
- staffsym.cc -- implement Staff_symbol
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-#include "staff-symbol.hh"
-#include "lookup.hh"
-#include "dimensions.hh"
-#include "paper-def.hh"
-#include "molecule.hh"
-#include "debug.hh"
-#include "item.hh"
-
-
-Staff_symbol::Staff_symbol ()
-{
- no_lines_i_ = 5;
- staff_line_leading_f_ = 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)
- - spanned_drul_[LEFT]->relative_coordinate (common, X_AXIS)
- ;
-
- Real t = paper_l ()->get_var ("stafflinethickness");
- Molecule rule = lookup_l ()->filledbox (Box (Interval (0,width),
- Interval (-t/2, t/2)));
-
- Real height = (no_lines_i_-1) * staff_line_leading_f_ /2;
- Molecule * m = new Molecule;
- for (int i=0; i < no_lines_i_; i++)
- {
- Molecule a (rule);
- a.translate_axis (height - i * staff_line_leading_f_, 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;
-}
+++ /dev/null
-/*
- stem-info.cc -- implement Stem_info
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
-
-*/
-
-#include "proto.hh"
-#include "misc.hh"
-#include "cross-staff.hh"
-#include "debug.hh"
-#include "stem.hh"
-#include "paper-def.hh"
-#include "lookup.hh"
-#include "stem-info.hh"
-#include "beam.hh"
-
-
-Stem_info::Stem_info ()
-{
-}
-
-
-/*
- FIXME: y dims should not be in internote.
-
-
- GURG UGRGINRG INA UG R
-
- JUNKME -> this should set elt properties of STEM.
-*/
-Stem_info::Stem_info (Stem*s, int mult)
-{
- mult_i_ =mult;
- stem_l_ = s;
- Beam* beam_l = stem_l_->beam_l ();
-
- x_ = stem_l_->hpos_f ();
- set_direction (stem_l_->get_direction ());
- SCM bd = stem_l_->remove_elt_property ("beam-dir");
-
- if (gh_number_p (bd))
- {
- beam_dir_ = gh_scm2int (bd);
- }
- else
- {
- programming_error ("Beam direction not set.");
- beam_dir_ = UP; // GURAUGRNAGURAGU! urg !
- }
-
- Paper_def* paper_l = stem_l_->paper_l ();
- Real internote_f = stem_l_->staff_line_leading_f ()/2;
- Real interbeam_f = paper_l->interbeam_f (mult_i_);
- Real beam_f = gh_scm2double (beam_l->get_elt_property ("beam-thickness"));
-
-
- // strangely enough, dim(chord_start_f) == pt (and not internote!)
- idealy_f_ = stem_l_->chord_start_f () / internote_f;
-
- // calculate using dim(y) == pt
- idealy_f_ *= internote_f;
-
- // for simplicity, we calculate as if dir == UP
- idealy_f_ *= beam_dir_;
-
- bool grace_b = stem_l_->get_elt_property ("grace") != SCM_UNDEFINED;
- bool no_extend_b = stem_l_->get_elt_property ("no-stem-extend")
- != SCM_UNDEFINED;
-
- int stem_max = (int)rint(paper_l->get_var ("stem_max"));
- String type_str = grace_b ? "grace_" : "";
- Real min_stem_f = paper_l->get_var (type_str + "minimum_stem_length"
- + to_str (mult_i_ <? stem_max)) * internote_f;
- Real stem_f = paper_l->get_var (type_str + "stem_length"
- + to_str (mult_i_ <? stem_max))* internote_f;
-
- if (!beam_dir_ || (beam_dir_ == get_direction ()))
- /* normal beamed stem */
- {
- if (mult_i_)
- {
- idealy_f_ += beam_f;
- idealy_f_ += (mult_i_ - 1) * interbeam_f;
- }
- miny_f_ = idealy_f_;
- maxy_f_ = INT_MAX;
-
- idealy_f_ += stem_f;
- miny_f_ += min_stem_f;
-
- /*
- lowest beam of (UP) beam must never be lower than second staffline
-
- Hmm, reference (Wanske?)
-
- Although this (additional) rule is probably correct,
- I expect that highest beam (UP) should also never be lower
- than middle staffline, just as normal stems.
-
- */
- if (!grace_b && !no_extend_b)
- {
- //highest beam of (UP) beam must never be lower than middle staffline
- miny_f_ = miny_f_ >? 0;
- //lowest beam of (UP) beam must never be lower than second staffline
- miny_f_ = miny_f_ >? (- 2 * internote_f - beam_f
- + (mult_i_ > 0) * beam_f + interbeam_f * (mult_i_ - 1));
- }
- }
- else
- /* knee */
- {
- idealy_f_ -= beam_f;
- maxy_f_ = idealy_f_;
- miny_f_ = -INT_MAX;
-
- idealy_f_ -= stem_f;
- maxy_f_ -= min_stem_f;
- }
-
- // set dim(y) == internote
- idealy_f_ /= internote_f;
- miny_f_ /= internote_f;
- maxy_f_ /= internote_f;
-
- idealy_f_ = maxy_f_ <? idealy_f_;
- idealy_f_ = miny_f_ >? idealy_f_;
-
- interstaff_f_ = calc_interstaff_dist (stem_l_, beam_l) / internote_f;
- idealy_f_ += interstaff_f_* beam_dir_;
- miny_f_ += interstaff_f_ * beam_dir_;
- maxy_f_ += interstaff_f_ * beam_dir_;
-}
-
-