=head1 DESCRIPTION
This page documents some aspects of the internals of LilyPond. Some of
-this stuff comes from e-mail I wrote, some from e-mail others wrote, some are large comments taken away from the headers
+this stuff comes from e-mail I wrote, some from e-mail others wrote,
+some are large comments taken away from the headers
=head1 OVERVIEW
which is put into a percussion-Staff, will be typeset as the rythm of
that voice.
-After C<Staff> made up her mind (Would C<Staff> be a smart
-name? How about C<struct Susan {}> :-), the resultant items and
+After C<Staff> made up her mind, the resultant items and
spanners are put on the PScore, and pointers to these items are
stored in the C<Voice_element>. This construction enables the
beams/stems to look up the balls it has to connect to.
=over 5
-=item Note_req
+=item C<Barcheck_req>
+
+Checks during music processing if start of this voice element
+coincides with the start of a measure. Handy to check if you left out
+some voice elts.
+
+=item C<Note_req>
Staff has to decide if the ball should be hanging left or right. This
influences the horizontal dimensions of a column, and this is why
request processing should be done before horizontal spacing.
Other voices' frivolities may cause the need for accidentals, so this
-is also for the Staff to decide. The Staff can decide on positioning
+is also for the C<Staff> to decide. The C<Staff> can decide on positioning
based on ottava commands and the appropriate clef.
-=item Rest_req
+=item C<Rest_req>
Why a request? It might be a good idea to not typeset the rest, if the
paper is too crowded.
-=item Span_req
+=item C<Span_req>
This type of request typically results in the creation of a C<Spanner>
-=item Beam_req
+=item C<Beam_req>
Staff has to combine this request with the stem_request, since the
number of flags that a stem wants to carry will determine the
number of beams.
-=item Dynamic
+=item C<Dynamic>
-Each dynamic is bound to one note ( a crescendo spanning multiple
+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
-note, therefore fore each Dynamic request carries a time, measured
+note, therefore fore each C<Dynamic> request carries a time, measured
from the start of its note.
-This subfield would come in handy, if mpp96 was adapted for midi
+This subfield would come in handy, if LilyPond was adapted for midi
support.
=back
=head1 BREAKING
-[Source files: command.hh, scommands.cc]
+[Source files: F<command.hh>, F<scommands.cc>]
BREAKING, PREBREAK POSTBREAK, etc.
column-pair. each spring has an equilibrium-position which is equal to
the above mentioned distance, so
- spring (col1, col2) and spring(col2,col3) try to push column 1
+spring (col1, col2) and spring (col2,col3) try to push column 1
and 3 away (to a distance of 20pt) from each other, whereas the spring
between col 1 and col 3 tries to pull those two together (to a
distance of 14.1 pt). The net result of this pushing and pulling is an
[partly by Mark Basinski <basinski@arizona.edu>]
-
Herbert Chlapik,
W.A. Hegazy and J. S. Gourlay. Optimal line breaking in music. In
struct Absdynamic_req;
struct Accidental;
struct Atom;
+struct Barcheck_req;
struct Beam;
struct Beam_req;
struct Box;
/// a voice element wants something printed
struct Request {
- Voice_element*elt; // indirection.
+ Voice_element*elt_l_;
/****************/
Request();
+ Request(Request const&);
virtual ~Request(){}
virtual void print()const ;
+ virtual Moment duration() const { return 0.0; }
+ virtual Request* clone() const =0;
+
+ /* accessors for children */
+ virtual Barcheck_req *barcheck() { return 0; }
virtual Note_req *note() {return 0;}
virtual Script_req *script() {return 0;}
virtual Stem_req *stem() {return 0;}
virtual Slur_req *slur() { return 0 ; }
virtual Rhythmic_req*rhythmic() { return 0; }
virtual Melodic_req *melodic() { return 0; }
- virtual Moment duration() const { return 0.0; }
- virtual Request* clone() const =0;
};
/**
see lilygut page
*/
+struct Barcheck_req : Request {
+ virtual Barcheck_req *barcheck() { return this; }
+ void print ()const;
+ Request*clone() const;
+};
/// a request with a duration
struct Rhythmic_req : virtual Request {
NOSPAN, START, STOP
} spantype ;
+ virtual void print() const;
Span_req*span() { return this; }
Span_req();
virtual Request*clone()const;
/// a slur
struct Slur_req : Span_req {
+
virtual Request*clone()const;
virtual Slur_req*slur() { return this; }
};
Request *clone()const;
Script_req(int d, Script_def*);
~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 */
virtual void print() const;
Request *clone()const;
Text_req(int d, Text_def*);
- ~Text_req();
+ ~Text_req();
+ Text_req(Text_req const&);
};
/****************/
void OK() const;
Time_description(Rational, const Time_description*);
+ String str()const;
void print() const;
void setpartial(Rational p);
Rational barleft();
void set_meter(int,int);
+ static int compare (Time_description&, Time_description&);
};
+#include "compare.hh"
+
+
+instantiate_compare(Time_description&,Time_description::compare);
+
#endif // Time_description_HH
#include <iostream.h>
#include "lookup.hh"
-
#include "misc.hh"
#include "lexer.hh"
#include "paper.hh"
#define YYDEBUG 1
#endif
-svec<Request*> pre_reqs, post_reqs;
+Array<Request*> pre_reqs, post_reqs;
Paperdef*default_paper();
%}
char c;
int ii[10];
- svec<String> * strvec;
- svec<Input_command*> *commandvec;
- svec<int> *intvec;
+ Array<String> * strvec;
+ Array<Input_command*> *commandvec;
+ Array<int> *intvec;
Input_staff *staff;
Input_score *score;
%token <ii> NOTENAME
%token <real> REAL
%token <string> STRING
-%token <c> OPEN_REQUEST_PARENS CLOSE_REQUEST_PARENS
+
%token <i> DOTS INT
%type <consstr> unit
%type <intvec> pitch_list
-
+%type <c> open_request_parens close_request_parens
%type <id> declaration
%type <string> declarable_identifier
%type <paper> paper_block paper_body
COMMANDS '{' score_commands_body '}' { $$ =$3;}
;
-score_commands_body: { $$ = new svec<Input_command*>; }
+score_commands_body: { $$ = new Array<Input_command*>; }
| score_commands_body score_command {
$$->add($2);
}
;
staff_commands_body:
- /* empty */ { $$ = new svec<Input_command*>; }
+ /* empty */ { $$ = new Array<Input_command*>; }
| staff_commands_body staff_command {
$$->add($2);
}
score_command:
skipcommand
+ | BAR STRING {
+ $$ = get_bar_command(*$2);
+ delete $2;
+ }
| METER int int {
$$ = get_meterchange_command($2, $3);
}
;
post_request:
- CLOSE_REQUEST_PARENS { $$ = get_request($1); }
+ close_request_parens { $$ = get_request($1); }
| script_req
| textscript_req
;
+close_request_parens:
+ '(' { $$='('; }
+ |']' { $$ = ']' }
+ ;
+
+open_request_parens:
+ '|' {$$='|'}
+ |')' {$$=')'}
+ |'[' {$$='['}
+ ;
script_definition:
SCRIPT '{' script_body '}' { $$ = $3; }
;
pre_request:
- OPEN_REQUEST_PARENS { $$ = get_request($1); }
+ open_request_parens { $$ = get_request($1); }
;
UTILITIES
*/
pitch_list: {
- $$ = new svec<int>;
+ $$ = new Array<int>;
}
| pitch_list NOTENAME {
$$->add($2[0]);
int_list:
/* */ {
- $$ = new svec<int>;
+ $$ = new Array<int>;
}
| int_list int {
$$->add($2);
void
Simple_column::process_requests()
{
- for (int i = 0 ; i < v_elts.sz(); i ++)
+ for (int i = 0 ; i < v_elts.size(); i ++)
for (iter_top(v_elts[i]->reqs,j); j.ok(); j++) {
Request *rq= j;
+ if (rq->barcheck()) {
+ if (tdescription_->whole_in_measure) {
+ error("Barcheck failed, " + tdescription_->str());
+ }
+ }
+
if (rq->rhythmic()){
notes.add(rq->rhythmic());
}