#include "directionalspanner.hh"
#include "plist.hh"
-/// a beam connects multiple stems
+/** 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 */
struct Beam: public Directional_spanner {
PointerList<Stem*> stems;
Real slope;
Real left_pos;
- /// dir: -1 below heads, +1 above heads.
+
- /****************/
+ /* *************** */
const char * name() const;
virtual Interval width()const;
void solve_slope();
Molecule*brew_molecule_p()const;
};
-/** Beam adjusts the stems its owns to make sure that they reach the
- beam and that point in the correct direction */
#endif // BEAM_HH
PScore &pscore_;
Real linelength;
- /****************/
+ /* *************** */
Break_algorithm(PScore&);
bool change;
- /****************/
+ /* *************** */
Clef_item();
void read(Clef);
typedef Interval_t<Moment> MInterval;
-/// data structure which represents rhythmic units
+/** data structure which represents rhythmic units this is a tree. It groupes notes according to rules
+ */
struct Rhythmic_grouping {
Array<Rhythmic_grouping*> children;
MInterval *interval_;
- /****************/
+ /* *************** */
Array<MInterval> intervals();
MInterval interval()const;
void junk();
void copy(Rhythmic_grouping const&);
};
-/**
- this is a tree. It groupes notes according to rules
-
- */
-
#endif
struct Commands_at : public IPointerList<Input_command*> {
Time_description tdescription_;
- /****************/
+ /* *************** */
Moment when();
void parse(Staff_commands_at*);
struct Input_cursor : public PCursor<Commands_at*>
{
- /****************/
+ /* *************** */
Input_cursor(PCursor<Commands_at*>);
Moment when()const;
void find_moment(Moment w);
struct Input_commands : public IPointerList<Commands_at*> {
Input_cursor ptr;
- /****************/
+ /* *************** */
void find_moment(Moment);
void add(Input_command c,Assoc<String,Moment> &marks_assoc_r);
void translate_time(Moment dt);
};
-/// ABC for input structures
+/**
+
+ Input_music is anything that can simply be regarded as/converted to
+ a set of voices "cooperating" or independant. It has some basic
+ characteristics that real music has too:
+
+ - it is rhythmic (it has a length, and can be translated horizontally)
+ - a pitch (it can be transposed)
+
+ */
+
+
struct Input_music {
virtual Voice_list convert()const=0;
virtual Moment length()const=0;
virtual Input_music *clone() const = 0;
virtual Simple_music *simple() { return 0; }
};
-/**
-
- Input_music is anything that can simply be regarded as/converted to
- a set of voices "cooperating" or independant. It has some basic
- characteristics that real music has too:
-
- - it is rhythmic (it has a length, and can be translated horizontally)
- - a pitch (it can be transposed)
-
- */
-
/// Simple music consists of one voice
struct Simple_music : Input_music {
Voice voice_;
- /****/
+ /* *** */
virtual Simple_music*simple() { return this; }
void add(Voice_element*);
virtual void set_default_group(String g) { voice_.set_default_group(g); }
/// Complex_music consists of multiple voices
struct Complex_music : Input_music {
IPointerList<Input_music*> elts;
- /****************/
+ /* *************** */
virtual void set_default_group(String g);
void add(Input_music*);
Complex_music();
};
-/// multiple stuff after each other
+
+/**
+ voice like.
+
+ different music forms which start after each other ( concatenated,
+ stacked "horizontally )
+
+ */
+
struct Music_voice : Complex_music {
- /****************/
+ /* *************** */
Moment length()const;
virtual void translate_time(Moment dt);
virtual Voice_list convert()const;
}
virtual void print() const ;
};
-/**
- voice like.
- different music forms which start after each other ( concatenated,
- stacked "horizontally )
-
- */
+/**
+ Multiple musicstuff stacked on top of each other
+ chord like :
-/// Multiple musicstuff stacked on top of each other
+ - different music forms which start at the same time ( stacked "vertically" )
+
+ */
struct Music_general_chord : Complex_music {
- /****************/
+ /* *************** */
virtual Moment length()const;
virtual Voice_list convert()const;
virtual void print() const ;
};
-/**
- chord like :
-
- - different music forms which start at the same time ( stacked "vertically" )
-
- */
struct Multi_voice_chord : Music_general_chord {
void set_default_group(String);
IPointerList<Input_staff*> staffs_;
IPointerList<Input_command*> commands_;
- /****************************************************************/
+ /* *************************************************************** */
Input_score();
Input_score(Input_score const&);
void add(Array<Input_command*> &s);
void print() const;
Score*parse();
};
-/**
-
- */
+
#endif
IPointerList<Input_command*> commands_;
IPointerList<Input_music*> music_;
- /****************/
+ /* *************** */
void add(Input_music*m);
Input_staff(Input_staff const&);
#include "string.hh"
#include "staffelem.hh"
-/// a horizontally fixed size element of the score
+/**
+ a horizontally fixed size element of the score
+
+ Item is the datastructure for printables whose width is known
+ before the spacing is calculated
+
+ NB. This doesn't mean an Item has to initialize the output field before
+ spacing calculation.
+
+*/
+
struct Item : Staff_elem {
/// indirection to the column it is in
PCol * pcol_l_;
- /****************/
+ /* *************** */
virtual Item *item() { return this; }
Item();
void do_print()const;
const char*name()const;
};
-/** Item is the datastructure for printables whose width is known
- before the spacing is calculated
-
- NB. This doesn't mean an Item has to initialize the output field before
- spacing calculation.
-
-*/
#endif
class Key {
Array<int> accidentals;
- /****************/
+ /* *************** */
public:
Array<int> read(Array<Scalar> );
struct Clef;
-///
+/// An item which places accidentals at the start of the line
struct Keyitem : Item {
const char * name() const;
Array<int> pitch;
int c_position;
- /****************/
+ /* *************** */
Keyitem(int cposition);
void add(int pitch, int acc);
Molecule* brew_molecule_p()const;
};
-/**
- An item which places accidentals at the start of the line
- */
#endif // KEYITEM_HH
Notename_tab * defaulttab;
char const* data_ch_c_l_m;
int errorlevel_i_;
- /****************/
+ /* *************** */
int ret_notename(int *p, String text, int octave_mod);
char const* here_ch_c_l();
void set(Notename_tab *n);
const Real* fixpos;
Interval width;
- /****************/
+ /* *************** */
Colinfo();
void operator=(Colinfo const&);
Colinfo(Colinfo const&);
};
-/// spacing for one line.
+/** the problem, given by the columns (which include constraints) and
+ intercolumn spacing. The problem is:
+
+ Generate a spacing which
+ \begin{itemize}
+ \item
+ Satisfies spacing constraints (notes can't be printed through each other)
+ \item
+ Looks good, ie tries to conform to an ideal spacing as much as possible.
+ \end{itemize}
+ This is converted by regarding idealspacing as "springs" attached
+ to columns. The equilibrium of one spring is the ideal
+ distance. The columns have a size, this imposes "hard" constraints
+ on the distances. This transforms the problem into a quadratic
+ programming problem with linear constraints.
+
+ The quality is given by the total potential energy in the
+ springs. The lower the energy, the better the configuration.
+*/
class Spacing_problem {
Array<const Idealspacing*> ideals;
Array<Colinfo> cols;
void make_constraints(Mixed_qp& lp) const;
public:
- /// solve the spacing problem
+ /** solve the spacing problem
+ return the column positions, and the energy (last element)
+ */
Array<Real> solve() const;
- /**
- return the column positions, and the energy (last element)
- */
+
/// add a idealspacing to the problem.
- void add_ideal(const Idealspacing *i);
-
/**
+
+
One pair of columns can have no, one or more idealspacings,
since they can be "summed" if the columns to which #i# refers are
not in this problem, the spacing is ignored.
*/
+ void add_ideal(const Idealspacing *i);
/// add a col to the problem
- void add_column(const PCol *, bool fixed=false, Real fixpos=0.0);
- /** columns have to be added left to right. The column contains
+ /** columns have to be added left to right. The column contains
info on it's minimum width.
*/
+ void add_column(const PCol *, bool fixed=false, Real fixpos=0.0);
+
bool check_constraints(Vector v) const;
};
-/** the problem, given by the columns (which include constraints) and
- intercolumn spacing. The problem is:
-
- Generate a spacing which
- \begin{itemize}
- \item
- Satisfies spacing constraints (notes can't be printed through each other)
- \item
- Looks good, ie tries to conform to an ideal spacing as much as possible.
- \end{itemize}
- This is converted by regarding idealspacing as "springs" attached
- to columns. The equilibrium of one spring is the ideal
- distance. The columns have a size, this imposes "hard" constraints
- on the distances. This transforms the problem into a quadratic
- programming problem with linear constraints.
-
- The quality is given by the total potential energy in the
- springs. The lower the energy, the better the configuration.
-*/
#endif
Array<Item*> group;
int c0_position; // move into walker
- /****************/
+ /* *************** */
Local_key_item(int c0position);
void add(Item*);
#include "textitem.hh"
struct Lyric_item : Text_item {
- /****************/
+ /* *************** */
Lyric_item(Lyric_req* lreq_l, int voice_count_i);
virtual void do_pre_processing();
};
struct Lyric_walker: Staff_walker {
Array<Lyric_item*> litem_l_array_;
- /****************/
+ /* *************** */
virtual void do_TYPESET_command(Command*);
virtual void do_INTERPRET_command(Command*);
struct Meter: Item {
const char * name() const;
Array<Scalar> args;
- /****************/
+ /* *************** */
Meter(Array<Scalar> args) ;
Molecule*brew_molecule_p() const;
Offset off;
Symbol sym;
- /****************/
+ /* *************** */
void translate(Offset o) {
off += o;
String TeXstring() const;
};
-/// a group of #Atom#s
+
+/** a group of individually translated symbols. You can add molecules
+ to the top, to the right, etc. */
struct Molecule {
IPointerList<Atom*> ats; // change to List<Atom>?
- /****************/
+ /* *************** */
Molecule() { }
Molecule(Atom a) { add(a) ; }
private:
void operator=(const Molecule&);
};
-/** a group of individually translated symbols. You can add molecules
- to the top, to the right, etc. */
#endif
#define NOTEHEAD_HH
#include "item.hh"
-/// ball at the end of the stem
+/**
+ ball at the end of the stem
+takes care of:
+
+ * help lines
+ * proper placing of dots
+
+ */
+
struct Notehead : Item {
const char * name() const;
const char* defined_ch_c_l_m; //sorry, trying to find error in martien.ly
int balltype;
int x_dir;
- /****************/
+ /* *************** */
void set_rhythmic(Rhythmic_req *);
- Notehead(int staff_size);
+
/**
position of top line (5 linestaff: 8)
*/
-
+ Notehead(int staff_size);
void do_print()const;
static int compare(Notehead*&a, Notehead*&b) ;
Molecule* brew_molecule_p()const;
};
-/**
- takes care of:
-
- * help lines
- * proper placing of dots
-
- */
#endif // NOTEHEAD_HH
#include "string.hh"
#include "moment.hh"
-/// symbols, dimensions and constants
+
+/** symbols, dimensions and constants
+
+ This struct takes care of all kinds of symbols, dimensions and
+ constants. Most of them are related to the point-size of the fonts,
+ so therefore, the lookup table for symbols is also in here.
+
+ see TODO
+ */
struct Paperdef {
Lookup *lookup_p_;
String outfile;
/// ideal = geometric_ ^ log2(duration)
Real geometric_;
- /****************/
+ /* *************** */
void reinit();
Paperdef(Lookup*);
void set(Lookup*);
void print() const;
Real duration_to_dist(Moment);
};
-/** This struct takes care of all kinds of symbols, dimensions and
- constants. Most of them are related to the point-size of the fonts,
- so therefore, the lookup table for symbols is also in here.
- see TODO
- */
#include "item.hh"
/// stuff grouped vertically.
-struct PCol {
+/**
+ This is a class to address items vertically. It contains the data for:
+ \begin{itemize}
+ \item
+ unbroken score
+ \item
+ broken score
+ \item
+ the linespacing problem
+ \end{itemize}
+ */struct PCol {
PointerList<const Item*> its;
PointerList<const Spanner*> stoppers, starters;
/// prebreak is put before end of line.
- PCol *prebreak_p_;
/**
if broken here, then (*this) column is discarded, and prebreak
is put at end of line, owned by Col
*/
+ PCol *prebreak_p_;
/// postbreak at beginning of the new line
PCol *postbreak_p_;
- /** \See{prebreak}
- */
- PCol *daddy_l_;
/** if this column is pre or postbreak, then this field points to
the parent. */
+ PCol *daddy_l_;
/// if lines are broken then this column is in #line#
const Line_of_score *line_l_;
PScore * pscore_l_;
- /****************/
+ /* *************** */
/// which one (left =0)
int rank() const;
PCol(PCol * parent);
/// which col comes first?
- static int compare(const PCol &c1, const PCol &c2);
/**
signed compare on columns.
return < 0 if c1 < c2.
- */
+ */static int compare(const PCol &c1, const PCol &c2);
+
void OK() const;
void set_breakable();
private:
PCol(PCol const&){}
};
-/**
- This is a class to address items vertically. It contains the data for:
- \begin{itemize}
- \item
- unbroken score
- \item
- broken score
- \item
- the linespacing problem
- \end{itemize}
- */
+
#include "compare.hh"
instantiate_compare(PCol &, PCol::compare);
Vector lin;
Real const_term;
- ///
- void assert_solution(Vector sol) const;
+
/**
use a KKT method to assert optimality of sol
*/
- /// solve the problem using a projected gradient method
+ void assert_solution(Vector sol) const;
+ /// solve the problem using a projected gradient method
Vector solve(Vector start) const;
+ /** return the number of variables in the problem */
int dim() const{
return lin.dim();
}
- /** return the number of variables in the problem */
- ///
- void add_inequality_cons(Vector c, double r);
+
/**
add a constraint
c.dim() == dim();
*/
- ///
- Ineq_constrained_qp(int novars);
+ void add_inequality_cons(Vector c, double r);
+
/** set up matrices to go with the problem. */
-
- Real eval(Vector v);
+ Ineq_constrained_qp(int novars);
+
/**
evaluate the quadratic function for input #v#
*/
+ Real eval(Vector v);
void eliminate_var(int idx, Real value);
void OK()const;
};
/// Quadratic programming with mixed linear constraints
+/**
+ problem definition of a quadratic optimisation problem with linear
+ inequality and equality constraints
+
+
+ x^T QUAD x /2 + b^T x
+*/
+
+
class Mixed_qp :public Ineq_constrained_qp {
Array<int> eq_cons;
Array<Real> eq_consrhs;
Vector solve(Vector start) const;
void add_fixed_var(int i , Real value);
- ///
- void add_equality_cons(Vector c, double r);
+
/**
add a constraint,
PRE
c.dim()==dim();
*/
-
+ void add_equality_cons(Vector c, double r);
};
-/**
- problem definition of a quadratic optimisation problem with linear
- inequality and equality constraints
-
-
- x^T QUAD x /2 + b^T x
-*/
-
-
#endif
#include "matrix.hh"
+/**
+ This class represents the set of active (binding) constraints
+ which can be active while the QLP algorithm is in a feasible
+ point. The active constraints are numbered.
+ If the constraints are of the form
+
+ A^T*x >= b
+
+ then the binding constraints are those where the >= is equality.
+
+ */
+
class Active_constraints {
friend class Inactive_iter;
Real rhs(int k) const { return opt->consrhs[k]; }
/// drop constraint
- void drop (int k);
/** drop constraint k from the active set. k is the index of the
constraint in #active#
*/
+ void drop (int k);
/// add constraint j
- void add(int j);
/**
add constraint j to the active set j is the index of the
constraint in #inactive#
*/
+ void add(int j);
/// exchange in and out.
void exchange(int in, int out) { add(in); drop (out); }
- ///
+
Vector find_active_optimum(Vector g);
/// get lagrange multipliers.
void OK();
};
-/**
- This class represents the set of active (binding) constraints
- which can be active while the QLP algorithm is in a feasible
- point. The active constraints are numbered.
- If the constraints are of the form
-
- A^T*x >= b
- then the binding constraints are those where the >= is equality.
-
+/**
+ loop through the inactive constraints.
*/
-
-///
class Inactive_iter {
int j;
Active_constraints const* ac;
Real rhs() const { return ac->rhs(constraint_id()); }
bool ok() const { return j < ac->inactive.size(); }
};
-/**
- loop through the inactive constraints.
- */
#include "moment.hh"
/// Hungarian postfix: req
+/**
+ a voice element wants something printed.
+see lilygut page
+ */
+
struct Request {
Voice_element*elt_l_;
char const* defined_ch_c_l_m;
- /****************/
+ /* *************** */
Request();
Request(Request const&);
virtual ~Request(){}
protected:
virtual void do_print()const ;
};
-/**
- a voice element wants something printed.
-see lilygut page
- */
-
#define REQUESTMETHODS(T,accessor) \
virtual T * accessor() { return this;}\
int balltype;
int dots;
Moment plet_factor;
- /****************/
+ /* *************** */
static int compare(const Rhythmic_req &, const Rhythmic_req &);
Moment duration() const;
Rhythmic_req();
Moment next;
Real distance;
Real strength;
- /****************/
+ /* *************** */
Spacing_req();
REQUESTMETHODS(Spacing_req, spacing);
};
struct Text_req : virtual Request {
int dir_i_;
Text_def *tdef_p_;
- /****************/
+ /* *************** */
Text_req(int d, Text_def*);
~Text_req();
Text_req(Text_req const&);
///Put a rest on the staff.
+/**
+Why a request? It might be a good idea to not typeset the rest, if the paper is too crowded.
+*/
+
struct Rest_req : Rhythmic_req {
REQUESTMETHODS(Rest_req,rest);
};
+/// attach a stem to the noteball
/**
-Why a request? It might be a good idea to not typeset the rest, if the paper is too crowded.
-*/
+ Rhythmic_req parent needed to determine if it will fit inside a beam.
+ */
-/// attach a stem to the noteball
struct Stem_req : Rhythmic_req {
int dir_i_;
Stem_req(int s, int dots);
REQUESTMETHODS(Stem_req,stem);
};
-/**
- Rhythmic_req parent needed to determine if it will fit inside a beam.
- */
/// requests to start or stop something.
+/**
+ This type of request typically results in the creation of a #Spanner#
+*/
struct Span_req : Request {
/// should the spanner start or stop, or is it unwanted?
enum {
Span_req();
};
-/**
- This type of request typically results in the creation of a #Spanner#
-*/
///Start / stop a beam at this note.
+
+/** if #nplet# is set, the staff will try to put an
+appropriate number over the beam
+ */
struct Beam_req : Span_req {
int nplet;
- /****************/
+ /* *************** */
REQUESTMETHODS(Beam_req,beam);
Beam_req();
};
-/** if #nplet# is set, the staff will try to put an
-appropriate number over the beam
- */
-
/// a slur
struct Slur_req : Span_req {
REQUESTMETHODS(Slur_req,slur);
///Put a script above or below this ``note''
+/** eg upbow, downbow. Why a request? These symbols may conflict with
+slurs and brackets, so this also a request */
struct Script_req : Request {
int dir_i_;
Script_def *scriptdef_p_;
- /****************/
+ /* *************** */
static int compare(const Script_req &, const Script_req &);
Script_req(int d, Script_def*);
REQUESTMETHODS(Script_req,script);
~Script_req();
Script_req(Script_req const&);
};
-/** eg upbow, downbow. Why a request? These symbols may conflict with
-slurs and brackets, so this also a request */
/// designate this spot with a name.
struct Mark_req : Request {
String mark_str_;
- /****************/
+ /* *************** */
Mark_req(String);
REQUESTMETHODS(Mark_req,mark);
};
struct Staff_command_req : Request {
Input_command * com_p_;
- /****************/
+ /* *************** */
Staff_command_req(Staff_command_req const&);
~Staff_command_req();
Staff_command_req(Input_command*);
};
/// helper in the hierarchy
-struct Dynamic:Subtle_req {
-
-};
/** Each dynamic is bound to one note ( a crescendo spanning multiple
notes is thought to be made of two "dynamics": a start and a stop).
Dynamic changes can occur in a smaller time than the length of its
Dynamic should have been derived from request, but I don't want to
fuss with virtual baseclasses. */
+struct Dynamic:Subtle_req {
+
+};
/// do a crescendo
struct Cresc_req : Span_req, Dynamic {
#define REST_HH
#include "item.hh"
-/// ball at the end of the stem
struct Rest : Item {
int dots;
int balltype;
- /****************/
+ /* *************** */
Rest(int dur,int dots);
const char * name() const;
Molecule* brew_molecule_p()const;
};
-/**
- takes care of:
-
- * help lines
- * proper placing of dots
-
- */
#endif
#include "moment.hh"
+/**
+
+ When typesetting hasn't started on PScore yet, the columns which
+ contain data have a rhythmical position. Score_column is the type
+ with a rhythmical time attached to it. The calculation of
+ idealspacing is done with data in these columns. (notably: the
+ #durations# field)
+
+ */
+
struct Score_column {
/// indirection to column
/// length of notes/rests in this column
Array<Moment> durations;
- ///
+
bool musical_;
- /****************/
+ /* *************** */
Moment when() { return when_; }
Score_column(Moment when);
static int compare(Score_column & c1, Score_column &c2);
private:
Moment when_;
};
-/**
-
- When typesetting hasn't started on PScore yet, the columns which
- contain data have a rhythmical position. Score_column is the type
- with a rhythmical time attached to it. The calculation of
- idealspacing is done with data in these columns. (notably: the
- #durations# field)
-
- */
instantiate_compare(Score_column&, Score_column::compare);
IPointerList<Line_of_staff*> staffs;
PScore * pscore_l_; // needed to generate staffs
- /****************/
+ /* *************** */
void process() ;
Line_of_score(Array<PCol *> sv, PScore *);
Stem *stem_l_;
Array<Item *> support;
- /****************/
+ /* *************** */
const char * name() const;
Molecule* brew_molecule_p()const;
virtual void do_post_processing();
bool invertsym;
String symidx;
- /****************/
+ /* *************** */
int compare(Script_def const &);
void print() const;
Script_def(String, int, int ,bool);
class Source_file
{
public:
- ///
- Source_file( String &filename_str );
/**
RETURN path to opened file.
*/
+ Source_file( String &filename_str );
~Source_file();
char const* ch_c_l();
String error_str( char const* pos_ch_c_l );
#include "staffelem.hh"
/// a symbol which is attached between two columns.
+/** A spanner is a symbol which spans across several columns, so its
+ final appearance can only be calculated after the breaking problem
+ is solved.
+
+ Examples
+
+ - (de)crescendo
+ - slur
+ - beam
+ - bracket
+
+
+ Spanner should know about the items which it should consider:
+ e.g. slurs should be steep enough to "enclose" all those items. This
+ is absolutely necessary for beams, since they have to adjust the
+ length of stems of notes they encompass.
+
+ */
struct Spanner:Staff_elem {
PCol *left, *right;
- /****************/
+ /* *************** */
Spanner();
virtual Interval width()const;
virtual Spanner* spanner() { return this; }
protected:
/// clone a piece of this spanner.
- virtual Spanner *do_break_at( PCol *c1, PCol *c2) const=0;
/**
PRE
c1 >= start, c2 <= stop
*/
+ virtual Spanner *do_break_at( PCol *c1, PCol *c2) const=0;
};
-/** A spanner is a symbol which spans across several columns, so its
- final appearance can only be calculated after the breaking problem
- is solved.
-
- Examples
-
- - (de)crescendo
- - slur
- - beam
- - bracket
-
-
- Spanner should know about the items which it should consider:
- e.g. slurs should be steep enough to "enclose" all those items. This
- is absolutely necessary for beams, since they have to adjust the
- length of stems of notes they encompass.
-
- */
#endif
struct Staff_commands_at : public IPointerList<Command*> {
Time_description tdescription_;
- /****************/
+ /* *************** */
bool is_breakable();
Moment when();
#include "offset.hh"
#include "molecule.hh"
+/** Both Spanner and Item are Staff_elem's. Most Staff_elem's depend
+ on other Staff_elem's, eg, Beam needs to know and set direction of
+ Stem. So the Beam has to be calculated *before* Stem. This is
+ accomplished with the dependencies field of struct Staff_elem.
+
+ */
struct Staff_elem {
enum Status {
ORPHAN, // not yet added to pstaff
/// the pstaff it is in
PStaff *pstaff_l_;
- /****************/
+ /* *************** */
Staff_elem(Staff_elem const&);
String TeXstring () const ;
virtual void print() const;
/// member: the symbols
Molecule *output; // should scrap, and use temp var?
- ///
- Offset offset_;
+
/**
This is needed, because #output# may still be
NULL.
*/
+ Offset offset_;
Array<Staff_elem*> dependencies;
};
-/** Both Spanner and Item are Staff_elem's. Most Staff_elem's depend
- on other Staff_elem's, eg, Beam needs to know and set direction of
- Stem. So the Beam has to be calculated *before* Stem. This is
- accomplished with the dependencies field of struct Staff_elem.
-
- */
-
#define NAME_METHOD(c) const char *c::name()const{ return #c; } struct c
#endif // STAFFELEM_HH
Line_of_score * line_of_score_l_;
PStaff *pstaff_l_;
- /****************/
+ /* *************** */
String TeXstring() const;
Line_of_staff(Line_of_score*, PStaff *);
#include "staff.hh"
+/**
+ manage run-time info when walking staffcolumns such as: key,
+ meter, pending beams & slurs
+ */
struct Staff_walker : public PCursor<Staff_column*> {
Staff * staff_l_;
PScore * pscore_l_;
int break_status;
- /****************/
+ /* *************** */
int priority() const; // Command
Moment when() const;
void process_command(Command *);
void operator++(int);
- /****************
+ /* ***************
VIRTUAL
- ****************/
+ *************** */
/// every time ++ is called
virtual void do_pre_move(){}
private:
Staff_walker(Staff_walker const&);
};
-/**
- manage run-time info when walking staffcolumns such as: key,
- meter, pending beams & slurs
- */
#endif // STAFFWALKER_HH
#include "moment.hh"
/// the rule attached to the ball
+/**
+ takes care of:
+
+ \begin{itemize}
+ \item the rule
+ \item the flag
+ \item up/down position.
+ \end{itemize}
+ */
+
struct Stem : Item {
/*
/// rhythmical length
int staff_center;
// extent of the stem (positions)
- Real bot, top;
/**
fractional, since Beam has to adapt them.
*/
+ Real bot, top;
Real stemlen;
/// flagtype? 4 none, 8 8th flag, 0 = beam.
int flag;
///geen gedonder, jij gaat onder
- int dir;
/**
-1 stem points down, +1: stem points up
*/
+ int dir;
Real stem_xoffset;
Array<Notehead*> heads;
- /****************/
+ /* *************** */
Stem(int center); //, Moment duration);
/// ensure that this Stem also encompasses the Notehead #n#
Molecule* brew_molecule_p() const;
};
-/**
- takes care of:
-
- \begin{itemize}
- \item the rule
- \item the flag
- \item up/down position.
- \end{itemize}
- */
-
#endif
char const* defined_ch_c_l_m;
- /*****************/
+ /* ****************/
virtual ~Text_def() {};
bool compare(const Text_def&);
Text_def();
int dir_i_;
Text_def* tdef_l_;
- /****************/
+ /* ***************/
const char * name() const;
virtual void set_default_pos();
Molecule* brew_molecule_p() const;
/// idem
int bars;
- /****************/
+ /* *************** */
void set_cadenza(bool);
void OK() const;
Time_description(Moment, const Time_description*);
#include "moment.hh"
/// class for horizontal stuff.
+/**
+
+ Voice is a ordered row of Voice_elements. It is strictly horizontal:
+ you cannot have two rhythmic elements running parallel in a Voice
+
+ */
+
struct Voice {
IPointerList<Voice_element *> elts;
Moment start;
- /****************/
+ /* *************** */
Moment when(const Voice_element*)const;
Moment last() const;
Voice();
void print() const;
void set_default_group(String id);
};
-/**
-
- Voice is a ordered row of Voice_elements. It is strictly horizontal:
- you cannot have two rhythmic elements running parallel in a Voice
-
- */
-
/// one horizontal bit.
+/** Apart from being a container for the requests, Voice_element is nothing
+ */
struct Voice_element {
Moment duration;
char const* defined_ch_c_l_m;
const Voice *voice_l_;
IPointerList<Request*> reqs;
- /****************/
+ /* *************** */
void add(Request*);
Voice_element();
void print ()const;
void set_default_group(String id);
};
-/** Apart from being a container for the requests, Voice_element is nothing
- */
#endif
return substitute_args(s, a);
}
-/****************/
+/* *************** */
String
Molecule::TeXstring() const
assert(l < 8 && s <= 2 && s >= -2 && l >=0);
notetab[l * 5 + s +2] = n;
}
-/****************/
+/* *************** */
void
My_flex_lexer::set(Notename_tab *n)
{
#endif
}
-/****************/
+/* *************** */
/*
eliminate appropriate variables, until we have a Ineq_constrained_qp
return H*g;
}
-/****************************************************************/
+/* *************************************************************** */
int
min_elt_index(Vector v)
}
///the numerical solving
+/** Mordecai Avriel, Nonlinear Programming: analysis and methods (1976)
+ Prentice Hall.
+
+ Section 13.3
+
+ This is a "projected gradient" algorithm. Starting from a point x
+ the next point is found in a direction determined by projecting
+ the gradient onto the active constraints. (well, not really the
+ gradient. The optimal solution obeying the active constraints is
+ tried. This is why H = Q^-1 in initialisation) )
+
+
+ */
Vector
Ineq_constrained_qp::solve(Vector start) const
{
return x;
}
-/** Mordecai Avriel, Nonlinear Programming: analysis and methods (1976)
- Prentice Hall.
-
- Section 13.3
-
- This is a "projected gradient" algorithm. Starting from a point x
- the next point is found in a direction determined by projecting
- the gradient onto the active constraints. (well, not really the
- gradient. The optimal solution obeying the active constraints is
- tried. This is why H = Q^-1 in initialisation) )
-
-
- */
}
-/****************************************************************/
+/* *************************************************************** */
l += i->duration;
return l;
}
-/****************************************************************/
+/* *************************************************************** */
void
Voice_element::print() const
{