\mudelafile{noteheadstyle.ly}
+Noteheads can have dots, and ---although this is bad style--- rests
+can too. Augmentation dots should never be printed on a staff line,
+but rather be shifted: down stem notes shift dots down, up stem up.
+In case of chords, all dots should be in a column. The dots go along
+as rests are shifted to avoid collisions.
+
+\mudelafile{dots.fly}
+
Multiple measure rests do not collide with barlines and clefs. They
are not expanded when you set \verb+Score.SkipBars+. Although the
multi-measure-rest is a Spanner, minimum distances are set to keep it
\section{Grace notes}
Grace notes are typeset as an encapsulated piece of music. You can
-have beams, notes, chords, stems etc. within a \verb|\grace|
-section. Slurs that start within a grace section, but aren't ended are
-attached to the next normal note. Grace notes have zero duration. If
-there are tuplets, the grace notes won't be under the brace.
+have beams, notes, chords, stems etc. within a \verb|\grace| section.
+Slurs that start within a grace section, but aren't ended are attached
+to the next normal note. Grace notes have zero duration. If there
+are tuplets, the grace notes won't be under the brace. Grace notes
+can have accidentals, but they are (currently) spaced at a fixed
+distance.
+pl 57.hwn1
+ - bf: accidentals on grace notes.
+ - \property graceAccidentalSpace
+ - bf: ignore grace notes duration for non-grace spacing.
+ - uncommented Key_req::transpose.
+ - Dot_column::do_post_processing (): better dot collisions, see dots.fly.
+ - derive Dot_column from Note_side_item.
+ - renaming of files
+ * heads-engraver
+ * request-iterator
+ * p-score
+ * engraver-group
+
+pl 57.jcn3
+ - bf: no extension: assume .ly
+ - bf: bow::do_width; which in turn allowed
+ - removed broken interstaff slur damping hack, and
+ - bf: slur height damping fixes damping
+
+pl 57.jcn2
+ - bf: ? priority and snap to stem
+
+pl 56.jcn4
+ - interstaff slur fixes and damping
+
+pl 56.mk1
+ - bf: collision.cc: collisions between chords with different
+ stem directions and close heads.
+
+****************s**************
+
pl 56.jcn3
- slur de-hairification
* slurs always attached to noteheads, by default
- bf: linebreak at |:
- doc updates by Adrian Mariano
-pl 49-rst
+pl 49.mk1
- Breathing signs by Michael Krause
************
.* TODO before 1.2
. * rename 'staff_line_leading' (who is being lead where?) to
-staff_space, interline; (or other meaningful name) and use throughout lily
-. * rename files to class-name:
-. * heads-engraver
-. * request-iterator
-. * p-score
-. * engraver-group
-. * standardise(d) switches: -v, --version; -d, --debug,
-. * Peter 1. Key signatures are no longer transposed with the rest
- of
- the music.
-
- \notes\transpose bes {\key D; d1 }
- should produce no key signature (key C)
-
- 2. Crescendos and other dynamic markings that start inside a
- \grace { } section are ignored.
+staff_space, interline; (or other meaningful name) and use throughout
+lily
- \notes \relative c' { fis4 r4 \grace { [g16 ( \< a16] }
- ) b4 \! a8. g16}
+[-> leading are the lead strips between the sticks (lines) of
+typeface. ie. leading is vertical space --hwn]
- 3. Slurs that end within a grace section but start outside
- are treated strangely.
- a2 d,4 ( \grace { [e16 ) d16]} cis8 d
-
-
- 4. Lyrics and grace sections don't go too well together.
+. * move \version check to lexer.ll
+. * junk delayed spanner breaking.
+. * check dangling_scm_sym working.
+. * revise pianobrace to put font stuff into Lookup
+. * standardise(d) switches: -v, --version; -d, --debug,
+. * spacing of accidentals
+. * restorations & repeats
+. * dotted rests?
+. * input/test/grace.ly spacing (triplet!)
+. * spanners from grace to normal ctxt
+.* 4. Lyrics and grace sections don't go too well together.
The words are aligned with the main note, not the start of the
grace note. This is usually wrong, but is sometimes right.
-
-
. * Auto_beam debugging output (waarom/wanneer heb jij die weggehaald?)
. * Rename illegal to invalid
. * Mats:
- The Postscript output is still very experimental
-- The reference manual contain a number of exampels that don't
- pass lilypond, among other the chord syntax.
-
-- Accidentals for grace notes are drawn at the wrong place. See
- comment in grace.ly
-
- It is impossible to typeset two textual scripts that are stacked
on top of eachother and avoids note collisions and at the same
time are typeset with different textStyle. I tried to move around
be stacked vertically, avoiding collisions with the notes
in all voices.
-- If an \alternative is directly followed by a new \repeat,
- Lily gives an assertion failure. See the comment in volta.fly
-
- I'd like to change the \repetitions command to Jan's suggested
syntax: \repeat "repeatsymbol" 2 {...}, but I'm not sure that
I understand the implementation of repeats well enough.
GIFs attached for easy reference: #1: time meter and first note on the
line are too close; #2: last note on the line and next bar are too
close.
-
-- And I haven't got any feedback on this one, posted last week:
-
-Check out:
-
-\score {
- \notes \relative c' {
- \context Staff <
- \context Voice = one { \stemdown c1 c4 }
- \context Voice = two { \stemup d1 d4 }
- >
- }
-}
-
-Notes are shifted as expected. Now check out:
-
-\score {
- \notes \relative c' {
- \context Staff <
- \context Voice = one { \stemdown c1 <a4 c4> }
- \context Voice = two { \stemup d1 d4 }
- >
- }
-}
-
-i.e. do
-
-- \context Voice = one { \stemdown c1 c4 }
-+ \context Voice = one { \stemdown c1 <a4 c4> }
-
-Now the chord collides with the note of the other voice!
-
. * relative mode for midi2ly
. *
Crescendi/diminuendi that cross a line break lose their vertical
. * formatting of input stuff.
. * deps for ly2dvi
. * decide wether to junk _ in lyrics.
-. * sane strategy for extensions (assume .ly):
-02:22:24 appel ~/usr/src/lilypond$ lilypond foo
-GNU LilyPond 1.1.54.
-[/home/fred/usr/src/lilypond/scm/lily.scm]
-warning: can't find file: `init'
. * indent = 0.0 with linewidth=-1.0
. * collisions & accidentals.
-. * auto-beaming in input/test/spacing.ly.
-huh, snap niks van: gewone beam gaat wel goed. hoe kan abe nu
+. * auto-beaming in input/test/spacing.ly:
+Non-finished auto-beams (consider_end_and_begin didn't decide to
+end beam), that get typeset in removal_processing (eg: end of a piece)
+Huh, snap niks van: gewone beam gaat wel goed. hoe kan abe nu
invloed hebben op beam-creatie, stopt toch gewoon stokken in?
. * music ending in grace notes.
. * PostScript
. * disable spaces in TeX stuff
. * handle ^C for tmp/file creation.
. * make LilyPond RPM fully relocatable
-. * dots & rest collisions.
. * the warning about the negative slur/tie length appears twice
which is irritating.
. * better hshift (dots, distance, head dependent)
(require 'allout)
(outline-init 't)
-+ pl 56.jcn3
-+ - slur de-hairification
-+ * slurs always attached to noteheads, by default
-+ * corrections for steep and high slurs
-+ * snap to stem end when close
-+ - bow/tie/slur dy/dx fix
-+
-+
PACKAGE_NAME=LilyPond
MAJOR_VERSION=1
MINOR_VERSION=1
-PATCH_LEVEL=57
+PATCH_LEVEL=58
MY_PATCH_LEVEL=
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
--- /dev/null
+
+d''4. b c4 | <b4. c d e> <f g a b>
+%This doesn't really work yet.
+
+\context Staff <
+ \context Voice = VA { \stemup <b c> r4. }
+ \context Voice = VB { \stemdown <a b> r4. }
+>
+
\grace c8 c4
\grace { [c32 cis32] } c4
\grace { [c32 c32] } \times 2/3 { [c8 c c] }
- \grace { [b32 ( c32] } c4
+ \grace { [b32 ( c32] } ) c4
\grace c16 [c8 c8]
}
+\paper {linewidth = -1.;}
}
Jan Nieuwenhuizen <janneke@gnu.org>
*/
-#include "p-col.hh"
+#include "paper-column.hh"
#include "array.hh"
#include "proto.hh"
#include "abbreviation-beam.hh"
#include "engraver.hh"
#include "grace-align-item.hh"
#include "note-column.hh"
+#include "local-key-item.hh"
+#include "warn.hh"
/**
catch notes, and put them in a row.
class Align_note_column_engraver: public Engraver
{
Axis_align_item * align_item_p_;
+ Note_column * now_column_l_;
+ Local_key_item * accidental_l_;
+
+ virtual void process_acknowledged ();
+ virtual void do_post_move_processing ();
virtual void do_creation_processing ();
virtual void do_removal_processing ();
virtual void acknowledge_element (Score_element_info);
Align_note_column_engraver::Align_note_column_engraver()
{
align_item_p_ =0;
+ now_column_l_ =0;
+ accidental_l_ =0;
}
void
{
if (Note_column * n = dynamic_cast<Note_column*> (inf.elem_l_))
{
- align_item_p_->add_element (n);
+ now_column_l_ =n;
+ }
+ else if (Local_key_item * it = dynamic_cast<Local_key_item*> (inf.elem_l_))
+ {
+ accidental_l_ = it;
+ }
+}
+void
+Align_note_column_engraver::process_acknowledged ()
+{
+ if (now_column_l_ && accidental_l_)
+ {
+
+ /* Can't inspect width of Local_key_item, since
+
+ A. it may not be fully built
+
+ B. it has no pscore_l_ field.
+
+ */
+ Scalar grsp = get_property ("graceAccidentalSpace", 0);
+ if (grsp.isnum_b ())
+ {
+ Real extra_space = double(grsp);
+ SCM e = gh_cons (gh_double2scm (-extra_space), gh_double2scm (0.0));
+ now_column_l_->set_elt_property (extra_space_scm_sym, e);
+ }
+ }
+
+ if (now_column_l_)
+ {
+ align_item_p_->add_element (now_column_l_);
+ now_column_l_ =0;
}
}
+void
+Align_note_column_engraver::do_post_move_processing ()
+{
+ now_column_l_ =0;
+ accidental_l_ =0;
+}
+
ADD_THIS_TRANSLATOR(Align_note_column_engraver);
#include "axis-group-engraver.hh"
#include "axis-group-spanner.hh"
-#include "p-col.hh"
+#include "paper-column.hh"
Axis_group_engraver::Axis_group_engraver ()
{
(c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "axis-group-item.hh"
-#include "p-col.hh"
+#include "paper-column.hh"
#include "axis-group-spanner.hh"
#include "debug.hh"
#include "item.hh"
-#include "p-col.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,
#include "staff-side.hh"
#include "text-item.hh"
#include "lily-guile.hh"
-#include "p-col.hh"
+#include "paper-column.hh"
#include "paper-def.hh"
Bar_script_engraver::Bar_script_engraver ()
How do we make sure that staff_side_p_ has a dependency from
someone else? We can't use i for that, so we use some other element.
*/
+ // staff_side_p_->set_elt_property (dangling_scm_sym, SCM_BOOL_T)
get_staff_info ().command_pcol_l ()->add_dependency (staff_side_p_);
}
}
return;
}
-
if (rhythmic_req->duration_.durlog_i_<= 2)
{
rhythmic_req->warning (_ ("stem doesn't fit in beam"));
Array<Offset> c (get_controls());
for (int i=0; i < c.size (); i++)
{
- Real y = c[i][Y_AXIS] + dy_f_drul_[LEFT];
+ Real y = c[i][Y_AXIS];
iv.unite (Interval (y,y));
}
return iv;
#include "lily-guile.hh"
#include "break-align-item.hh"
#include "dimensions.hh"
-#include "p-score.hh"
+#include "paper-score.hh"
#include "paper-def.hh"
-#include "p-col.hh"
+#include "paper-column.hh"
/*
#include "spring-spacer.hh"
#include "debug.hh"
#include "line-of-score.hh"
-#include "p-score.hh"
-#include "p-col.hh"
+#include "paper-score.hh"
+#include "paper-column.hh"
#include "cpu-timer.hh"
#include "command-request.hh"
#include "paper-def.hh"
#include "lookup.hh"
#include "text-item.hh"
-#include "p-score.hh"
+#include "paper-score.hh"
void
Clef_item::do_pre_processing()
(c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-#include "p-col.hh"
+#include "paper-column.hh"
#include "col-info.hh"
#include "debug.hh"
Note_column *cd_l =clash_groups[DOWN][0];
Note_head * nu_l= cu_l->head_l_arr_[0];
Note_head * nd_l = cd_l->head_l_arr_.top();
- int downpos = cd_l->head_positions_interval ()[SMALLER];
- int uppos = cu_l->head_positions_interval ()[BIGGER];
+ int downpos = cd_l->head_positions_interval ()[BIGGER];
+ int uppos = cu_l->head_positions_interval ()[SMALLER];
bool merge =
downpos == uppos
{
DOUT << str_;
}
+void
+Key_change_req::transpose (Musical_pitch p)
+{
+ key_.transpose (p);
+}
+
+
+
{
if (!r->dots_l_)
return ;
-
- head_l_arr_.push (r);
- add_dependency (r);
+
+ add_support (r);
add_dots (r->dots_l_);
}
void
Dot_column::do_substitute_element_pointer (Score_element*o,Score_element*n)
{
- Item *oi =dynamic_cast <Item *> (o);
-
- if (oi && dynamic_cast<Rhythmic_head *> (oi))
- head_l_arr_.substitute (dynamic_cast<Rhythmic_head*> (oi),
- dynamic_cast<Rhythmic_head*>(n));
- else if (oi && dynamic_cast<Dots *> (oi))
- dot_l_arr_.substitute (dynamic_cast<Dots*> (oi),
- dynamic_cast<Dots*> (n));
+ Note_head_side::do_substitute_element_pointer (o,n);
+ if (Dots * d = dynamic_cast<Dots*> (o))
+ dot_l_arr_.substitute (d, dynamic_cast<Dots*> (n));
+}
+
+int
+Dot_column::compare (Dots * const &d1, Dots * const &d2)
+{
+ return d1->position_i_ - d2->position_i_;
}
void
Dot_column::do_pre_processing ()
{
- Interval w;
- for (int i=0; i < head_l_arr_.size (); i++)
- w.unite (head_l_arr_[i]->extent (X_AXIS));
-
- if (!w.empty_b ())
- translate_axis (w[RIGHT] - extent(X_AXIS) [LEFT],X_AXIS);
+ dot_l_arr_.sort (Dot_column::compare);
+ Note_head_side::do_pre_processing ();
}
-
-
Dot_column::Dot_column ()
{
+ align_dir_ = RIGHT;
set_axes(X_AXIS,X_AXIS);
}
+
+void
+Dot_column::do_post_processing ()
+{
+ if (dot_l_arr_.size () < 2)
+ return;
+ Slice s;
+ s.set_empty ();
+
+ for (int i=0; i < dot_l_arr_.size (); i++)
+ {
+ s.unite (Slice (dot_l_arr_[i]->position_i_,dot_l_arr_[i]->position_i_));
+ }
+ int middle = s.center ();
+ /*
+ +1 -> off by one
+ */
+ int pos = middle - dot_l_arr_.size () + 1;
+ if (!(pos % 2))
+ pos ++; // center () rounds down.
+
+ for (int i=0; i <dot_l_arr_.size (); pos += 2, i++)
+ {
+ dot_l_arr_[i]->position_i_ = pos;
+ }
+}
Dots::Dots ()
{
- no_dots_i_ =0;
+ dots_i_ =0;
position_i_ =0;
+ resolve_dir_ =CENTER;
}
void
Dots::do_post_processing ()
{
+ if (!resolve_dir_)
+ resolve_dir_ = DOWN;
+
if (!(position_i_ % 2))
- position_i_ ++;
- if (!no_dots_i_)
+ position_i_ += resolve_dir_;
+ if (!dots_i_)
{
set_elt_property (transparent_scm_sym, SCM_BOOL_T);
set_empty (true);
Real dw = d.dim_[X_AXIS].length ();
d.translate_axis (-dw, X_AXIS);
- for (int i=no_dots_i_; i--; )
+ for (int i=dots_i_; i--; )
{
d.translate_axis (2*dw,X_AXIS);
out->add_molecule (d);
new_sss_p = new Staff_side_spanner;
new_sss_p->set_victim (new_cresc_p);
new_sss_p->axis_ = Y_AXIS;
+ // UGH.!
+ // new_sss_p->set_elt_property (dangling_scm_sym, SCM_BOOL_T);
announce_element (Score_element_info (new_sss_p, span_l));
}
}
Encompass_info::Encompass_info ()
{
- assert (0);
}
Encompass_info::Encompass_info (Note_column const* note_column, Direction dir, Slur const* slur_l)
o_[X_AXIS] = stem_l->hpos_f ();
-#if 0
- /*
- Let's not do this; yields ugly assymetric slurs.
-
- set o_[X_AXIS] to middle of notehead or on the exact position of stem,
- according to slur direction
-
-
- stem_l->dir == dir
- ________
- | | / \
- x| x| |x |x
- \________/ | |
-
- */
-
- dx_f_drul_[d] = -d * spanned_drul_[d]->extent (X_AXIS).length ();
-
- if (stem_l->dir_ != dir)
- o_[X_AXIS] -= 0.5 * stem_l->dir_ * note_column->extent (X_AXIS).length ();
-
-#else
-
/*
- Instead; simply set x to middle of notehead
+ Simply set x to middle of notehead
*/
o_[X_AXIS] -= 0.5 * stem_l->dir_ * note_column->extent (X_AXIS).length ();
-#endif
-
if (stem_l->dir_ == dir)
{
o_[Y_AXIS] = stem_l->extent (Y_AXIS)[dir];
--- /dev/null
+/*
+ engravergroup.cc -- implement Engraver_group_engraver
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+#include "proto.hh"
+#include "engraver-group-engraver.hh"
+#include "engraver.hh"
+#include "debug.hh"
+#include "paper-score.hh"
+#include "score-element.hh"
+
+
+ADD_THIS_TRANSLATOR(Engraver_group_engraver);
+
+void
+Engraver_group_engraver::announce_element (Score_element_info info)
+{
+ announce_info_arr_.push (info);
+ Engraver::announce_element (info);
+}
+
+void
+Engraver_group_engraver::do_announces()
+{
+ Link_array<Translator_group> groups = group_l_arr ();
+ for (int i=0; i < groups.size(); i++)
+ {
+ Engraver_group_engraver * group = dynamic_cast<Engraver_group_engraver*> (groups[i]);
+ if (group)
+ {
+ group->do_announces();
+ }
+ }
+
+ Request dummy_req;
+
+ Link_array<Translator> nongroups = nongroup_l_arr ();
+ while (announce_info_arr_.size ())
+ {
+ for (int j =0; j < announce_info_arr_.size(); j++)
+ {
+ Score_element_info info = announce_info_arr_[j];
+
+ if (!info.req_l_)
+ info.req_l_ = &dummy_req;
+ for (int i=0; i < nongroups.size(); i++)
+ { // Is this good enough?
+ Engraver * eng = dynamic_cast<Engraver*> (nongroups[i]);
+ if (eng && eng!= info.origin_trans_l_arr_[0])
+ eng->acknowledge_element (info);
+ }
+ }
+ announce_info_arr_.clear ();
+ for (int i=0; i < nongroups.size(); i++)
+ {
+ Engraver * eng = dynamic_cast<Engraver*> (nongroups[i]);
+ if (eng)
+ eng->process_acknowledged ();
+ }
+
+ }
+}
+
+
+Staff_info
+Engraver_group_engraver::get_staff_info() const
+{
+ Staff_info inf = Engraver::get_staff_info();
+
+ Link_array<Translator> simple_translators = nongroup_l_arr ();
+ for (int i=0; i < simple_translators.size(); i++)
+ {
+ Engraver * eng = dynamic_cast<Engraver*> (simple_translators[i]);
+ if (eng)
+ eng->fill_staff_info (inf);
+ }
+ return inf;
+}
+
+
+
+++ /dev/null
-/*
- engravergroup.cc -- implement Engraver_group_engraver
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "proto.hh"
-#include "engraver-group-engraver.hh"
-#include "engraver.hh"
-#include "debug.hh"
-#include "p-score.hh"
-#include "score-element.hh"
-
-
-ADD_THIS_TRANSLATOR(Engraver_group_engraver);
-
-void
-Engraver_group_engraver::announce_element (Score_element_info info)
-{
- announce_info_arr_.push (info);
- Engraver::announce_element (info);
-}
-
-void
-Engraver_group_engraver::do_announces()
-{
- Link_array<Translator_group> groups = group_l_arr ();
- for (int i=0; i < groups.size(); i++)
- {
- Engraver_group_engraver * group = dynamic_cast<Engraver_group_engraver*> (groups[i]);
- if (group)
- {
- group->do_announces();
- }
- }
-
- Request dummy_req;
-
- Link_array<Translator> nongroups = nongroup_l_arr ();
- while (announce_info_arr_.size ())
- {
- for (int j =0; j < announce_info_arr_.size(); j++)
- {
- Score_element_info info = announce_info_arr_[j];
-
- if (!info.req_l_)
- info.req_l_ = &dummy_req;
- for (int i=0; i < nongroups.size(); i++)
- { // Is this good enough?
- Engraver * eng = dynamic_cast<Engraver*> (nongroups[i]);
- if (eng && eng!= info.origin_trans_l_arr_[0])
- eng->acknowledge_element (info);
- }
- }
- announce_info_arr_.clear ();
- for (int i=0; i < nongroups.size(); i++)
- {
- Engraver * eng = dynamic_cast<Engraver*> (nongroups[i]);
- if (eng)
- eng->process_acknowledged ();
- }
-
- }
-}
-
-
-Staff_info
-Engraver_group_engraver::get_staff_info() const
-{
- Staff_info inf = Engraver::get_staff_info();
-
- Link_array<Translator> simple_translators = nongroup_l_arr ();
- for (int i=0; i < simple_translators.size(); i++)
- {
- Engraver * eng = dynamic_cast<Engraver*> (simple_translators[i]);
- if (eng)
- eng->fill_staff_info (inf);
- }
- return inf;
-}
-
-
-
#include "debug.hh"
#include "lookup.hh"
#include "molecule.hh"
-#include "p-col.hh"
+#include "paper-column.hh"
#include "paper-def.hh"
#include "extender-spanner.hh"
#include "colhpos.hh"
#include "spring-spacer.hh"
#include "debug.hh"
-#include "p-col.hh"
-#include "p-score.hh"
+#include "paper-column.hh"
+#include "paper-score.hh"
#include "paper-def.hh"
#include "killing-cons.tcc"
#include "lily-guile.hh"
#include "ly-symbols.hh"
#include "score-element.hh"
+#include "musical-request.hh"
void
Grace_engraver_group::start ()
bool
Grace_engraver_group::do_try_music (Music *m)
{
- bool hebbes_b =false;
+ bool hebbes_b = try_music_on_nongroup_children (m);
- Link_array<Translator> nongroups (nongroup_l_arr ());
-
- for (int i =0; !hebbes_b && i < nongroups.size() ; i++)
- hebbes_b =nongroups[i]->try_music (m);
+ if (!hebbes_b && pass_to_top_b (m))
+ {
+ hebbes_b = daddy_trans_l_->try_music (m);
+ }
return hebbes_b;
}
+
+bool
+Grace_engraver_group::pass_to_top_b (Music *m) const
+{
+ if (Span_req * sp = dynamic_cast<Span_req*> (m))
+ {
+ if (sp->span_type_str_ == "slur")
+ return true;
+ }
+ return false;
+}
}
else if (Local_key_item*it = dynamic_cast<Local_key_item*>(i.elem_l_))
{
- support_.push (it);
+ if (it->get_elt_property (grace_scm_sym) == SCM_BOOL_F)
+ support_.push (it);
+ else if (align_l_)
+ it->add_dependency (align_l_);
}
}
+++ /dev/null
-/*
- head-grav.cc -- part of GNU LilyPond
-
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "note-head.hh"
-#include "heads-engraver.hh"
-#include "paper-def.hh"
-#include "musical-request.hh"
-#include "dots.hh"
-#include "dot-column.hh"
-
-Note_heads_engraver::Note_heads_engraver()
-{
-}
-
-bool
-Note_heads_engraver::do_try_music (Music *m)
-{
- if (Note_req * n =dynamic_cast <Note_req *> (m))
- {
- note_req_l_arr_.push (n);
- return true;
- }
- if (Tonic_req* t = dynamic_cast<Tonic_req*> (m))
- {
- return true;
- }
- return false;
-}
-
-void
-Note_heads_engraver::do_process_requests()
-{
- if (note_p_arr_.size ())
- return ;
-
- String noteheadstyle = get_property ("noteHeadStyle", 0);
- for (int i=0; i < note_req_l_arr_.size (); i++)
- {
- Note_head *note_p = new Note_head;
- Note_req * note_req_l = note_req_l_arr_[i];
- note_p->balltype_i_ = note_req_l->duration_.durlog_i_;
- note_p->dots_i_ = note_req_l->duration_.dots_i_;
- if (note_p->dots_i_)
- {
- Dots * d = new Dots;
- note_p->dots_l_ = d;
- announce_element (Score_element_info (d,0));
- dot_p_arr_.push (d);
- }
-
- // note_p->steps_i_ = note_req_l->pitch_.steps ();
- note_p->position_i_ = note_req_l->pitch_.steps ();
-
-
- if (noteheadstyle == "transparent")
- note_p->set_elt_property (transparent_scm_sym, SCM_BOOL_T);
- else
- note_p->set_elt_property (style_scm_sym,
- gh_str02scm (noteheadstyle.ch_C()));
-
-
- Score_element_info itinf (note_p,note_req_l);
- announce_element (itinf);
- note_p_arr_.push (note_p);
- }
-}
-
-void
-Note_heads_engraver::do_pre_move_processing()
-{
- for (int i=0; i < note_p_arr_.size (); i++)
- {
- typeset_element (note_p_arr_[i]);
- }
- note_p_arr_.clear ();
- for (int i=0; i < dot_p_arr_.size (); i++)
- {
- typeset_element (dot_p_arr_[i]);
- }
- dot_p_arr_.clear ();
-
- note_req_l_arr_.clear ();
-}
-
-void
-Note_heads_engraver::do_post_move_processing()
-{
-
-}
-
-
-
-ADD_THIS_TRANSLATOR(Note_heads_engraver);
#include "debug.hh"
#include "lookup.hh"
#include "molecule.hh"
-#include "p-col.hh"
+#include "paper-column.hh"
#include "paper-def.hh"
#include "hyphen-spanner.hh"
*/
#include "idealspacing.hh"
-#include "p-col.hh"
-#include "p-score.hh"
+#include "paper-column.hh"
+#include "paper-score.hh"
#include "debug.hh"
void
protected:
VIRTUAL_COPY_CONS(Music);
- // void transpose (Musical_pitch d);
+ void transpose (Musical_pitch d);
virtual void do_print () const;
};
#define DOT_COLUMN_HH
#include "axis-group-item.hh"
+#include "note-head-side.hh"
/**
Group dots. This is needed because, the dots have to be aligned per voice
*/
-class Dot_column : public Axis_group_item
+class Dot_column : public Axis_group_item, public Note_head_side
{
- Link_array<Rhythmic_head> head_l_arr_;
Link_array<Dots> dot_l_arr_;
-
+ static int compare (Dots * const&,Dots * const&);
public:
-
+ VIRTUAL_COPY_CONS (Score_element);
void add_head (Rhythmic_head*);
void add_dots (Dots*);
Dot_column ();
+
protected:
+
virtual void do_pre_processing ();
+ virtual void do_post_processing ();
virtual void do_substitute_element_pointer (Score_element *o, Score_element*n);
};
#endif // DOT_COLUMN_HH
virtual Molecule * do_brew_molecule_p () const;
virtual void do_post_processing ();
public:
- int no_dots_i_;
+ int dots_i_;
int position_i_;
+ Direction resolve_dir_;
Dots ();
};
Link_array<Score_element> typeset_us_;
Array<Score_element_info> announce_to_top_;
bool calling_self_b_;
+ bool pass_to_top_b (Music *) const;
public:
VIRTUAL_COPY_CONS(Translator);
Grace_engraver_group ();
+++ /dev/null
-/*
- head-engraver.hh -- part of GNU LilyPond
-
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef HEADSGRAV_HH
-#define HEADSGRAV_HH
-#include "engraver.hh"
-
-/**
- make balls and rests
- */
-class Note_heads_engraver : public Engraver {
- Link_array<Note_head> note_p_arr_;
- Link_array<Dots> dot_p_arr_;
- Link_array<Note_req> note_req_l_arr_;
-
-public:
- VIRTUAL_COPY_CONS(Translator);
- Note_heads_engraver();
-
-protected:
- virtual bool do_try_music (Music *req_l) ;
- virtual void do_process_requests();
- virtual void do_pre_move_processing();
- virtual void do_post_move_processing();
-};
-
-
-#endif // HEADSGRAV_HH
struct Barcheck_req;
struct Beam;
struct Beam_engraver;
-struct Beam_req;
struct Beaming_info;
struct Beaming_info_list;
struct Blank_req;
struct Command_req;
struct Command_script_req;
struct Command_tie_engraver;
-struct Command_tie_req;
struct Time_scaled_music;
struct Time_scaled_music_iterator;
-struct Cresc_req;
struct Crescendo ;
-struct Decresc_req;
struct Dots;
struct Dot_column;
struct Directional_spanner;
struct Partial_measure_req;
struct Performance;
struct Performer;
-struct Plet;
-struct Plet_engraver;
-struct Plet_req;
struct Tuplet_spanner;
struct Piano_brace;
struct Performer;
struct Skip_req;
struct Slur;
struct Slur_engraver;
-struct Slur_req;
struct Spacing_spanner;
struct Span_bar;
struct Span_score_bar;
-struct Span_dynamic_req;
struct Span_req;
struct Spanner;
struct Spring;
DECLARE_LY_SYMBOL(change);
DECLARE_LY_SYMBOL(damping);
DECLARE_LY_SYMBOL(dashed);
+DECLARE_LY_SYMBOL(dangling);
DECLARE_LY_SYMBOL(extremal);
DECLARE_LY_SYMBOL(extra_space);
DECLARE_LY_SYMBOL(dir_forced);
{
Link_array<Item> support_l_arr_;
public:
+ Direction align_dir_;
+
+ Note_head_side ();
void add_support (Item*);
VIRTUAL_COPY_CONS (Score_element);
protected:
class Note_head : public Rhythmic_head {
public:
- int position_i_;
Note_head ();
void flip_around_stem (Direction);
--- /dev/null
+/*
+ head-engraver.hh -- part of GNU LilyPond
+
+ (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+
+#ifndef HEADSGRAV_HH
+#define HEADSGRAV_HH
+#include "engraver.hh"
+
+/**
+ make balls and rests
+ */
+class Note_heads_engraver : public Engraver {
+ Link_array<Note_head> note_p_arr_;
+ Link_array<Dots> dot_p_arr_;
+ Link_array<Note_req> note_req_l_arr_;
+
+public:
+ VIRTUAL_COPY_CONS(Translator);
+ Note_heads_engraver();
+
+protected:
+ virtual bool do_try_music (Music *req_l) ;
+ virtual void do_process_requests();
+ virtual void do_pre_move_processing();
+ virtual void do_post_move_processing();
+};
+
+
+#endif // HEADSGRAV_HH
+++ /dev/null
-/*
- p-col.hh -- declare Paper_column
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef P_COL_HH
-#define P_COL_HH
-
-#include "axis-group-item.hh"
-#include "rod.hh"
-#include "spring.hh"
-
-/**
- stuff grouped vertically.
- 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}
- */
-
-class Paper_column : public Axis_group_item {
-public:
- VIRTUAL_COPY_CONS(Score_element);
- Drul_array<Array<Column_rod> > minimal_dists_arr_drul_;
- Drul_array<Array<Column_spring> > spring_arr_drul_;
- void preprocess ();
- /// set a minimum distance
- void add_rod (Paper_column * to, Real distance);
- void add_spring (Paper_column * to, Real dist, Real strength);
-
- virtual Paper_column * column_l () const;
- /// if lines are broken then this column is in #line#
- Line_of_score *line_l_;
-
- virtual Line_of_score *line_l () const;
-
- /// which one (left =0)
- int rank_i() const;
-
- bool breakpoint_b() const;
- void add_item (Item *i);
-
- Paper_column();
-
- void set_rank (int);
-
- void OK() const;
- virtual void do_print() const;
-private:
-
- /**
- The ranking: left is smaller than right
- -1 is uninitialised.
- */
- int rank_i_;
-
-};
-
-
-// #include "compare.hh"
-// INSTANTIATE_COMPARE(Paper_column &, Paper_column::compare);
-
-#endif // P_COL_HH
-
+++ /dev/null
-/*
- p-score.hh -- declare Paper_score
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef P_SCORE_HH
-#define P_SCORE_HH
-
-#include "colhpos.hh"
-#include "parray.hh"
-#include "lily-proto.hh"
-#include "music-output.hh"
-#include "lily-guile.hh"
-
-/** all stuff which goes onto paper. notes, signs, symbols in a score
- #Paper_score# contains the items, the columns.
-
- */
-
-class Paper_score : public Music_output
-{
- /// crescs etc; no particular order
- Link_array<Spanner> span_p_arr_;
-
- /// other elements
- Link_array<Score_element> elem_p_arr_;
- Link_array<Score_element> break_helpers_arr_;
-
- SCM protected_scms_;
-public:
- Paper_def *paper_l_;
-
- /// the columns, ordered left to right
- Link_array<Paper_column> col_l_arr_;
-
- Paper_outputter *outputter_l_;
- Line_of_score * line_l_;
-
- Paper_score ();
-
-
- /// add to bottom of pcols
- void add_column (Paper_column*);
-
- /**
- @return index of argument.
- */
- int find_col_idx (Paper_column const *) const;
-
- Link_array<Item> broken_col_range (Item const*,Item const*) const;
-
-
- /* STANDARD ROUTINES */
- void print() const;
-
- void typeset_element (Score_element*);
- void typeset_broken_spanner (Spanner*);
- /// add a Spanner
- void typeset_unbroken_spanner (Spanner*);
-
-
- virtual ~Paper_score();
-protected:
- /* MAIN ROUTINES */
- virtual void process();
-
-private:
- /// before calc_breaking
- void preprocess();
-
- void calc_idealspacing();
- /// calculate where the lines are to be broken, and use results
- Array<Column_x_positions> calc_breaking();
-
- /// after calc_breaking
- void postprocess();
- Paper_score (Paper_score const &);
-};
-
-#endif
--- /dev/null
+/*
+ paper-column.hh -- declare Paper_column
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+
+#ifndef P_COL_HH
+#define P_COL_HH
+
+#include "axis-group-item.hh"
+#include "rod.hh"
+#include "spring.hh"
+
+/**
+ stuff grouped vertically.
+ 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}
+ */
+
+class Paper_column : public Axis_group_item {
+public:
+ VIRTUAL_COPY_CONS(Score_element);
+ Drul_array<Array<Column_rod> > minimal_dists_arr_drul_;
+ Drul_array<Array<Column_spring> > spring_arr_drul_;
+ void preprocess ();
+ /// set a minimum distance
+ void add_rod (Paper_column * to, Real distance);
+ void add_spring (Paper_column * to, Real dist, Real strength);
+
+ virtual Paper_column * column_l () const;
+ /// if lines are broken then this column is in #line#
+ Line_of_score *line_l_;
+
+ virtual Line_of_score *line_l () const;
+
+ /// which one (left =0)
+ int rank_i() const;
+
+ bool breakpoint_b() const;
+ void add_item (Item *i);
+
+ Paper_column();
+
+ void set_rank (int);
+
+ void OK() const;
+ virtual void do_print() const;
+private:
+
+ /**
+ The ranking: left is smaller than right
+ -1 is uninitialised.
+ */
+ int rank_i_;
+
+};
+
+
+// #include "compare.hh"
+// INSTANTIATE_COMPARE(Paper_column &, Paper_column::compare);
+
+#endif // P_COL_HH
+
--- /dev/null
+/*
+ paper-score.hh -- declare Paper_score
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+
+#ifndef P_SCORE_HH
+#define P_SCORE_HH
+
+#include "colhpos.hh"
+#include "parray.hh"
+#include "lily-proto.hh"
+#include "music-output.hh"
+#include "lily-guile.hh"
+
+/** all stuff which goes onto paper. notes, signs, symbols in a score
+ #Paper_score# contains the items, the columns.
+
+ */
+
+class Paper_score : public Music_output
+{
+ /// crescs etc; no particular order
+ Link_array<Spanner> span_p_arr_;
+
+ /// other elements
+ Link_array<Score_element> elem_p_arr_;
+ Link_array<Score_element> break_helpers_arr_;
+
+ SCM protected_scms_;
+public:
+ Paper_def *paper_l_;
+
+ /// the columns, ordered left to right
+ Link_array<Paper_column> col_l_arr_;
+
+ Paper_outputter *outputter_l_;
+ Line_of_score * line_l_;
+
+ Paper_score ();
+
+
+ /// add to bottom of pcols
+ void add_column (Paper_column*);
+
+ /**
+ @return index of argument.
+ */
+ int find_col_idx (Paper_column const *) const;
+
+ Link_array<Item> broken_col_range (Item const*,Item const*) const;
+
+
+ /* STANDARD ROUTINES */
+ void print() const;
+
+ void typeset_element (Score_element*);
+ void typeset_broken_spanner (Spanner*);
+ /// add a Spanner
+ void typeset_unbroken_spanner (Spanner*);
+
+
+ virtual ~Paper_score();
+protected:
+ /* MAIN ROUTINES */
+ virtual void process();
+
+private:
+ /// before calc_breaking
+ void preprocess();
+
+ void calc_idealspacing();
+ /// calculate where the lines are to be broken, and use results
+ Array<Column_x_positions> calc_breaking();
+
+ /// after calc_breaking
+ void postprocess();
+ Paper_score (Paper_score const &);
+};
+
+#endif
+++ /dev/null
-/*
- plet-engraver.hh -- declare Plet_engraver
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-
-#ifndef PLET_ENGRAVER_HH
-#define PLET_ENGRAVER_HH
-
-#include "engraver.hh"
-#include "drul-array.hh"
-#include "plet-spanner.hh"
-
-/**
- Generate a plet.
- Should make a Plet_spanner that typesets a nice bracket.
- */
-class Plet_engraver : public Engraver
-{
-public:
- VIRTUAL_COPY_CONS(Translator);
-
- Plet_engraver ();
-
-protected:
- virtual void acknowledge_element (Score_element_info);
- virtual void do_removal_processing();
- virtual void do_process_requests();
- virtual bool do_try_music (Music*);
- virtual void do_pre_move_processing();
-
-private:
- Drul_array<Plet_req*> span_reqs_drul_;
- Drul_array<Moment> beam_mom_drul_;
- Drul_array<Moment> span_mom_drul_;
- Plet_spanner* plet_spanner_p_;
-};
-
-#endif // PLET_ENGRAVER_HH
--- /dev/null
+/*
+ request-iter.hh -- declare Request_chord_iterator
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+
+#ifndef REQUEST_ITER_HH
+#define REQUEST_ITER_HH
+
+#include "music-iterator.hh"
+
+/**
+ Walk through a Request_chord
+ */
+class Request_chord_iterator : public Music_iterator {
+ Request_chord * elt_l () const;
+ /**
+ cache elt_l ()->length_mom ().
+ */
+ Moment elt_length_mom_;
+ bool last_b_;
+ Cons<Music>* cursor_;
+
+public:
+ Request_chord_iterator ();
+
+
+protected:
+ virtual void do_process_and_next (Moment);
+ virtual Moment next_moment() const;
+ virtual Music* next_music_l ();
+ virtual void construct_children();
+ virtual bool ok() const;
+ virtual void do_print() const;
+};
+
+
+#endif // REQUEST_ITER_HH
+++ /dev/null
-/*
- request-iter.hh -- declare Request_chord_iterator
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef REQUEST_ITER_HH
-#define REQUEST_ITER_HH
-
-#include "music-iterator.hh"
-
-/**
- Walk through a Request_chord
- */
-class Request_chord_iterator : public Music_iterator {
- Request_chord * elt_l () const;
- /**
- cache elt_l ()->length_mom ().
- */
- Moment elt_length_mom_;
- bool last_b_;
- Cons<Music>* cursor_;
-
-public:
- Request_chord_iterator ();
-
-
-protected:
- virtual void do_process_and_next (Moment);
- virtual Moment next_moment() const;
- virtual Music* next_music_l ();
- virtual void construct_children();
- virtual bool ok() const;
- virtual void do_print() const;
-};
-
-
-#endif // REQUEST_ITER_HH
class Rest : public Rhythmic_head
{
public:
-
-
- int position_i_;
Rest ();
void add_dots (Dots*);
protected:
virtual void do_add_processing ();
+ virtual void do_post_processing ();
virtual Molecule * do_brew_molecule_p () const;
};
#endif // REST_HH
Stem * stem_l_;
int balltype_i_;
int dots_i_;
+ int position_i_;
+
Dots * dots_l_;
void add_dots (Dots *);
Rhythmic_head ();
protected:
+ virtual void do_post_processing ();
virtual void do_add_processing ();
virtual void do_print () const;
virtual void do_substitute_element_pointer (Score_element*,Score_element*);
#include "lily-proto.hh"
#include "array.hh"
#include "moment.hh"
-#include "p-col.hh"
+#include "paper-column.hh"
/**
Column with durational info.
virtual void handle_broken_dependencies ();
virtual void handle_prebroken_dependencies ();
virtual void handle_prebroken_dependents ();
+ virtual void handle_broken_dependents ();
virtual Link_array<Score_element> get_extra_dependencies () const;
static Interval dim_cache_callback (Dimension_cache*);
friend Axis_group_spanner; // UGH
virtual void do_space_processing ();
+ void handle_broken_dependents ();
virtual void do_break_processing ();
virtual Interval do_width () const;
virtual void do_print () const;
void check_removal ();
+
Translator *get_simple_translator (String) const;
Translator_group *find_existing_translator_l (String n, String id);
Translator_group *find_create_translator_l (String n, String id);
Translator_group*get_default_interpreter();
protected:
+ bool try_music_on_nongroup_children (Music *m);
+
virtual ~Translator_group ();
virtual void do_print () const;
virtual void do_process_requests ();
(c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-#include "p-score.hh"
+#include "paper-score.hh"
#include "debug.hh"
#include "item.hh"
-#include "p-col.hh"
+#include "paper-column.hh"
#include "spanner.hh"
#include "lily-guile.hh"
/*
- key-def.cc -- implement
+ key-def.cc -- implement Key_def
source file of the GNU LilyPond music typesetter
#include "bar.hh"
#include "debug.hh"
#include "line-group-group-engraver.hh"
-#include "p-col.hh"
+#include "paper-column.hh"
Line_group_engraver_group::Line_group_engraver_group()
{
#include "line-of-score.hh"
#include "paper-def.hh"
#include "paper-outputter.hh"
-#include "p-col.hh"
-#include "p-score.hh"
+#include "paper-column.hh"
+#include "paper-score.hh"
#include "warn.hh"
Line_of_score::Line_of_score()
split_path (str,a,b,c,ext_r);
// add extension if not present.
- char const* extensions[] = {"", "", ".ly", ".fly", ".sly", 0};
+ char const* extensions[] = {"", ".ly", ".fly", ".sly", "", 0};
extensions[0] = ext_r.ch_C ();
for (int i = 0; extensions[i]; i++)
{
}
}
str = a+b+c+ext_r;
+ // in any case, assume (init).ly
+ if (!ext_r.length_i ())
+ ext_r = ".ly";
}
}
else
#include "multi-measure-rest.hh"
#include "debug.hh"
#include "paper-def.hh"
-#include "p-col.hh" // urg
+#include "paper-column.hh" // urg
#include "bar.hh"
#include "lookup.hh"
#include "rest.hh"
#include "music-list.hh"
#include "music-iterator.hh"
#include "property-iterator.hh"
-#include "request-iterator.hh"
+#include "request-chord-iterator.hh"
#include "sequential-music-iterator.hh"
#include "simultaneous-music-iterator.hh"
#include "translator-group.hh"
if (x_int.empty_b ())
x_int = Interval(0,0);
- translate_axis (-extent(X_AXIS)[RIGHT] + x_int[LEFT], X_AXIS);
+ translate_axis (-extent(X_AXIS)[-align_dir_] + x_int[align_dir_], X_AXIS);
}
void
if (Item* o_l = dynamic_cast <Item *> (o))
support_l_arr_.substitute (o_l,dynamic_cast <Item *> (n));
}
+
+Note_head_side:: Note_head_side()
+{
+ align_dir_ = LEFT;
+}
#include "lookup.hh"
#include "molecule.hh"
#include "musical-request.hh"
+#include "stem.hh"
void
Note_head::flip_around_stem (Direction d)
Note_head::Note_head ()
{
- position_i_ = 0;
}
void
dots_l_->position_i_ = position_i_;
}
+
+
int
Note_head::compare (Note_head *const &a, Note_head * const &b)
{
--- /dev/null
+/*
+ head-grav.cc -- part of GNU LilyPond
+
+ (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+#include "note-head.hh"
+#include "note-heads-engraver.hh"
+#include "paper-def.hh"
+#include "musical-request.hh"
+#include "dots.hh"
+#include "dot-column.hh"
+
+Note_heads_engraver::Note_heads_engraver()
+{
+}
+
+bool
+Note_heads_engraver::do_try_music (Music *m)
+{
+ if (Note_req * n =dynamic_cast <Note_req *> (m))
+ {
+ note_req_l_arr_.push (n);
+ return true;
+ }
+ if (Tonic_req* t = dynamic_cast<Tonic_req*> (m))
+ {
+ return true;
+ }
+ return false;
+}
+
+void
+Note_heads_engraver::do_process_requests()
+{
+ if (note_p_arr_.size ())
+ return ;
+
+ String noteheadstyle = get_property ("noteHeadStyle", 0);
+ for (int i=0; i < note_req_l_arr_.size (); i++)
+ {
+ Note_head *note_p = new Note_head;
+ Note_req * note_req_l = note_req_l_arr_[i];
+ note_p->balltype_i_ = note_req_l->duration_.durlog_i_;
+ note_p->dots_i_ = note_req_l->duration_.dots_i_;
+ if (note_p->dots_i_)
+ {
+ Dots * d = new Dots;
+ note_p->dots_l_ = d;
+ announce_element (Score_element_info (d,0));
+ dot_p_arr_.push (d);
+ }
+
+ // note_p->steps_i_ = note_req_l->pitch_.steps ();
+ note_p->position_i_ = note_req_l->pitch_.steps ();
+
+
+ if (noteheadstyle == "transparent")
+ note_p->set_elt_property (transparent_scm_sym, SCM_BOOL_T);
+ else
+ note_p->set_elt_property (style_scm_sym,
+ gh_str02scm (noteheadstyle.ch_C()));
+
+
+ Score_element_info itinf (note_p,note_req_l);
+ announce_element (itinf);
+ note_p_arr_.push (note_p);
+ }
+}
+
+void
+Note_heads_engraver::do_pre_move_processing()
+{
+ for (int i=0; i < note_p_arr_.size (); i++)
+ {
+ typeset_element (note_p_arr_[i]);
+ }
+ note_p_arr_.clear ();
+ for (int i=0; i < dot_p_arr_.size (); i++)
+ {
+ typeset_element (dot_p_arr_[i]);
+ }
+ dot_p_arr_.clear ();
+
+ note_req_l_arr_.clear ();
+}
+
+void
+Note_heads_engraver::do_post_move_processing()
+{
+
+}
+
+
+
+ADD_THIS_TRANSLATOR(Note_heads_engraver);
/*
- p-col.cc -- implement Paper_column
+ paper-column.cc -- implement Paper_column
source file of the GNU LilyPond music typesetter
(c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-#include "p-col.hh"
-#include "p-score.hh"
+#include "paper-column.hh"
+#include "paper-score.hh"
#include "debug.hh"
void
+++ /dev/null
-/*
- p-score.cc -- implement Paper_score
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "main.hh"
-#include "debug.hh"
-#include "lookup.hh"
-#include "spanner.hh"
-#include "paper-def.hh"
-#include "line-of-score.hh"
-#include "p-col.hh"
-#include "p-score.hh"
-#include "p-col.hh"
-#include "scope.hh"
-#include "word-wrap.hh"
-#include "gourlay-breaking.hh"
-#include "paper-stream.hh"
-#include "paper-outputter.hh"
-#include "file-results.hh"
-#include "misc.hh"
-
-Paper_score::Paper_score ()
-{
- protected_scms_ = scm_protect_object (gh_cons (SCM_BOOL_T, SCM_EOL));
- paper_l_ =0;
- outputter_l_ =0;
- Line_of_score * line_p = new Line_of_score;
- typeset_unbroken_spanner (line_p);
-
- line_l_ = line_p;
-}
-
-Paper_score::Paper_score (Paper_score const &s)
- : Music_output (s)
-{
- assert (false);
-}
-
-Paper_score::~Paper_score ()
-{
- for (int i=span_p_arr_.size (); --i >=0 ; )
- delete span_p_arr_[i];
- for (int i=elem_p_arr_.size (); --i >=0 ; )
- delete elem_p_arr_[i];
-
- scm_unprotect_object (protected_scms_);
-}
-
-void
-Paper_score::typeset_element (Score_element * elem_p)
-{
- elem_p_arr_.push (elem_p);
- elem_p->pscore_l_ = this;
-
- // take over protection.
- SCM_CDR(protected_scms_) = gh_cons (elem_p->element_property_alist_,
- SCM_CDR (protected_scms_));
- scm_unprotect_object (elem_p->element_property_alist_);
-
- SCM p = elem_p->remove_elt_property (break_helper_only_scm_sym);
- if (p != SCM_BOOL_F)
- break_helpers_arr_.push (elem_p);
-}
-
-
-void
-Paper_score::typeset_unbroken_spanner (Spanner*span_p)
-{
- span_p_arr_.push (span_p);
- span_p->pscore_l_=this;
-
- SCM p = span_p->remove_elt_property (break_helper_only_scm_sym);
- if (p != SCM_BOOL_F)
- break_helpers_arr_.push (span_p);
-}
-
-void
-Paper_score::add_column (Paper_column *p)
-{
- p->set_rank (col_l_arr_.size ());
- col_l_arr_.push (p);
- typeset_element(p);
-}
-
-
-
-void
-Paper_score::print () const
-{
-#ifndef NPRINT
- if (!check_debug)
- return ;
- DOUT << "Paper_score { ";
- DOUT << "\n elements: ";
- for (int i=0; i < span_p_arr_.size (); i++)
- span_p_arr_[i]->print ();
- for (int i=0; i < elem_p_arr_.size (); i++)
- elem_p_arr_[i]->print();
-
- DOUT << "}\n";
-#endif
-}
-
-int
-Paper_score::find_col_idx (Paper_column const *c) const
-{
- Paper_column const *what = c;
-
- return col_l_arr_.find_i ((Paper_column*)what);
-}
-
-Array<Column_x_positions>
-Paper_score::calc_breaking ()
-{
- Break_algorithm *algorithm_p=0;
- Array<Column_x_positions> sol;
- bool try_wrap = !paper_l_->get_var ("castingalgorithm");
-
- if (!try_wrap)
- {
- algorithm_p = new Gourlay_breaking ;
- algorithm_p->set_pscore (this);
- sol = algorithm_p->solve ();
- delete algorithm_p;
- if (! sol.size ())
- {
- warning (_ ("Can't solve this casting problem exactly; revert to Word_wrap"));
- try_wrap = true;
- }
- }
- if (try_wrap)
- {
- algorithm_p = new Word_wrap;
- algorithm_p->set_pscore (this);
- sol = algorithm_p->solve ();
- delete algorithm_p;
- }
- return sol;
-}
-
-
-
-void
-Paper_score::process ()
-{
- Dictionary<int> type_stats;
- type_stats["Item"] =0;
- type_stats["Spanner"] =0;
- type_stats["Total"]=0;
-
- print ();
- *mlog << _ ("Preprocessing elements...") << " " << flush;
- line_l_->breakable_col_processing ();
- line_l_->pre_processing ();
-
- *mlog << '\n' << _ ("Calculating column positions...") << " " << flush;
- line_l_->space_processing ();
-
- Array<Column_x_positions> breaking = calc_breaking ();
-
-
- Paper_stream* paper_stream_p = paper_l_->paper_stream_p ();
- outputter_l_ = paper_l_->paper_outputter_p (paper_stream_p, header_l_, origin_str_);
-
- Link_array<Line_of_score> lines;
- for (int i=0; i < breaking.size (); i++)
- {
- Line_of_score *line_l = line_l_->set_breaking (breaking, i);
- lines.push (line_l);
- if (line_l != line_l_)
- typeset_element (line_l);
- }
-
- if (experimental_features_global_b)
- *mlog << elem_p_arr_.size () + span_p_arr_.size () << _ (" elements. ");
-
- *mlog << "\n";
- *mlog << _ ("Line ... ");
- line_l_->break_processing ();
- for (int i=0; i < lines.size (); i++)
- {
- *mlog << '[' << flush;
-
- Line_of_score *line_l = lines[i];
-
- line_l->post_processing ();
- *mlog << i << flush;
- line_l->output_all (i + 1 == lines.size());
- if (experimental_features_global_b)
- *mlog << '(' << elem_p_arr_.size () + span_p_arr_.size () << ')';
-
- *mlog << ']' << flush;
- }
-
- // huh?
- delete outputter_l_;
- delete paper_stream_p;
- outputter_l_ = 0;
-
-
- /*
- todo: sort output
- */
- if (experimental_features_global_b)
- {
- for (Dictionary_iter<int> i(type_stats); i.ok(); i++)
- {
- *mlog << i.key () << ": " << i.val () << " objects\n";
- }
- }
- *mlog << '\n' << flush;
-
-}
-
-Link_array<Item>
-Paper_score::broken_col_range (Item const*l, Item const*r) const
-{
- Link_array<Item> ret;
-
- l = l->column_l ();
- r = r->column_l ();
-
- int start = l
- ? find_col_idx (dynamic_cast<Paper_column*> ((Item*)l))+1
- : 0;
-
- int stop = r
- ? find_col_idx (dynamic_cast<Paper_column*>((Item*)r))
- : col_l_arr_.size ();
-
- while (start < stop)
- {
- Paper_column *c = col_l_arr_[start];
- if (c->breakable_b () && !c->line_l_)
- ret.push (c);
- start++;
- }
-
- return ret;
-}
#include "debug.hh"
#include "lookup.hh"
#include "score-engraver.hh"
-#include "p-score.hh"
+#include "paper-score.hh"
#include "identifier.hh"
#include "main.hh"
#include "scope.hh"
--- /dev/null
+/*
+ p-score.cc -- implement Paper_score
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+#include "main.hh"
+#include "debug.hh"
+#include "lookup.hh"
+#include "spanner.hh"
+#include "paper-def.hh"
+#include "line-of-score.hh"
+#include "paper-column.hh"
+#include "paper-score.hh"
+#include "paper-column.hh"
+#include "scope.hh"
+#include "word-wrap.hh"
+#include "gourlay-breaking.hh"
+#include "paper-stream.hh"
+#include "paper-outputter.hh"
+#include "file-results.hh"
+#include "misc.hh"
+
+Paper_score::Paper_score ()
+{
+ protected_scms_ = scm_protect_object (gh_cons (SCM_BOOL_T, SCM_EOL));
+ paper_l_ =0;
+ outputter_l_ =0;
+ Line_of_score * line_p = new Line_of_score;
+ typeset_unbroken_spanner (line_p);
+
+ line_l_ = line_p;
+}
+
+Paper_score::Paper_score (Paper_score const &s)
+ : Music_output (s)
+{
+ assert (false);
+}
+
+Paper_score::~Paper_score ()
+{
+ for (int i=span_p_arr_.size (); --i >=0 ; )
+ delete span_p_arr_[i];
+ for (int i=elem_p_arr_.size (); --i >=0 ; )
+ delete elem_p_arr_[i];
+
+ scm_unprotect_object (protected_scms_);
+}
+
+void
+Paper_score::typeset_element (Score_element * elem_p)
+{
+ elem_p_arr_.push (elem_p);
+ elem_p->pscore_l_ = this;
+
+ // take over protection.
+ SCM_CDR(protected_scms_) = gh_cons (elem_p->element_property_alist_,
+ SCM_CDR (protected_scms_));
+ scm_unprotect_object (elem_p->element_property_alist_);
+
+ SCM p = elem_p->remove_elt_property (break_helper_only_scm_sym);
+ if (p != SCM_BOOL_F)
+ break_helpers_arr_.push (elem_p);
+}
+
+
+void
+Paper_score::typeset_unbroken_spanner (Spanner*span_p)
+{
+ span_p_arr_.push (span_p);
+ span_p->pscore_l_=this;
+
+ SCM p = span_p->remove_elt_property (break_helper_only_scm_sym);
+ if (p != SCM_BOOL_F)
+ break_helpers_arr_.push (span_p);
+}
+
+void
+Paper_score::add_column (Paper_column *p)
+{
+ p->set_rank (col_l_arr_.size ());
+ col_l_arr_.push (p);
+ typeset_element(p);
+}
+
+
+
+void
+Paper_score::print () const
+{
+#ifndef NPRINT
+ if (!check_debug)
+ return ;
+ DOUT << "Paper_score { ";
+ DOUT << "\n elements: ";
+ for (int i=0; i < span_p_arr_.size (); i++)
+ span_p_arr_[i]->print ();
+ for (int i=0; i < elem_p_arr_.size (); i++)
+ elem_p_arr_[i]->print();
+
+ DOUT << "}\n";
+#endif
+}
+
+int
+Paper_score::find_col_idx (Paper_column const *c) const
+{
+ Paper_column const *what = c;
+
+ return col_l_arr_.find_i ((Paper_column*)what);
+}
+
+Array<Column_x_positions>
+Paper_score::calc_breaking ()
+{
+ Break_algorithm *algorithm_p=0;
+ Array<Column_x_positions> sol;
+ bool try_wrap = !paper_l_->get_var ("castingalgorithm");
+
+ if (!try_wrap)
+ {
+ algorithm_p = new Gourlay_breaking ;
+ algorithm_p->set_pscore (this);
+ sol = algorithm_p->solve ();
+ delete algorithm_p;
+ if (! sol.size ())
+ {
+ warning (_ ("Can't solve this casting problem exactly; revert to Word_wrap"));
+ try_wrap = true;
+ }
+ }
+ if (try_wrap)
+ {
+ algorithm_p = new Word_wrap;
+ algorithm_p->set_pscore (this);
+ sol = algorithm_p->solve ();
+ delete algorithm_p;
+ }
+ return sol;
+}
+
+
+
+void
+Paper_score::process ()
+{
+ Dictionary<int> type_stats;
+ type_stats["Item"] =0;
+ type_stats["Spanner"] =0;
+ type_stats["Total"]=0;
+
+ print ();
+ *mlog << _ ("Preprocessing elements...") << " " << flush;
+ line_l_->breakable_col_processing ();
+ line_l_->pre_processing ();
+
+ *mlog << '\n' << _ ("Calculating column positions...") << " " << flush;
+ line_l_->space_processing ();
+
+ Array<Column_x_positions> breaking = calc_breaking ();
+
+
+ Paper_stream* paper_stream_p = paper_l_->paper_stream_p ();
+ outputter_l_ = paper_l_->paper_outputter_p (paper_stream_p, header_l_, origin_str_);
+
+ Link_array<Line_of_score> lines;
+ for (int i=0; i < breaking.size (); i++)
+ {
+ Line_of_score *line_l = line_l_->set_breaking (breaking, i);
+ lines.push (line_l);
+ if (line_l != line_l_)
+ typeset_element (line_l);
+ }
+
+ if (experimental_features_global_b)
+ *mlog << elem_p_arr_.size () + span_p_arr_.size () << _ (" elements. ");
+
+ *mlog << "\n";
+ *mlog << _ ("Line ... ");
+ line_l_->break_processing ();
+ for (int i=0; i < lines.size (); i++)
+ {
+ *mlog << '[' << flush;
+
+ Line_of_score *line_l = lines[i];
+
+ line_l->post_processing ();
+ *mlog << i << flush;
+ line_l->output_all (i + 1 == lines.size());
+ if (experimental_features_global_b)
+ *mlog << '(' << elem_p_arr_.size () + span_p_arr_.size () << ')';
+
+ *mlog << ']' << flush;
+ }
+
+ // huh?
+ delete outputter_l_;
+ delete paper_stream_p;
+ outputter_l_ = 0;
+
+
+ /*
+ todo: sort output
+ */
+ if (experimental_features_global_b)
+ {
+ for (Dictionary_iter<int> i(type_stats); i.ok(); i++)
+ {
+ *mlog << i.key () << ": " << i.val () << " objects\n";
+ }
+ }
+ *mlog << '\n' << flush;
+
+}
+
+Link_array<Item>
+Paper_score::broken_col_range (Item const*l, Item const*r) const
+{
+ Link_array<Item> ret;
+
+ l = l->column_l ();
+ r = r->column_l ();
+
+ int start = l
+ ? find_col_idx (dynamic_cast<Paper_column*> ((Item*)l))+1
+ : 0;
+
+ int stop = r
+ ? find_col_idx (dynamic_cast<Paper_column*>((Item*)r))
+ : col_l_arr_.size ();
+
+ while (start < stop)
+ {
+ Paper_column *c = col_l_arr_[start];
+ if (c->breakable_b () && !c->line_l_)
+ ret.push (c);
+ start++;
+ }
+
+ return ret;
+}
--- /dev/null
+/*
+ request-chord-iterator.cc -- implement Request_chord_iterator
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+#include "translator-group.hh"
+#include "debug.hh"
+#include "request-chord-iterator.hh"
+#include "music-list.hh"
+#include "request.hh"
+
+
+
+void
+Request_chord_iterator::construct_children()
+{
+ elt_length_mom_ =elt_l ()->length_mom ();
+ get_req_translator_l();
+}
+
+Request_chord*
+Request_chord_iterator::elt_l () const
+{
+ return (Request_chord*) music_l_;
+}
+
+Request_chord_iterator::Request_chord_iterator ()
+{
+ last_b_ = false;
+ // cursor_ = elt_l ()->music_p_list_p_->head_;
+ cursor_ = 0;
+}
+
+
+bool
+Request_chord_iterator::ok() const
+{
+ return (elt_length_mom_ && !last_b_) || first_b_;
+}
+
+Moment
+Request_chord_iterator::next_moment() const
+{
+ Moment m (0);
+ if (!first_b_)
+ m = elt_length_mom_;
+ return m;
+}
+
+Music*
+Request_chord_iterator::next_music_l ()
+{
+ if (first_b_)
+ {
+ cursor_ = elt_l ()->music_p_list_p_->head_;
+ first_b_ = false;
+ }
+ else
+ {
+ if (cursor_)
+ cursor_ = cursor_->next_;
+ }
+ if (cursor_)
+ return cursor_->car_;
+ else
+ return 0;
+}
+
+void
+Request_chord_iterator::do_print() const
+{
+#ifndef NPRINT
+ DOUT << "duration: " << elt_length_mom_;
+#endif
+}
+
+void
+Request_chord_iterator::do_process_and_next (Moment mom)
+{
+ if (first_b_)
+ {
+ for (Cons<Music> *i = elt_l ()->music_p_list_p_->head_; i; i = i->next_)
+ {
+ if (Request * req_l = dynamic_cast<Request*> (i->car_))
+ {
+ bool gotcha = report_to_l()->try_music (req_l);
+ if (!gotcha)
+ req_l->warning (_f ("junking request: `%s\'", classname( req_l)));
+ }
+ else
+ i->car_->warning (_f ("Huh? Not a Request: `%s\'",
+ classname (i->car_)));
+ }
+ first_b_ = false;
+ }
+
+ if (mom >= elt_length_mom_)
+ last_b_ = true;
+}
+++ /dev/null
-/*
- request-iterator.cc -- implement Request_chord_iterator
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "translator-group.hh"
-#include "debug.hh"
-#include "request-iterator.hh"
-#include "music-list.hh"
-#include "request.hh"
-
-
-
-void
-Request_chord_iterator::construct_children()
-{
- elt_length_mom_ =elt_l ()->length_mom ();
- get_req_translator_l();
-}
-
-Request_chord*
-Request_chord_iterator::elt_l () const
-{
- return (Request_chord*) music_l_;
-}
-
-Request_chord_iterator::Request_chord_iterator ()
-{
- last_b_ = false;
- // cursor_ = elt_l ()->music_p_list_p_->head_;
- cursor_ = 0;
-}
-
-
-bool
-Request_chord_iterator::ok() const
-{
- return (elt_length_mom_ && !last_b_) || first_b_;
-}
-
-Moment
-Request_chord_iterator::next_moment() const
-{
- Moment m (0);
- if (!first_b_)
- m = elt_length_mom_;
- return m;
-}
-
-Music*
-Request_chord_iterator::next_music_l ()
-{
- if (first_b_)
- {
- cursor_ = elt_l ()->music_p_list_p_->head_;
- first_b_ = false;
- }
- else
- {
- if (cursor_)
- cursor_ = cursor_->next_;
- }
- if (cursor_)
- return cursor_->car_;
- else
- return 0;
-}
-
-void
-Request_chord_iterator::do_print() const
-{
-#ifndef NPRINT
- DOUT << "duration: " << elt_length_mom_;
-#endif
-}
-
-void
-Request_chord_iterator::do_process_and_next (Moment mom)
-{
- if (first_b_)
- {
- for (Cons<Music> *i = elt_l ()->music_p_list_p_->head_; i; i = i->next_)
- {
- if (Request * req_l = dynamic_cast<Request*> (i->car_))
- {
- bool gotcha = report_to_l()->try_music (req_l);
- if (!gotcha)
- req_l->warning (_f ("junking request: `%s\'", classname( req_l)));
- }
- else
- i->car_->warning (_f ("Huh? Not a Request: `%s\'",
- classname (i->car_)));
- }
- first_b_ = false;
- }
-
- if (mom >= elt_length_mom_)
- last_b_ = true;
-}
#include "rest.hh"
#include "dots.hh"
#include "axis-group-element.hh"
-#include "p-score.hh"
+#include "paper-score.hh"
void
Rest::do_add_processing ()
position_i_ += 2;
Rhythmic_head::do_add_processing ();
+}
+
+void
+Rest::do_post_processing ()
+{
+ Rhythmic_head::do_post_processing ();
if (dots_l_ && balltype_i_ > 4)
{
- dots_l_->position_i_ = position_i_ + 3;
+ dots_l_->position_i_ += 3;
if (balltype_i_ == 7)
dots_l_->position_i_++;
}
#include "rest.hh"
#include "dots.hh"
#include "axis-group-element.hh"
-#include "p-score.hh"
+#include "paper-score.hh"
#include "stem.hh"
void
}
if (dots_l_)
{
- dots_l_->no_dots_i_ = dots_i_;
+ dots_l_->dots_i_ = dots_i_;
}
}
+void
+Rhythmic_head::do_post_processing ()
+{
+ if (dots_l_)
+ {
+ if (stem_l_)
+ dots_l_->resolve_dir_ = stem_l_->dir_;
+ dots_l_->position_i_ = position_i_;
+ }
+}
+
+
void
Rhythmic_head::add_dots (Dots *dot_l)
{
dot_l->add_dependency (this);
}
-
Rhythmic_head::Rhythmic_head ()
{
dots_l_ =0;
balltype_i_ =0;
dots_i_ = 0;
stem_l_ =0;
+ position_i_ =0;
}
void
*/
#include "rod.hh"
-#include "p-col.hh"
+#include "paper-column.hh"
#include "debug.hh"
#include "dimensions.hh"
#include "single-malt-grouping-item.hh"
*/
#include "debug.hh"
-#include "p-col.hh"
+#include "paper-column.hh"
#include "score-column.hh"
#include "command-request.hh"
#include <string.h>
-#include "p-score.hh"
+#include "paper-score.hh"
#include "paper-def.hh"
#include "lookup.hh"
#include "molecule.hh"
#include "spanner.hh"
#include "line-of-score.hh"
#include "item.hh"
-#include "p-col.hh"
+#include "paper-column.hh"
#include "molecule.hh"
#include "misc.hh"
#include "paper-outputter.hh"
{
}
+void
+Score_element::handle_broken_dependents()
+{
+}
+
Link_array<Score_element>
#include "debug.hh"
#include "item.hh"
#include "score-engraver.hh"
-#include "p-score.hh"
+#include "paper-score.hh"
#include "musical-request.hh"
#include "score-column.hh"
#include "command-request.hh"
#include "paper-def.hh"
-
-
Score_engraver::Score_engraver()
{
break_penalty_i_ = 0;
{
Score_element * elem_p = elem_p_arr_[i];
elem_p->add_processing ();
+
+#if 0 // TODO!
+ /*
+ elem_p wants to be connected to the rest of the
+ dependency graph.
+ */
+
+ if (elem_p->get_elt_property (dangling_scm_sym) != SCM_BOOL_F)
+ scoreline_l_->add_dependency (elem_p);
+#endif
+
if (Spanner *s = dynamic_cast <Spanner *> (elem_p))
{
/*
#include "separating-group-spanner.hh"
#include "single-malt-grouping-item.hh"
-#include "p-col.hh"
+#include "paper-column.hh"
#include "paper-def.hh"
#include "dimensions.hh"
#include "separating-line-group-engraver.hh"
#include "separating-group-spanner.hh"
#include "single-malt-grouping-item.hh"
-#include "p-col.hh"
+#include "paper-column.hh"
#include "paper-def.hh"
Separating_line_group_engraver::Separating_line_group_engraver ()
#include "debug.hh"
#include "sequential-music-iterator.hh"
#include "music-list.hh"
-// hmm
-//#include "request-chord-iterator.hh"
-#include "request-iterator.hh"
+#include "request-chord-iterator.hh"
+
void
Sequential_music_iterator::do_print() const
*/
#include "single-malt-grouping-item.hh"
-#include "p-col.hh"
+#include "paper-column.hh"
#include "debug.hh"
Single_malt_grouping_item ::Single_malt_grouping_item()
typeset_element (slur_l_stack_[i]);
}
slur_l_stack_.clear ();
- for (int i=0; i < requests_arr_.size(); i++)
- {
- requests_arr_[i]->warning (_ ("unterminated slur"));
- }
+ if (!get_property ("weAreGraceContext",0).to_bool ())
+ for (int i=0; i < requests_arr_.size(); i++)
+ {
+ requests_arr_[i]->warning (_ ("unterminated slur"));
+ }
}
void
#include "paper-def.hh"
#include "note-column.hh"
#include "stem.hh"
-#include "p-col.hh"
+#include "paper-column.hh"
#include "molecule.hh"
#include "debug.hh"
#include "box.hh"
}
while (flip (&d) != LEFT);
+ int interstaff_i = 0;
+ for (int i = 0; i < encompass_arr_.size (); i++)
+ {
+ Encompass_info info (encompass_arr_[i], dir_, this);
+ if (info.interstaff_f_)
+ {
+ interstaff_i++;
+ }
+ }
+ bool interstaff_b = interstaff_i && (interstaff_i < encompass_arr_.size ());
+
+ Drul_array<Encompass_info> info_drul;
+ info_drul[LEFT] = Encompass_info (encompass_arr_[0], dir_, this);
+ info_drul[RIGHT] = Encompass_info (encompass_arr_.top (), dir_, this);
+ Real interstaff_f = info_drul[RIGHT].interstaff_f_
+ - info_drul[LEFT].interstaff_f_;
+
if (fix_broken_b)
- do {
- if (dy_f_drul_[d])
- dy_f_drul_[-d] = dy_f_drul_[d];
+ {
+ Direction d = (encompass_arr_.top () != spanned_drul_[RIGHT]) ?
+ RIGHT : LEFT;
+ dy_f_drul_[d] = info_drul[d].o_[Y_AXIS];
+ if (!interstaff_b)
+ {
+ dy_f_drul_[d] -= info_drul[d].interstaff_f_;
+
+ if (interstaff_i)
+ {
+ dy_f_drul_[LEFT] += info_drul[d].interstaff_f_;
+ dy_f_drul_[RIGHT] += info_drul[d].interstaff_f_;
+ }
+ }
}
- while (flip (&d) != LEFT);
/*
Catch and correct some ugly cases
*/
- Real dx_f = do_width ().length () + dx_f_drul_[RIGHT] - dx_f_drul_[LEFT];
+ Real height_damp_f;
+ Real slope_damp_f;
+ Real snap_f;
+ Real ratio_f;
+
+ if (!fix_broken_b)
+ dy_f_drul_[RIGHT] += interstaff_f;
Real dy_f = dy_f_drul_[RIGHT] - dy_f_drul_[LEFT];
+
+ Real dx_f = do_width ().length () + dx_f_drul_[RIGHT] - dx_f_drul_[LEFT];
Real height_f = do_height ().length ();
- Real height_damp_f = paper_l ()->get_var ("slur_height_damping");
- Real slope_damp_f = paper_l ()->get_var ("slur_slope_damping");
- Real ratio_f;
+ if (!interstaff_b)
+ {
+ height_damp_f = paper_l ()->get_var ("slur_height_damping");
+ slope_damp_f = paper_l ()->get_var ("slur_slope_damping");
+ snap_f = paper_l ()->get_var ("slur_snap_to_stem");
+ }
+ else
+ {
+ height_damp_f = paper_l ()->get_var ("slur_interstaff_height_damping");
+ slope_damp_f = paper_l ()->get_var ("slur_interstaff_slope_damping");
+ snap_f = paper_l ()->get_var ("slur_interstaff_snap_to_stem");
+ }
/*
Direction d = (Direction)(- dir_ * (sign (dy_f)));
if (!d)
d = LEFT;
- dy_f_drul_[d] += dir_ * height_f * height_damp_f;
+ Real damp_f = dir_ * (ratio_f - height_damp_f) * dx_f;
+ dy_f_drul_[d] += damp_f;
/*
- if y positions at same height, correct both ends
+ if y positions at about the same height, correct both ends
*/
if (abs (dy_f / dx_f ) < slope_damp_f)
{
- dy_f_drul_[-d] += dir_ * height_f * height_damp_f;
+ dy_f_drul_[-d] += damp_f;
}
}
/*
If, after correcting, we're close to stem-end...
*/
- Real snap_f = paper_l ()->get_var ("slur_snap_to_stem");
do
{
if ((note_column_drul[d] == spanned_drul_[d])
&& (note_column_drul[d]->stem_l_)
&& (note_column_drul[d]->stem_l_->dir_ == dir_)
&& (abs (note_column_drul[d]->stem_l_->extent (Y_AXIS)[dir_]
- - dy_f_drul_[d]) <= snap_f))
+ - dy_f_drul_[d] + (d == LEFT ? 0 : interstaff_f))
+ <= snap_f))
{
/*
attach to stem-end
dx_f_drul_[d] = stem_l->hpos_f ()
- spanned_drul_[d]->absolute_coordinate (X_AXIS);
dy_f_drul_[d] = stem_l->extent (Y_AXIS)[dir_];
+ dy_f_drul_[d] += info_drul[d].interstaff_f_;
dy_f_drul_[d] += dir_ * 2 * y_gap_f;
}
}
Slur::get_encompass_offset_arr () const
{
Array<Offset> offset_arr;
+#if 0
+ /*
+ check non-disturbed slur
+ FIXME: x of ends off by a tiny bit!!
+ */
+ offset_arr.push (Offset (0, dy_f_drul_[LEFT]));
+ offset_arr.push (Offset (0, dy_f_drul_[RIGHT]));
+ return offset_arr;
+#endif
+
+ int interstaff_i = 0;
+ for (int i = 0; i < encompass_arr_.size (); i++)
+ {
+ Encompass_info info (encompass_arr_[i], dir_, this);
+ if (info.interstaff_f_)
+ {
+ interstaff_i++;
+ }
+ }
+ bool interstaff_b = interstaff_i && (interstaff_i < encompass_arr_.size ());
+
Offset origin (absolute_coordinate (X_AXIS), 0);
int first = 1;
int last = encompass_arr_.size () - 2;
+ offset_arr.push (Offset (dx_f_drul_[LEFT], dy_f_drul_[LEFT]));
/*
left is broken edge
*/
if (encompass_arr_[0] != spanned_drul_[LEFT])
{
first--;
+ Encompass_info left_info (encompass_arr_[0], dir_, this);
+ if (interstaff_b)
+ offset_arr[0][Y_AXIS] += left_info.interstaff_f_;
}
- Encompass_info left_info (encompass_arr_[0], dir_, this);
- offset_arr.push (Offset (0, left_info.interstaff_f_));
/*
right is broken edge
offset_arr.push (info.o_ - origin);
}
- offset_arr.push (Offset (do_width ().length (), 0));
+ offset_arr.push (Offset (do_width ().length () + dx_f_drul_[RIGHT],
+ dy_f_drul_[RIGHT]));
-#if 1
- offset_arr[0] += Offset (dx_f_drul_[LEFT], dy_f_drul_[LEFT]);
- offset_arr.top () += Offset (dx_f_drul_[RIGHT], dy_f_drul_[RIGHT]);
-#else
- /*
- check non-disturbed slur
- FIXME: ends off by a tiny bit!!
- */
- offset_arr[0] += Offset (0, dy_f_drul_[LEFT]);
- offset_arr.top () += Offset (0, dy_f_drul_[RIGHT]);
-#endif
-
return offset_arr;
}
void
Spacing_engraver::acknowledge_element (Score_element_info i)
{
+ if (i.elem_l_->get_elt_property (grace_scm_sym) != SCM_BOOL_F)
+ return;
+
if (Rhythmic_req * r = dynamic_cast<Rhythmic_req*>(i.req_l_))
{
Rhythmic_tuple t(i, now_mom () + r->length_mom ());
#include "dimensions.hh"
#include "paper-def.hh"
#include "warn.hh"
-#include "p-score.hh"
+#include "paper-score.hh"
#include "line-of-score.hh"
Spacing_spanner::Spacing_spanner ()
#include "debug.hh"
#include "spanner.hh"
-#include "p-col.hh"
-#include "p-score.hh"
+#include "paper-column.hh"
+#include "paper-score.hh"
#include "molecule.hh"
#include "paper-outputter.hh"
ss[i].add_to_cols ();
}
}
+
+void
+Spanner::handle_broken_dependents ()
+{
+#if 0 // need to remove delayd breaking.
+ if (original_l_ && !original_l_->line_l ())
+ {
+
+ /* we're the broken pieces of a spanner.
+ Check if our Y-leaning point is sane.
+ */
+ Dimension_cache *d = dim_cache_[Y_AXIS]->parent_l_;
+ if (d)
+ return;
+
+ Score_element * ref_elt = dynamic_cast<Score_element*>(d->element_l());
+ Spanner *ref_span = dynamic_cast<Spanner*> (ref_elt);
+ if (!ref_elt->line_l () && ref_span)
+ {
+ Spanner *broken_refpoint = ref_span->find_broken_piece (line_l ());
+ if (broken_refpoint)
+ dim_cache_[Y_AXIS]->parent_l_ = broken_refpoint->dim_cache_[Y_AXIS];
+ else
+ programming_error ("Spanner y -refpoint lost.");
+ }
+ }
+#endif
+}
#include <limits.h>
#include "killing-cons.tcc"
#include "spring-spacer.hh"
-#include "p-col.hh"
+#include "paper-column.hh"
#include "debug.hh"
#include "dimensions.hh"
#include "qlp.hh"
#include "spring.hh"
#include "debug.hh"
#include "item.hh"
-#include "p-col.hh"
+#include "paper-column.hh"
Spring::Spring ()
{
#include "staff-sym-engraver.hh"
#include "staff-symbol.hh"
#include "score.hh"
-#include "p-col.hh"
+#include "paper-column.hh"
#include "staff-symbol-referencer.hh"
#include "paper-def.hh"
#include "note-head.hh"
#include "lookup.hh"
#include "molecule.hh"
-#include "p-col.hh"
+#include "paper-column.hh"
#include "misc.hh"
#include "beam.hh"
#include "rest.hh"
#include "super-element.hh"
#include "line-of-score.hh"
-#include "p-score.hh"
+#include "paper-score.hh"
#include "string.hh"
#include "paper-outputter.hh"
SPACING,
SPACED,
BROKEN,
+ BROKEN_SECOND,
POSTCALCING, // busy calculating. This is used to trap cyclic deps.
POSTCALCED, // after spacing calcs done
BREWING,
Super_element::break_processing ()
{
calculate_dependencies (BROKEN, BROKEN, &Score_element::do_break_processing);
+ calculate_dependencies (BROKEN_SECOND, BROKEN_SECOND,
+ &Score_element::handle_broken_dependents);
}
void
Super_element::post_processing ()
#include "paper-def.hh"
#include "tie.hh"
#include "note-head.hh"
-#include "p-col.hh"
+#include "paper-column.hh"
#include "debug.hh"
return ret;
}
-
bool
-Translator_group::do_try_music (Music* req_l)
+Translator_group::try_music_on_nongroup_children (Music *m)
{
bool hebbes_b =false;
Link_array<Translator> nongroups (nongroup_l_arr ());
for (int i =0; !hebbes_b && i < nongroups.size() ; i++)
- hebbes_b =nongroups[i]->try_music (req_l);
+ hebbes_b =nongroups[i]->try_music (m);
+ return hebbes_b;
+}
+
+bool
+Translator_group::do_try_music (Music* m)
+{
+ bool hebbes_b = try_music_on_nongroup_children (m);
+
if (!hebbes_b && daddy_trans_l_)
- hebbes_b = daddy_trans_l_->try_music (req_l);
+ hebbes_b = daddy_trans_l_->try_music (m);
return hebbes_b ;
}
#include "debug.hh"
#include "lookup.hh"
#include "molecule.hh"
-#include "p-col.hh"
+#include "paper-column.hh"
#include "paper-def.hh"
#include "tuplet-spanner.hh"
#include "stem.hh"
*/
#include "translator-group.hh"
#include "axis-group-engraver.hh"
-#include "p-col.hh"
+#include "paper-column.hh"
#include "vertical-align-engraver.hh"
#include "axis-align-spanner.hh"
#include "axis-group-spanner.hh"
#include "lookup.hh"
#include "molecule.hh"
#include "note-column.hh"
-#include "p-col.hh"
+#include "paper-column.hh"
#include "bar.hh"
#include "paper-def.hh"
#include "volta-spanner.hh"
#include "word-wrap.hh"
#include "paper-def.hh"
-#include "p-score.hh"
+#include "paper-score.hh"
#include "debug.hh"
-#include "p-col.hh"
+#include "paper-column.hh"
#include "spring-spacer.hh"
papersize = "a4"
-
+\include "generic-paper.ly"
\include "paper20.ly"
\paper{
\consists "Note_heads_engraver";
\consists "Local_key_engraver";
\consists "Stem_engraver";
- \consists "Slur_engraver";
- \consists "Timing_engraver"; %UGH.
\consists "Beam_engraver";
beamAuto = "1";
+ \consists "Slur_engraver";
\consists "Auto_beam_engraver";
\include "auto-beam-settings.ly";
\consists "Align_note_column_engraver";
fontSize = "-1";
stemLength = "6.0";
verticalDirection = "1";
+ graceAccidentalSpace= 1.5 * \interline;
};
\translator{\GraceContext}
--- /dev/null
+\paper {
+ texsetting = "\\input lilyponddefs ";
+ pssetting = "(lilyponddefs.ps) findlibfile {exch pop //systemdict /run get exec} { /undefinedfilename signalerror } ifelse\n";
+ scmsetting = "\"(lilyponddefs.ps) findlibfile {exch pop //systemdict /run get exec} { /undefinedfilename signalerror } ifelse\";\n";
+}
font_finger = 4.;
font_volta = 5.;
font_number = 8.;
- font_dynamic = 10.;
- font_mark = 10.;
+ font_dynamic = 10.;
+ font_mark = 10.;
arithmetic_basicspace = 2.;
arithmetic_multiplier = 4.8\pt;
- texsetting = "\\input lilyponddefs ";
- pssetting = "(lilyponddefs.ps) findlibfile {exch pop //systemdict /run get exec} { /undefinedfilename signalerror } ifelse\n";
- scmsetting = "\"(lilyponddefs.ps) findlibfile {exch pop //systemdict /run get exec} { /undefinedfilename signalerror } ifelse\";\n";
- scmsetting = "\"\\\\input lilyponddefs \\\\musixsixteendefs\";\n";
+
+% scmsetting = "\"\\\\input lilyponddefs \";\n";
0 = \font "feta16"
-1 = \font "feta13"
arithmetic_basicspace = 2.;
arithmetic_multiplier = 6.\pt;
- texsetting = "\\input lilyponddefs ";
- pssetting = "(lilyponddefs.ps) findlibfile {exch pop //systemdict /run get exec} { /undefinedfilename signalerror } ifelse\n";
- % urg, debugging only
- scmsetting = "\"(lilyponddefs.ps) findlibfile {exch pop //systemdict /run get exec} { /undefinedfilename signalerror } ifelse\";\n";
- scmsetting = "\"\\\\input lilyponddefs \\\\musixtwentydefs\";\n";
- -2 = \font "feta13"
+ -2 = \font "feta13"
-1 = \font "feta16"
0 = \font "feta20"
% slope damping: keep dy/dx < slur_slope_damping
slur_slope_damping = 0.3;
+slur_interstaff_slope_damping = 0.8;
% height damping: keep h/dx < slur_height_damping
-slur_height_damping = 0.5;
+slur_height_damping = 0.6;
+slur_interstaff_height_damping = 1.5;
% snap to stem if slur ends closer to stem than
slur_snap_to_stem = 1.5 * \interline;
+slur_interstaff_snap_to_stem = 2.5 * \interline;
+
tie_x_minimum = \slur_x_minimum;
% OSU: tie gap == slur gap
Begin3
Titel: LilyPond
-Versie: 1.1.57
-Inschrijf datum: 13JUL99
+Versie: 1.1.58
+Inschrijf datum: 14JUL99
Beschrijving: @FLAPTEKST@
Trefwoorden: muziek typezetten midi notatie
Auteur: hanwen@stack.nl (Han-Wen Nienhuys)
janneke@gnu.org (Jan Nieuwenhuizen)
Onderhouden door: hanwen@cs.ruu.nl (Han-Wen Nienhuys)
Voornaamste plek: sunsite.unc.edu /pub/Linux/apps
- 770k lilypond-1.1.57.tar.gz
+ 770k lilypond-1.1.58.tar.gz
Oorspronkelijke plek: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
- 770k lilypond-1.1.57.tar.gz
+ 770k lilypond-1.1.58.tar.gz
Copi-eer voorwaarden: GPL
End
Begin3
Title: LilyPond
-Version: 1.1.57
-Entered-date: 13JUL99
+Version: 1.1.58
+Entered-date: 14JUL99
Description:
LilyPond is the GNU Project music typesetter. It transforms a musical
janneke@gnu.org (Jan Nieuwenhuizen)
Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert
- 770k lilypond-1.1.57.tar.gz
+ 770k lilypond-1.1.58.tar.gz
Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
- 770k lilypond-1.1.57.tar.gz
+ 770k lilypond-1.1.58.tar.gz
Copying-policy: GPL
End
Name: lilypond
-Version: 1.1.57
+Version: 1.1.58
Release: 1
Copyright: GPL
Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.1.57.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.1.58.tar.gz
Summary: A program for printing sheet music.
URL: http://www.cs.uu.nl/~hanwen/lilypond
Packager: Han-Wen Nienhuys <hanwen@cs.uu.nl>