\clef baritone; c'4_"\kern -10mm baritone"
\clef varbaritone; c'4^"\kern -10mm varbaritone"
\clef tenor; c'4_"\kern -10mm tenor"
- \clef "G_8"; c'4^"\kern -6mm G\_8" }
+% \clef "G_8"; c'4^"\kern -6mm G\_8" %%% BROKEN!
+ }
\paper{ linewidth= 4.5 \in; }
}
)
}
)
-COMMENT(Broken!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!)
+dit(code(restStyle)) Change the layout of rests shorter than quarter notes.
+Currently, the standard layout code(restStyle="") and mensural notation
+code(restStyle="mensural") are available.
+dit(code(clefStyle)) Determines how clefs are typeset. When set to
+code(transparent), the clefs are not printed at all, when set to
+code(fullSizeChanges), clef changes in the middle of a line are
+typeset with a full size clef. By default, clef changes are typeset in
+smaller size.
)
-
-
subsubsubsect(GrandStaff properties)
description(
+pl 37.script2
+ - bf: AFM for BlueSky AFM files.
+ - \penalty = 4278 -> \penalty 4278
+ - URG!! fixed major (unnoticed) bug in dependency engine
+ - Further Script hacking:
+ * G_script_column
+ * G_script_column_engraver
+
+ pl 37.script1
+ - major Script rehack:
+ * G_stem_staff_side_item
+ * G_script
+ * G_script_engraver
+ * G_script_req
+ - junked Text_def, changed \property textstyle -> \property textStyle
+(todo -> convert-mudela)
+ - Line_of_score is an Axis_group_element, no more overlapping
+lines, hopefully.
+ - mf: whole diamond head tweak
+
+pl 37.mb2
+ - Added property clefStyle: "" / "transparent" / "fullSizeChanges"
+ - New example: input/test/incipit.ly
+ - Documented clefStyle and restStyle in refman.tex
+ - Partial bug fix: octaviated clefs. Still broken!!!
- - diamond heads (probably really ugly).
- - cross head.
- - tweaked harmonic head a bit.
- - property noteHeadStyle
+
+pl 37.mb1
+ - Added property restStyle.
+ - mensural 4th, 8th and 16th rests.
+pl 37.uu1
+ - FreeBSD bf
+
+****
+pl 37 (march 30, 1999)
+ - note head styles, see input/test/noteheadstyle.fly
+ * \property noteHeadStyle:
+ * diamond note heads (probably really ugly)
+ * cross note head.
+ * harmonic head (mf sources were tweaked)
+ * transparent for no \heads
+ * \property noteHeadStyle ="" for normal heads.
pl 36.mb2
- bf: timeSignatureStyle
- debian fixes.
- don't insert extra alignment space for empty stuff.
- Align_element derives from Axis_group_element
+ - junk cruft for detecting upbeam / downbeam.
- junk all *{horizontal,vertical}* Score_element derived classes.
- G_staff_side_item::padding_f_ now generic property.
- some tweaking of beam & stem.
- junk pointerlist in Sources
- - junk Stem::mult_i_, Stem::beam_gap_i_, G_staff_side_item::padding
+ - junk Stem::mult_i_, Stem::beam_gap_i_, G_staff_side_item::padding,
Bar::at_line_start_b_, Key_item::c_position_, Note_head::type_str_,
Note_head::staff_size, Stem::xdir_
NO_AXES=2,
};
-#ifndef STANDALONE
#include "string.hh" // ugh
String axis_name_str (Axis);
-#endif // STANDALONE
/**
the operator ++ for Axis.
\toeter_ii
>
-zager = \type Staff = zager \notes \relative c {
+zager = \type Staff = zager \notes \relative c'' {
\clef bass;
\property Staff.instrument = "Zager"
\property Staff.instr = "Zag."
f e d c
}
-zoger = \type Staff = zoger \notes \relative c {
+zoger = \type Staff = zoger \notes \relative c'' {
\clef bass;
\property Staff.instrument = "Zoger"
\property Staff.instr = "Zog."
>
\paper{
linewidth = 40.0\mm;
- \translator { \HaraKiriStaffContext }
+% \translator { \HaraKiriStaffContext }
%uh?
% \translator { \OrchestralScoreContext }
% \translator { \OrchestralPartStaffContext }
--- /dev/null
+%{
+ Test of how to make an ``incipit'' to indicate scordatora
+ tuning of a violin part, using the clefStyle property.
+ The two first bars of Biber's Rosary sonata III.
+
+ /Mats B
+%}
+
+\version "1.0.14";
+
+incipit = \notes\relative c'{
+ <b1 fis' b d>
+}
+
+violin = \notes\relative c''{
+ \specialkey \keysignature f' fis'' g' gis'';
+ \time 2/2;
+
+ a4. b8 c4 fis |
+ gis~ gis8 fis16^\trill ()e b8 c \type Staff<{\voiceone a d}{\voicetwo es,4}>|
+}
+
+\score{
+ \notes{
+ \property Staff.clefStyle = "transparent"
+ \incipit
+ \property Staff.clefStyle = "fullSizeChanges" \clef "treble"; \bar "";
+ \violin
+ }
+ \paper{
+ \translator{\StaffContext
+ timeSignatureStyle = "C";
+ }
+ }
+}
+
--- /dev/null
+%c''4^|^.^"foo"^"klap"
+c''4^|^.^"foo"^"klap"^"puk"^\fermata^\stopped
+c4_|_._"foo"_"klap"_"puk"_\fermata_\stopped
String c = strip_leading_white (a[i]);
Array<String> b = String_convert::split_arr (c, ' ');
+ if (!b.size ())
+ continue;
if (b[0] == "C")
char_metric.C_ = b[1].value_i ();
else if (b[0] == "WX")
Adobe_font_char_metric afm_char =read_char_metric (s, size);
char_metrics_.push (afm_char);
int i = char_metrics_.size ()-1;
- ascii_to_metric_idx_ [afm_char.C_] = i;
+
+ // TFM files uses neg. charcodes to store Space
+ if (afm_char.C_ >= 0)
+ ascii_to_metric_idx_ [afm_char.C_] = i;
name_to_metric_dict_ [afm_char.N_] = i;
}
}
/*
- axis-align-item.cc -- implement
+ axis-align-item.cc -- implement Axis_align_item
source file of the GNU LilyPond music typesetter
Axis_align_item::Axis_align_item ()
{
}
+
+void
+Axis_align_item::do_print () const
+{
+ Axis_group_item::do_print ();
+}
item_l->find_prebroken_piece (my_line);
add_element (broken_item_l);
}
- remove_element (elems[i]);
+
+ Spanner *spanner_l = dynamic_cast<Spanner*> (elems[i]);
+ if (spanner_l)
+ {
+ Spanner *broken_spanner_l =
+ spanner_l->find_broken_piece (my_line);
+ add_element (broken_spanner_l);
+ }
+ remove_element (elems[i]);
}
+
}
}
void
Axis_group_spanner::do_break_processing()
{
- DOUT << "do_break_processing ()\n";
+
bool breaking_self_b = ! Spanner::line_l();
if (!breaking_self_b)
{
{
Clef_item *c= new Clef_item;
c->set_elt_property (break_priority_scm_sym, gh_int2scm (-2)); // ugh
+ String clefstyle = get_property ("clefStyle", 0);
+ if (clefstyle.length_i ())
+ c->set_elt_property (style_scm_sym,
+ gh_str02scm (clefstyle.ch_C()));
+
announce_element (Score_element_info (c, clef_req_l_));
clef_p_ = c;
}
Clef_item::do_pre_processing()
{
dim_cache_[Y_AXIS].translate (y_position_i_ * staff_line_leading_f () / 2.0);
- if (break_status_dir() != RIGHT)
- {
- symbol_ += "_change";
- }
+ SCM style_sym =get_elt_property (style_scm_sym);
+ String style;
+ if (style_sym != SCM_BOOL_F)
+ style = ly_scm2string (SCM_CDR(style_sym));
+
+ if (break_status_dir() != RIGHT && style != "fullSizeChanges")
+ symbol_ += "_change";
+ if (style == "transparent")
+ set_elt_property (transparent_scm_sym, SCM_BOOL_T);
}
/*
SCM octave_dir = remove_elt_property (octave_dir_scm_sym);
if (octave_dir != SCM_BOOL_F)
{
- Direction d = Direction (gh_int2scm (SCM_CDR(octave_dir)));
+ Direction d = Direction (gh_scm2int (SCM_CDR(octave_dir)));
g = new G_text_item;
pscore_l_->typeset_element (g);
void
Collision::add_column (Note_column* ncol_l)
{
- // ugh. Fixme.
clash_l_arr_.push (ncol_l);
add_element (ncol_l);
add_dependency (ncol_l);
assert (abs (dir) == 1);
int j = dir > 0 ? 0 : 3;
if (h_shift_b)
- j += dir;
+ j += dir;
return j;
}
Collision::do_pre_processing()
{
if (clash_l_arr_.size() <= 1)
- return;
+ return;
/*
[stem up, stem up shifted, stem down shifted, stem down]
- */
+ */
Array<Note_column*> clash_group_arr_a[4];
for (int i=0; i < clash_l_arr_.size(); i++)
{
Note_column* c_l = clash_l_arr_[i];
- if (! c_l->dir_)
+ Direction d = c_l->dir ();
+ if (!d)
{
warning (_ ("No stem direction set. Ignoring column in clash."));
continue;
}
- int d = (c_l->dir_);
SCM shift = c_l->remove_elt_property (horizontal_shift_scm_sym);
bool shift_b = (shift != SCM_BOOL_F);
x_off[idx (d, true)] = d *1.0 ;
} while ((d *= -1) != 1);
+
if (!middle.empty_b()
&& middle.length() < 2 && col_l_a[idx (1,0)] && col_l_a[idx (-1,0)]) {
// reproduction of bugfix at 3am ?
{
if (col_l_a[j])
{
- /* collision.cc:138: request for method `translate' is ambiguous
-
- (shaddup)
- */
Offset o (x_off[j] * wid_f, 0);
col_l_a[j]->translate (o);
- // ((Score_element*)col_l_a[j])->translate (o);
}
}
}
#include "debug.hh"
#include "musical-request.hh"
-void
-Command_script_req::do_print() const
-{}
-Command_script_req::Command_script_req(){}
-Command_script_req::~Command_script_req(){}
-
-
-
-
-
-
void
Cadenza_req::do_print() const
{
void
Bar_req::do_print() const
{
+#ifndef NPRINT
DOUT << type_str_;
+#endif
}
-void
-Bracket_req::do_print () const
-{
- Span_req::do_print ();
-}
Bar_req::Bar_req (String s)
{
-
-void
-Timing_req::do_print() const{}
-
-
-
-
-void
-Command_req::do_print() const{}
-
-
-
-void
-Barcheck_req::do_print() const{}
-
bool
Barcheck_req::do_equal_b (Request*r) const
{
return b;
}
-
-
-
void
Clef_change_req::do_print() const
{
clef_str_ = s;
}
-
-
-
-
-
void
Partial_measure_req::do_print() const
{
return t&& t->dur_.length_mom ()== dur_.length_mom () && metronome_i_ == t->metronome_i_;
}
-
-
-
-
-
void
Measure_grouping_req::do_print() const
{
penalty_i_ = 0;
}
-void
-Break_req::do_print () const
-{
-}
-
-
-
Mark_req::Mark_req (String s)
{
str_ = s;
#include "direction.hh"
-#if 0
-String direction_str (Direction d, Axis a)
+String
+direction_str (Direction d, Axis a)
{
String s("center");
if (a == Y_AXIS)
}
return s;
}
-#endif
text_p_->style_str_ = prop.length_i () ? prop : "dynamic";
staff_side_p_ = new G_staff_side_item;
+ staff_side_p_->set_elt_property (script_priority_scm_sym,
+ gh_int2scm (100));
+
staff_side_p_->set_victim (text_p_);
staff_side_p_->axis_ = Y_AXIS;
#include "musical-request.hh"
#include "extender-engraver.hh"
#include "extender-spanner.hh"
-#include "text-def.hh"
#include "score-column.hh"
#include "g-text-item.hh"
--- /dev/null
+/*
+ g-script-column-engraver.cc -- implement G_script_column_engraver
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#include "engraver.hh"
+#include "g-script-column.hh"
+#include "g-staff-side.hh"
+
+/**
+ Find potentially colliding scripts, and put them in a
+ G_script_column, that will fix the collisions. */
+class G_script_column_engraver : public Engraver
+{
+ G_script_column *scol_p_;
+ Link_array<Item> script_l_arr_;
+ Link_array<G_staff_side_item> staff_side_l_arr_;
+public:
+ G_script_column_engraver ();
+ VIRTUAL_COPY_CONS(Translator);
+protected:
+ virtual void acknowledge_element (Score_element_info);
+ virtual void process_acknowledged ();
+ virtual void do_pre_move_processing ();
+ virtual void do_post_move_processing ();
+};
+
+
+G_script_column_engraver::G_script_column_engraver()
+{
+ scol_p_ =0;
+}
+
+void
+G_script_column_engraver::do_pre_move_processing ()
+{
+ if (scol_p_)
+ {
+ typeset_element (scol_p_);
+ scol_p_ =0;
+ }
+}
+
+void
+G_script_column_engraver::do_post_move_processing ()
+{
+ script_l_arr_.clear ();
+ staff_side_l_arr_.clear ();
+}
+
+void
+G_script_column_engraver::acknowledge_element( Score_element_info inf)
+{
+ Item *thing = dynamic_cast<Item*>(inf.elem_l_);
+ if (!thing)
+ return;
+
+ Dimension_cache * parcache = thing->dim_cache_[Y_AXIS].parent_l_;
+ if (!parcache || !thing)
+ return ;
+
+ Graphical_element *parent = parcache->element_l ();
+
+ if (G_staff_side_item * ss = dynamic_cast<G_staff_side_item*>(parent))
+ {
+ if (!ss->breakable_b ())
+ {
+ script_l_arr_.push (thing);
+ }
+ }
+}
+
+void
+G_script_column_engraver::process_acknowledged ()
+{
+ if (!scol_p_ && script_l_arr_.size () > 1)
+ {
+ scol_p_ = new G_script_column;
+ announce_element (Score_element_info (scol_p_, 0));
+ }
+
+ if (scol_p_)
+ {
+ for (int i=0; i < script_l_arr_.size (); i++)
+ scol_p_->add_staff_sided (script_l_arr_[i]);
+ script_l_arr_.clear ();
+ }
+}
+ADD_THIS_TRANSLATOR(G_script_column_engraver);
--- /dev/null
+/*
+ g-script-column.cc -- implement G_script_column
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+#include "g-script-column.hh"
+#include "g-staff-side.hh"
+
+static G_staff_side_item *
+get_g_staff_side (Item *i)
+{
+ Graphical_element *e1 = i->dim_cache_[Y_AXIS].parent_l_->element_l ();
+
+ return dynamic_cast<G_staff_side_item*>(e1);
+}
+
+void
+G_script_column::add_staff_sided (Item *i)
+{
+ SCM p = get_g_staff_side (i)->get_elt_property (script_priority_scm_sym);
+ if (p == SCM_BOOL_F)
+ return;
+
+ staff_sided_item_l_arr_.push (i);
+ add_dependency (i);
+}
+
+static int
+staff_side_compare (Item * const &i1,
+ Item * const &i2)
+{
+ Score_element *e1 = get_g_staff_side (i1);
+ Score_element *e2 = get_g_staff_side (i2);
+
+ SCM p1 = e1->get_elt_property (script_priority_scm_sym);
+ SCM p2 = e2->get_elt_property (script_priority_scm_sym);
+
+ return gh_scm2int (SCM_CDR(p1)) - gh_scm2int (SCM_CDR(p2));
+}
+
+void
+G_script_column::do_pre_processing ()
+{
+ Drul_array<Link_array<Item> > arrs;
+
+ for (int i=0; i < staff_sided_item_l_arr_.size (); i++)
+ {
+ G_staff_side_item * ip = get_g_staff_side (staff_sided_item_l_arr_[i]);
+ arrs[ip->dir_].push (staff_sided_item_l_arr_[i]);
+ }
+
+ Direction d = DOWN;
+ do {
+ Link_array<Item> &arr(arrs[d]);
+
+ arr.sort (staff_side_compare);
+
+ Item * last = 0;
+ for (int i=0; i < arr.size (); i++)
+ {
+ G_staff_side_item * gs = get_g_staff_side (arr[i]);
+ if (last)
+ {
+ gs->add_support (last);
+ gs->add_support (get_g_staff_side (last));
+ }
+
+ gs->remove_elt_property (script_priority_scm_sym);
+ last = arr[i];
+ }
+
+ } while (flip (&d) != DOWN);
+}
--- /dev/null
+/*
+ script-engraver.cc -- implement G_script_engraver
+
+ (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+#include "g-script-engraver.hh"
+#include "g-script.hh"
+#include "g-stem-staff-side.hh"
+#include "musical-request.hh"
+#include "stem.hh"
+#include "staff-symbol.hh"
+#include "rhythmic-head.hh"
+
+G_script_engraver::G_script_engraver()
+{
+ do_post_move_processing();
+}
+
+bool
+G_script_engraver::do_try_music (Music *r_l)
+{
+ if (Articulation_req *mr = dynamic_cast <Articulation_req *> (r_l))
+ {
+ for (int i=0; i < script_req_l_arr_.size(); i++)
+ {
+ if (script_req_l_arr_[i]->equal_b (mr))
+ return true;
+ }
+ script_req_l_arr_.push (mr);
+ return true;
+ }
+ return false;
+}
+
+void
+G_script_engraver::do_process_requests()
+{
+ for (int i=0; i < script_req_l_arr_.size(); i++)
+ {
+ Articulation_req* l=script_req_l_arr_[i];
+
+
+ SCM list = gh_eval_str (("(articulation-to-scriptdef \"" + l->articulation_str_ + "\")").ch_C());
+
+ if (list == SCM_BOOL_F)
+ {
+ l->warning(_f("don't know how to interpret articulation `%s'\n",
+ l->articulation_str_.ch_C()));
+ continue;
+ }
+ G_script *p =new G_script;
+ G_stem_staff_side_item * ss =new G_stem_staff_side_item;
+ list = SCM_CDR (list);
+
+ p->indices_drul_[LEFT] = ly_scm2string(SCM_CAAR (list));
+ p->indices_drul_[RIGHT] = ly_scm2string(SCM_CDAR (list));
+ list = SCM_CDR(list);
+ bool follow_staff = gh_scm2bool (SCM_CAR(list));
+ list = SCM_CDR(list);
+ int relative_stem_dir = gh_scm2int (SCM_CAR(list));
+ list = SCM_CDR(list);
+ int force_dir =gh_scm2int (SCM_CAR(list));
+ list = SCM_CDR(list);
+ SCM priority = SCM_CAR(list);
+
+ if (relative_stem_dir)
+ ss->relative_dir_ = relative_stem_dir;
+ else
+ ss->dir_ = force_dir;
+
+ if (l->dir_)
+ ss->dir_ = l->dir_;
+
+ ss->staff_support_b_ = !follow_staff;
+ p->set_staff_side (ss);
+ ss->set_elt_property (script_priority_scm_sym, priority);
+ ss->set_elt_property (padding_scm_sym, gh_double2scm(1.0));
+ script_p_arr_.push (p);
+ staff_side_p_arr_.push (ss);
+
+ announce_element (Score_element_info (p, l));
+ announce_element (Score_element_info (ss, l));
+ }
+}
+
+void
+G_script_engraver::acknowledge_element (Score_element_info inf)
+{
+ if (Stem *s = dynamic_cast<Stem*>(inf.elem_l_))
+ {
+ for (int i=0; i < staff_side_p_arr_.size(); i++)
+ if (G_stem_staff_side_item * ss = dynamic_cast<G_stem_staff_side_item*>(staff_side_p_arr_[i]))
+ {
+ ss->set_stem (s);
+ ss->add_support (s);
+ }
+ }
+ else if (Rhythmic_head * rh = dynamic_cast<Rhythmic_head*>(inf.elem_l_))
+ {
+ for (int i=0; i < staff_side_p_arr_.size(); i++)
+ {
+ G_staff_side_item * ss = dynamic_cast<G_staff_side_item*>(staff_side_p_arr_[i]);
+
+ if (!ss->dim_cache_[X_AXIS].parent_l_)
+ {
+ ss->dim_cache_[X_AXIS].parent_l_ = &inf.elem_l_->dim_cache_[X_AXIS];
+ }
+ ss->add_support (rh);
+ }
+ }
+}
+
+void
+G_script_engraver::do_pre_move_processing()
+{
+ for (int i=0; i < script_p_arr_.size(); i++)
+ {
+ typeset_element (script_p_arr_[i]);
+ typeset_element (staff_side_p_arr_[i]);
+ }
+ script_p_arr_.clear();
+ staff_side_p_arr_.clear ();
+}
+
+void
+G_script_engraver::do_post_move_processing()
+{
+ script_req_l_arr_.clear();
+}
+
+
+
+ADD_THIS_TRANSLATOR(G_script_engraver);
+
--- /dev/null
+/*
+ g-script.cc -- implement G_script
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+/*
+
+ TODO: Quantisation support (staccato dots between stafflines)
+
+*/
+#include "debug.hh"
+#include "g-script.hh"
+#include "lookup.hh"
+#include "g-staff-side.hh"
+
+G_script::G_script ()
+{
+ staff_side_l_ =0;
+}
+
+void
+G_script::do_substitute_element_pointer (Score_element*o, Score_element*n)
+{
+ if (o == staff_side_l_)
+ staff_side_l_ = dynamic_cast<G_staff_side_item*>(n);
+}
+
+
+
+Molecule
+G_script::get_molecule(Direction d) const
+{
+ return lookup_l ()->afm_find ("scripts-" + indices_drul_[d]);
+}
+
+
+void
+G_script::do_pre_processing ()
+{
+ Graphical_element * e
+ = staff_side_l_->dim_cache_[X_AXIS].parent_l_->element_l();
+ translate_axis (e->extent (X_AXIS).center (), X_AXIS);
+}
+
+void
+G_script::do_post_processing ()
+{
+ Direction d = staff_side_l_->dir_;
+ Molecule m (get_molecule(d));
+ translate_axis (- m.dim_[Y_AXIS][Direction (-d)], Y_AXIS);
+}
+
+void
+G_script::set_staff_side (G_staff_side_item*g)
+{
+ staff_side_l_ = g;
+ add_dependency (g);
+ dim_cache_[Y_AXIS].parent_l_ = & g->dim_cache_[Y_AXIS];
+}
+
+Molecule*
+G_script::do_brew_molecule_p () const
+{
+ return new Molecule (get_molecule (staff_side_l_->dir_));
+}
+
+void
+G_script::do_print () const
+{
+ DOUT << "Indices: " << indices_drul_[LEFT] << ", " << indices_drul_[RIGHT];
+}
#include "g-staff-side.hh"
#include "staff-symbol.hh"
+#include "debug.hh"
G_staff_side_item::G_staff_side_item ()
{
dir_ = CENTER;
to_position_l_ = 0;
set_elt_property (transparent_scm_sym, SCM_BOOL_T);
-
+ staff_support_b_ = true;
axis_ = Y_AXIS;
}
+
void
G_staff_side_item::do_pre_processing ()
{
if (!dir_)
- set_default_direction ();
+ dir_ = get_default_direction ();
if (axis_ == X_AXIS)
position_self ();
}
-void
-G_staff_side_item::set_default_direction ()
+Direction
+G_staff_side_item::get_default_direction () const
{
- dir_ = DOWN;
+ return DOWN;
}
void
G_staff_side_item::position_self ()
{
+
Interval dim;
Dimension_cache *common = 0;
if (support_l_arr_.size ())
dim = Interval(0,0);
common = dim_cache_[axis_].parent_l_;
}
- Interval sym_dim = to_position_l_->extent (axis_);
+
+
+ Interval sym_dim
+ = to_position_l_
+ ? to_position_l_->extent (axis_)
+ : Interval(0,0);
+
Real off = dim_cache_[axis_].relative_coordinate (common);
- SCM pad = remove_elt_property (padding_scm_sym);
+ SCM pad = remove_elt_property (padding_scm_sym);
if (pad != SCM_BOOL_F)
{
- off -= gh_scm2double (SCM_CDR(pad)) * dir_;
+ off += gh_scm2double (SCM_CDR(pad)) * dir_;
}
- dim_cache_[axis_].set_offset (dim[dir_] - sym_dim[-dir_] - off);
+ dim_cache_[axis_].set_offset (dim[dir_] - sym_dim[-dir_] + off);
}
void
void
G_staff_side_item::do_add_processing ()
{
- if (axis_ == Y_AXIS && staff_symbol_l ())
+ if (staff_support_b_
+ && axis_ == Y_AXIS && staff_symbol_l ())
{
add_support (staff_symbol_l ());
}
}
+
+Interval
+G_staff_side_item::do_height () const
+{
+ Interval i;
+ if (to_position_l_)
+ return to_position_l_->extent (Y_AXIS);
+ return i;
+}
+
+Interval
+G_staff_side_item::do_width () const
+{
+ Interval i;
+ if (to_position_l_)
+ return to_position_l_->extent (X_AXIS);
+ return i;
+}
+void
+G_staff_side_item::do_print () const
+{
+#ifndef NPRINT
+ if (to_position_l_)
+ DOUT << "positioning " << to_position_l_->name();
+
+ DOUT << "axis == " << axis_name_str (axis_)
+ << ", dir == " << to_str (dir_ );
+#endif
+}
--- /dev/null
+/*
+ g-stem-staff-side.cc -- implement G_stem_staff_side
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#include "g-stem-staff-side.hh"
+#include "stem.hh"
+
+G_stem_staff_side_item::G_stem_staff_side_item ()
+{
+ stem_l_ =0;
+ relative_dir_ = CENTER;
+}
+
+void
+G_stem_staff_side_item::do_substitute_element_pointer (Score_element*o,
+ Score_element*n)
+{
+ if (o == stem_l_)
+ {
+ stem_l_ = dynamic_cast<Stem*> (n);
+ }
+}
+
+void
+G_stem_staff_side_item::set_stem (Stem*s)
+{
+ stem_l_ =s;
+ add_dependency (s);
+}
+
+
+Direction
+G_stem_staff_side_item::get_default_direction () const
+{
+ return relative_dir_ * stem_l_->dir_;
+}
+
+void
+G_stem_staff_side_item::do_pre_processing ()
+{
+ SCM p = remove_elt_property (padding_scm_sym);
+ if (p != SCM_BOOL_F && stem_l_)
+ {
+ p = SCM_CDR (p);
+ set_elt_property (padding_scm_sym,
+ gh_double2scm(stem_l_->staff_line_leading_f ()
+ * gh_scm2double (p)));
+ }
+ G_staff_side_item :: do_pre_processing ();
+}
*/
#include "g-text-item.hh"
-
+#include "debug.hh"
#include "molecule.hh"
#include "paper-def.hh"
#include "lookup.hh"
{
style_str_ = "roman";
}
+
+void
+G_text_item::do_print () const
+{
+ DOUT << "text= " << text_str_;
+}
#include "identifier.hh"
#include "my-lily-lexer.hh"
#include "debug.hh"
-#include "script-def.hh"
#include "request.hh"
#include "translator.hh"
#include "notename-table.hh"
-DEFAULT_PRINT(General_script_def);
DEFAULT_PRINT(Translator);
DEFAULT_PRINT(Music);
DEFAULT_PRINT(Request);
DUMMY_STR(Notename_table);
-DUMMY_STR(General_script_def);
DUMMY_STR(Translator);
DUMMY_STR(Music);
DUMMY_STR(Request);
IMPLEMENT_ID_CLASS(int);
IMPLEMENT_ID_CLASS(Real);
IMPLEMENT_ID_CLASS(String);
-IMPLEMENT_ID_CLASS(General_script_def);
IMPLEMENT_ID_CLASS(Music);
IMPLEMENT_ID_CLASS(Score);
IMPLEMENT_ID_CLASS(Request);
VIRTUAL_ACCESSOR(Music);
VIRTUAL_ACCESSOR(Request);
VIRTUAL_ACCESSOR(Translator);
-VIRTUAL_ACCESSOR(General_script_def);
DEFAULT_ACCESSOR(Notename_table);
DEFAULT_ACCESSOR(Duration);
DEFAULT_ACCESSOR(int);
public:
Axis_align_item ();
protected:
- virtual void do_print () const {}
+ virtual void do_print ()const;
+
};
#endif /* AXIS_ALIGN_ITEM_HH */
*/
-#ifndef SPAN_AXIS_GROUP_HH
-#define SPAN_AXIS_GROUP_HH
+#ifndef AXIS_GROUP_SPANNER_HH
+#define AXIS_GROUP_SPANNER_HH
#include "spanner.hh"
#include "axis-group-element.hh"
#ifndef CLEFITEM_HH
#define CLEFITEM_HH
#include "item.hh"
-#include "text-def.hh"
+
#include "direction.hh"
#include "pointer.hh"
#include "staff-symbol-referencer.hh"
#include "duration.hh"
#include "musical-pitch.hh"
-/** Request which are assumed to be "happening" before the
- musical requests. Not coupled to a note or rest. */
-class Command_req : public virtual Request {
-public:
- REQUESTMETHODS(Command_req);
-
-};
-
-
-class Break_req : public Command_req {
+class Break_req : public Request {
public:
enum { DISALLOW = -10000, FORCE = 10000 };
int penalty_i_;
Break_req ();
- REQUESTMETHODS (Break_req);
+protected:
+ VIRTUAL_COPY_CONS(Music);
};
-class Mark_req : public Command_req {
+class Mark_req : public Request {
public:
Mark_req (String);
String str_;
- REQUESTMETHODS (Mark_req);
-};
-
-class Command_script_req : public Command_req, public Script_req {
-public:
- // huh?
- Command_script_req();
- ~Command_script_req();
- REQUESTMETHODS(Command_script_req);
+protected:
+ virtual void do_print () const;
+ VIRTUAL_COPY_CONS(Music);
};
/** Baseclass for time_signature/partial req. It has to be handled by
Staff_{walker,column} baseclass. */
-class Timing_req : public Command_req {
+class Timing_req : public Request {
public:
- REQUESTMETHODS(Timing_req);
+ VIRTUAL_COPY_CONS(Music);
};
int metronome_i_;
Tempo_req();
- REQUESTMETHODS(Tempo_req);
+protected:
+ virtual void do_print () const;
+ VIRTUAL_COPY_CONS(Music);
bool do_equal_b (Request *) const;
};
Moment length_mom_;
Partial_measure_req (Moment);
- REQUESTMETHODS(Partial_measure_req);
+protected:
+ VIRTUAL_COPY_CONS(Music);
+ virtual void do_print () const;
bool do_equal_b (Request*) const;
};
*/
class Time_signature_change_req : public Timing_req {
public:
- int beats_i_, one_beat_i_;
+ int beats_i_;
+ int one_beat_i_;
Time_signature_change_req();
+protected:
+ virtual void do_print () const;
bool do_equal_b (Request*) const;
- REQUESTMETHODS(Time_signature_change_req);
+ VIRTUAL_COPY_CONS(Music);
};
/// toggle Cadenza mode
public:
/// turn on?
bool on_b_;
- bool do_equal_b (Request*) const;
Cadenza_req (bool);
- REQUESTMETHODS(Cadenza_req);
+protected:
+ virtual void do_print () const;
+
+ bool do_equal_b (Request*) const;
+ VIRTUAL_COPY_CONS(Music);
};
/// check if we're at start of a measure.
class Barcheck_req : public Timing_req {
public:
bool do_equal_b (Request *) const;
- REQUESTMETHODS(Barcheck_req);
+ VIRTUAL_COPY_CONS(Music);
};
class Measure_grouping_req : public Timing_req {
public:
Array<int> beat_i_arr_;
Array<Moment> elt_length_arr_;
+protected:
+ virtual void do_print () const;
bool do_equal_b (Request *) const;
- REQUESTMETHODS(Measure_grouping_req);
+ VIRTUAL_COPY_CONS(Music);
};
/** draw a (repeat)-bar. This something different than #Barcheck_req#,
the latter should only happen at the start of a measure. */
-class Bar_req : public Command_req {
+class Bar_req : public Request {
public:
String type_str_;
Bar_req (String);
+protected:
+ virtual void do_print () const;
bool do_equal_b (Request*) const;
- REQUESTMETHODS(Bar_req);
+ VIRTUAL_COPY_CONS(Music);
};
Routines for sharps and flats are separated,
so that caller may identify non-conventional keys.
*/
-class Key_change_req : public Command_req {
+class Key_change_req : public Request {
public:
Array<Musical_pitch> pitch_arr_;
int modality_i_;
bool ordinary_key_b_;
Key_change_req();
- REQUESTMETHODS(Key_change_req);
/// squash the octaves to 1
void squash_octaves();
/// return number of sharps in key
int sharps_i();
+ bool minor_b() const;
+protected:
+ VIRTUAL_COPY_CONS(Music);
void transpose (Musical_pitch d);
- bool minor_b() const;
+ virtual void do_print () const;
};
-class Clef_change_req : public Command_req {
+class Clef_change_req : public Request {
public:
String clef_str_;
Clef_change_req (String);
- REQUESTMETHODS(Clef_change_req);
+protected:
+ virtual void do_print () const;
+ VIRTUAL_COPY_CONS(Music);
};
-class Bracket_req : public Span_req, public Command_req {
+class Bracket_req : public Span_req {
public:
- REQUESTMETHODS(Bracket_req);
+ VIRTUAL_COPY_CONS(Music);
};
--- /dev/null
+/*
+ g-script-column.hh -- declare G_script_column
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#ifndef G_SCRIPT_COLUMN_HH
+#define G_SCRIPT_COLUMN_HH
+
+#include "item.hh"
+
+class G_script_column : public Item
+{
+ /**
+ Array of objects that are placed by staffsides
+ */
+ Link_array<Item> staff_sided_item_l_arr_;
+public:
+ void add_staff_sided (Item*);
+protected:
+ virtual void do_pre_processing ();
+};
+
+
+#endif /* G_SCRIPT_COLUMN_HH */
+
+
--- /dev/null
+/*
+ script-engraver.hh -- part of GNU LilyPond
+
+ (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+
+#ifndef G_SCRIPT_GRAV
+#define G_SCRIPT_GRAV
+
+#include "engraver.hh"
+
+
+class G_script_engraver : public Engraver {
+ Link_array<G_script> script_p_arr_;
+ Link_array<G_staff_side_item> staff_side_p_arr_;
+ Link_array<Articulation_req> script_req_l_arr_;
+
+public:
+ VIRTUAL_COPY_CONS(Translator);
+
+ G_script_engraver();
+protected:
+ virtual bool do_try_music (Music*);
+ virtual void do_process_requests ();
+ virtual void do_pre_move_processing ();
+ virtual void do_post_move_processing ();
+ virtual void acknowledge_element (Score_element_info);
+};
+
+#endif // G_SCRIPT_GRAV
--- /dev/null
+/*
+ g-script.hh -- declare G_script
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#ifndef G_STEM_SCRIPT_HH
+#define G_STEM_SCRIPT_HH
+
+#include "item.hh"
+#include "drul-array.hh"
+
+/**
+ articulation marks (and the like) that are attached to notes/stems.
+ Needs support from G_staff_side for proper operation.
+ */
+class G_script : public Item
+{
+ G_staff_side_item * staff_side_l_;
+
+ Molecule get_molecule (Direction d) const;
+public:
+ Drul_array<String> indices_drul_;
+ G_script ();
+ void set_staff_side (G_staff_side_item*);
+
+protected:
+virtual void do_print () const;
+ virtual void do_substitute_element_pointer (Score_element*o,
+ Score_element*n);
+ virtual void do_pre_processing ();
+ virtual void do_post_processing ();
+ Molecule* do_brew_molecule_p () const;
+};
+
+#endif /* G_STEM_SCRIPT_HH */
+
#include "item.hh"
#include "staff-symbol-referencer.hh"
+/**
+ Position myself next to a set of elements. Configurable in axis
+ and direction.
+
+ Properties:
+
+ padding :: Real
+
+ Amount of extra space to add.
+*/
class G_staff_side_item : public Item, public Staff_symbol_referencer
{
void position_self ();
+
public:
Score_element * to_position_l_;
Direction dir_;
Link_array<Score_element> support_l_arr_;
Axis axis_;
+ //junkme.
+ bool staff_support_b_;
G_staff_side_item ();
void set_victim (Score_element*);
void add_support (Score_element*);
- virtual void set_default_direction ();
VIRTUAL_COPY_CONS(Score_element);
+ virtual Direction get_default_direction () const;
protected:
+ virtual Interval do_height () const;
+ virtual Interval do_width () const;
+ virtual void do_print () const;
virtual void do_add_processing ();
virtual void do_substitute_element_pointer (Score_element*,Score_element*);
virtual void do_pre_processing ();
--- /dev/null
+/*
+ g-stem-staff-side.hh -- declare G_stem_staff_side
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#ifndef G_STEM_STAFF_SIDE_HH
+#define G_STEM_STAFF_SIDE_HH
+
+#include "g-staff-side.hh"
+/**
+ Position self, analogous to G_staff_side_item, but use Stem direction
+ for determining direction.
+
+ Properties:
+
+ padding :: Real
+
+ Padding in staffline leading
+
+ */
+class G_stem_staff_side_item : public G_staff_side_item
+{
+ Stem *stem_l_;
+public:
+ Direction relative_dir_;
+
+ void set_stem (Stem*);
+ G_stem_staff_side_item ();
+protected:
+ virtual Direction get_default_direction ()const;
+ virtual void do_pre_processing ();
+ virtual void do_substitute_element_pointer (Score_element*o,Score_element*e);
+};
+
+#endif /* G_STEM_STAFF_SIDE_HH */
+
#include "item.hh"
+/**
+ Print a text in specified style.
+ */
class G_text_item : public Item
{
public:
G_text_item ();
VIRTUAL_COPY_CONS (Score_element);
protected:
+ virtual void do_print () const;
virtual Molecule *do_brew_molecule_p () const;
};
class Notename_table_identifier;
class Translator_identifier;
class Music_identifier;
-class General_script_def_identifier;
+class Articulation_req_identifier;
class Symtables_identifier;
class Midi_def_identifier;
class Paper_def_identifier;
IDACCESSOR(Translator)
IDACCESSOR(Notename_table)
IDACCESSOR(Music)
- IDACCESSOR(General_script_def)
IDACCESSOR(Symtables)
IDACCESSOR(Midi_def)
IDACCESSOR(Paper_def)
struct Adobe_font_metric;
struct Adobe_font_char_metric;
struct All_font_metrics;
+struct Articulation_req;
struct Atom;
struct Audio_element;
struct Audio_column;
struct Engraver_group_engraver;
struct Extender;
struct Extender_req;
+struct G_script;
+struct G_script_req;
struct G_staff_side_item;
struct G_text_item;
struct General_script_def;
#define SCORELINE_HH
#include "colhpos.hh"
-#include "spanner.hh"
+#include "axis-group-spanner.hh"
#include "super-element.hh"
/// the columns of a score that form one line.
-class Line_of_score : public Spanner, public Super_element
+class Line_of_score : public Axis_group_spanner, public Super_element
{
-public:
Link_array<Paper_column> cols_;
+public:
+
Line_of_score();
- void add_element (Score_element *);
-
/// is #c# contained in #*this#?
bool contains_b (Paper_column const *c) const;
Link_array<Line_of_score> get_lines() const;
Line_of_score * set_breaking (Array<Column_x_positions> const&, int j) const;
+
+ void output_all ();
+ void add_column (Paper_column*);
+
protected:
+ virtual void do_substitute_element_pointer (Score_element*, Score_element*);
virtual Link_array<Score_element> get_extra_dependencies () const;
- virtual Interval do_width() const;
virtual void do_print() const;
VIRTUAL_COPY_CONS(Score_element);
};
Molecule flag (int, Direction) const;
Molecule hairpin (Real width, bool decresc, bool continued) const;
Molecule plet (Real dy, Real dx, Direction dir) const;
- Molecule rest (int, bool outside) const;
+ Molecule rest (int, bool outside, String) const;
Molecule rule_symbol (Real height, Real width) const;
- Molecule script (String idx) const;
+
Molecule stem (Real y1_pos, Real y2_pos) const;
Molecule slur (Array<Offset> controls) const;
Molecule streepje (int type) const;
DECLARE_LY_SYMBOL(placebox);
DECLARE_LY_SYMBOL(rulesym);
DECLARE_LY_SYMBOL(rulethickness);
+DECLARE_LY_SYMBOL(script_priority);
DECLARE_LY_SYMBOL(staffheight);
DECLARE_LY_SYMBOL(style);
DECLARE_LY_SYMBOL(text);
#include "duration.hh"
#include "musical-pitch.hh"
-/**
- A request which is coupled to a note (that has duration).
- Base class only
- */
-class Musical_req : public virtual Request {
-public:
-
-
- REQUESTMETHODS(Musical_req);
-};
-
-
/** a request with a duration.
This request is used only used as a base class.
*/
-class Rhythmic_req : public virtual Musical_req {
+class Rhythmic_req : public virtual Request {
public:
Duration duration_;
-
+ virtual void do_print () const;
+
+
bool do_equal_b (Request*) const;
void compress (Moment);
virtual Moment length_mom () const;
static int compare (Rhythmic_req const&,Rhythmic_req const&);
- REQUESTMETHODS(Rhythmic_req);
+ VIRTUAL_COPY_CONS(Music);
};
class Skip_req : public Rhythmic_req {
public:
- REQUESTMETHODS(Skip_req);
+ VIRTUAL_COPY_CONS(Music);
};
-struct Spacing_req :virtual Request {
- Moment next;
- Real distance;
- Real strength;
- Spacing_req();
- REQUESTMETHODS(Spacing_req);
-};
-struct Abbreviation_req : public Musical_req {
- REQUESTMETHODS (Abbreviation_req);
+struct Abbreviation_req : public Request {
+ VIRTUAL_COPY_CONS (Abbreviation_req);
Abbreviation_req ();
int type_i_;
+ virtual void do_print () const;
};
-class Blank_req : public Spacing_req, Rhythmic_req {
-public:
- REQUESTMETHODS(Spacing_req);
-};
/** a syllable or lyric is a string with rhythm.
*/
class Lyric_req : public Rhythmic_req {
public:
+ virtual void do_print () const;
String text_str_;
- REQUESTMETHODS(Lyric_req);
+ VIRTUAL_COPY_CONS(Music);
+};
+
+
+class Articulation_req : public G_script_req
+{
+public:
+ String articulation_str_;
+protected:
+ virtual bool do_equal_b (Request*) const;
+ virtual void do_print () const;
+ VIRTUAL_COPY_CONS(Music);
};
+class Text_script_req : public G_script_req {
+public:
+ String text_str_;
+
+ // should be generic property of some kind..
+ String style_str_;
+protected:
+ VIRTUAL_COPY_CONS(Music);
+ virtual void do_print () const;
+};
/// request which has some kind of pitch
-struct Melodic_req :virtual Musical_req
+struct Melodic_req :virtual Request
{
Musical_pitch pitch_;
+
+ static int compare (Melodic_req const&,Melodic_req const&);
+
+protected:
/// transpose. #delta# is relative to central c.
virtual void transpose (Musical_pitch delta);
- Melodic_req();
- bool do_equal_b (Request*) const;
- static int compare (Melodic_req const&,Melodic_req const&);
- REQUESTMETHODS(Melodic_req);
+ virtual bool do_equal_b (Request*) const;
+ virtual void do_print () const;
+ VIRTUAL_COPY_CONS(Music);
};
/// specify tonic of a chord
struct Tonic_req : public Melodic_req
{
- Tonic_req ();
- REQUESTMETHODS(Tonic_req);
+ VIRTUAL_COPY_CONS(Music);
};
/// Put a note of specified type, height, and with accidental on the staff.
/// Cautionary, i.e. parenthesized accidental.
bool cautionary_b_;
Note_req();
+protected:
+ virtual void do_print () const;
bool do_equal_b (Request*) const;
- REQUESTMETHODS(Note_req);
+ VIRTUAL_COPY_CONS(Music);
};
/**
*/
class Rest_req : public Rhythmic_req {
public:
- REQUESTMETHODS(Rest_req);
+ VIRTUAL_COPY_CONS(Music);
};
/**
*/
class Multi_measure_rest_req : public Rhythmic_req {
public:
- REQUESTMETHODS(Multi_measure_rest_req);
+ VIRTUAL_COPY_CONS(Music);
};
-class Musical_span_req : public Span_req, public virtual Musical_req
-{
-public:
- REQUESTMETHODS(Musical_span_req);
-
-};
-
/**
Start / stop an abbreviation beam at this note.
*/
-class Abbreviation_beam_req : public Musical_span_req {
+class Abbreviation_beam_req : public Span_req {
public:
- REQUESTMETHODS (Abbreviation_beam_req);
+ VIRTUAL_COPY_CONS(Abbreviation_beam_req);
Abbreviation_beam_req ();
/// a slur
-class Slur_req : public Musical_span_req {
+class Slur_req : public Span_req {
public:
- REQUESTMETHODS(Slur_req);
+ VIRTUAL_COPY_CONS(Music);
};
/// an extender line
class Extender_req : public Request {
public:
- REQUESTMETHODS(Extender_req);
- Extender_req ();
-};
+ VIRTUAL_COPY_CONS(Music);
-class Musical_script_req : public Musical_req, public Script_req {
-public:
- REQUESTMETHODS(Musical_script_req);
};
-class Dynamic_req : public virtual Musical_req {
+class Dynamic_req : public virtual Request {
public:
- REQUESTMETHODS(Dynamic_req);
+ VIRTUAL_COPY_CONS(Music);
};
-
+/*
+ merge with Articulation_req?
+ */
class Absolute_dynamic_req : public Dynamic_req {
public:
String loudness_str_;
- virtual bool do_equal_b (Request*) const;
- String loudness_str () const;
Absolute_dynamic_req();
- REQUESTMETHODS(Absolute_dynamic_req);
+
+protected:
+ virtual void do_print () const;
+ virtual bool do_equal_b (Request*) const;
+ VIRTUAL_COPY_CONS(Music);
};
-class Span_dynamic_req : public Dynamic_req, public Musical_span_req {
+class Span_dynamic_req : public Dynamic_req, public Span_req {
public:
- virtual bool do_equal_b (Request*) const;
+
/// Grow or shrink the volume: 1=cresc, -1 = decresc
Direction dynamic_dir_;
+
Span_dynamic_req();
- REQUESTMETHODS(Span_dynamic_req);
+protected:
+ virtual bool do_equal_b (Request*) const;
+ virtual void do_print () const;
+ VIRTUAL_COPY_CONS(Music);
};
#endif // MUSICALREQUESTS_HH
#define NOTE_COLUMN_HH
#include "item.hh"
-#include "script-column.hh"
+#include "axis-group-item.hh"
/** a struct for treating a group of noteheads (noteheads, stem
(chord) and scripts) as a single entity. */
-class Note_column : public Script_column {
+class Note_column : public Axis_group_item {
protected:
- virtual void do_pre_processing();
+
virtual void do_print () const;
virtual void do_substitute_element_pointer (Score_element*,Score_element*);
public:
JUNKME.v
*/
- Direction dir_;
+ Direction dir () const;
Stem* stem_l_;
-
Link_array<Note_head> head_l_arr_;
Link_array<Rest> rest_l_arr_;
// Interval width () const;
void translate_rests(int dy);
-
Note_column ();
void set_stem (Stem*);
void set_dotcol (Dot_column*);
void add_head (Rhythmic_head*);
bool rest_b () const;
- virtual void add_script (Script*s);
void sort ();
};
void output_molecule (Molecule const *, Offset, char const *);
void output_comment (String s);
void output_scheme (SCM scm);
- void start_line ();
+ void start_line (Real height);
void stop_line ();
void switch_to_font (String fontname);
*/
class Request : public Music {
-
public:
-
virtual ~Request(){}
-
-
VIRTUAL_COPY_CONS(Music);
-
bool equal_b (Request*) const;
protected:
virtual bool do_equal_b (Request*) const;
};
-#define REQUESTMETHODS(T) \
-\
-VIRTUAL_COPY_CONS(Request);\
-virtual void do_print() const
-
+class G_script_req : public virtual Request
+{
+public:
+ Direction dir_;
+ VIRTUAL_COPY_CONS(Music);
+};
/** Put a script above or below this ``note'' or bar. eg upbow, downbow. Why
a request? These symbols may conflict with slurs and brackets, so
this also a request */
-class Script_req : public virtual Request {
+class Script_req : public virtual G_script_req {
public:
- Direction dir_;
General_script_def *scriptdef_p_;
bool do_equal_b (Request*) const;
Script_req();
- REQUESTMETHODS(Script_req);
+ VIRTUAL_COPY_CONS(Music);
+ virtual void do_print () const;
~Script_req();
Script_req (Script_req const&);
};
public:
/// should the spanner start or stop, or is it unwanted?
Direction spantype_;
- bool do_equal_b (Request*) const;
- REQUESTMETHODS(Span_req);
Span_req();
+protected:
+ virtual bool do_equal_b (Request*) const;
+ virtual void do_print() const;
+ VIRTUAL_COPY_CONS(Music);
};
/**
*/
class Tie_req : public Request {
public:
- REQUESTMETHODS(Tie_req);
+ VIRTUAL_COPY_CONS(Music);
};
/** Start / stop a beam at this note */
class Beam_req : public Span_req {
public:
- REQUESTMETHODS(Beam_req);
+ VIRTUAL_COPY_CONS(Music);
};
#endif
#include "parray.hh"
class Rhythmic_column_engraver :public Engraver {
- Link_array<Script> script_l_arr_;
Link_array<Rhythmic_head> rhead_l_arr_;
Stem * stem_l_;
Note_column *ncol_p_;
class Score_element : public virtual Graphical_element {
Protected_scm element_property_alist_;
Link_array<Score_element> dependency_arr_;
+ /**
+ The lookup, determined by the font size. Cache this value.
+ */
Lookup * lookup_l_;
public:
Score_element *original_l_;
bool linked_b () const;
VIRTUAL_COPY_CONS(Score_element);
- // ugh: no protection. Denk na, Vrij Veilig
+ /**
+ Recursively track all dependencies of this Score_element. The
+ status_i_ field is used as a mark-field. It is marked with
+ #busy# during execution of this function, and marked with #final#
+ when finished.
+
+ #funcptr# is the function to call to update this element.
+ */
void calculate_dependencies (int final, int busy, Score_element_method_pointer funcptr);
protected:
Drul_array<int> beams_i_drul_;
+ void set_direction (Direction d);
/// direction stem (that's me)
Direction dir_;
/// heads that the stem encompasses (positions)
Interval_t<int> head_positions() const;
- virtual ~Stem ();
+
protected:
virtual void do_substitute_element_pointer (Score_element*,Score_element*);
virtual void do_pre_processing();
#include "score-element.hh"
/** The toplevel element. The Paper_score contains this element, and any
element shoud be a dependency for the super element.
+
+ It is the entry point for the "constraint solver"/ dependency
+ tracker. Every XXXX_processing () call traverses the entire
+ dependency graph, and calls the appropriate
+ Score_element::do_XXX_processing function on each Score_element it encounters.
+
+
*/
class Super_element : public virtual Score_element {
public:
- Super_element();
-
void space_processing ();
void pre_processing();
void breakable_col_processing();
void break_processing();
void post_processing();
void output_all ();
-
-protected:
-
};
#endif // Super_element_HH
#ifndef Tuplet_spanner_HH
#define Tuplet_spanner_HH
-#include "text-def.hh"
+
#include "pointer.hh"
#include "directional-spanner.hh"
void add_column (Note_column*);
void set_beam (Beam*);
- P<Text_def> tdef_p_;
+
+
+ String number_str_;
+ /*
+ junk us.
+ */
bool bracket_visibility_b_;
bool num_visibility_b_;
#ifndef VOLTA_SPANNER_HH
#define VOLTA_SPANNER_HH
-#include "text-def.hh"
+
#include "pointer.hh"
#include "spanner.hh"
void add_column (Note_column*);
void add_column (Bar*);
- P<Text_def> number_p_;
+ String number_str_;
Link_array<Bar> column_arr_;
Link_array<Note_column> note_column_arr_;
bool last_b_;
- bool visible_b_;
+
protected:
virtual Molecule* do_brew_molecule_p () const;
*/
#include "line-of-score.hh"
-#include "spanner.hh"
-
#include "paper-def.hh"
+#include "paper-outputter.hh"
#include "p-col.hh"
#include "p-score.hh"
+#include "warn.hh"
Line_of_score::Line_of_score()
{
-}
-
-void
-Line_of_score::add_element (Score_element*e)
-{
- // avoid excess dependencies.
- if (! (e->parent_l (X_AXIS) || e->parent_l (Y_AXIS)) )
- add_dependency (e);
+ set_axes (Y_AXIS,Y_AXIS);
}
bool
Line_of_score::set_breaking (Array<Column_x_positions> const &breaking, int j) const
{
const Link_array<Paper_column> &curline (breaking[j].cols);
-
const Array<Real> &config (breaking[j].config);
-
Line_of_score *line_l=0;
-
- if (breaking.size() >1)
- {
- line_l = dynamic_cast <Line_of_score*> (clone());
- }
- else
- line_l = (Line_of_score*)( this);
+
+ line_l = dynamic_cast <Line_of_score*> (clone());
line_l->cols_ = curline;
- /* Array<Paper_column*> &
- ((Array<Paper_column*> &)) = */
line_l->set_bounds(LEFT,curline[0]);
-
line_l->set_bounds(RIGHT,curline.top());
for (int i=0; i < curline.size(); i++)
curline[i]->line_l_ = dynamic_cast<Line_of_score*>(line_l);
}
+ Breaking_information b;
+ b.bounds_ = line_l->spanned_drul_;
+ b.broken_spanner_l_ = line_l;
+ b.line_l_ = line_l;
+
+ broken_info_.push (b);
+
return line_l;
}
-
-
+void
+Line_of_score::add_column (Paper_column*p)
+{
+ cols_.push (p);
+}
void
Line_of_score::do_print() const
{
Spanner::do_print();
-}
-
-Interval
-Line_of_score::do_width() const
-{
- return Spanner::do_width();
+ Axis_group_spanner::do_print ();
}
Link_array<Score_element>
Line_of_score::get_extra_dependencies () const
{
- Link_array<Score_element> r;
+ Link_array<Score_element> r (Axis_group_spanner::get_extra_dependencies ());
for (int i=0; i < cols_.size (); i++)
r.push (cols_[i]);
return r;
}
+void
+Line_of_score::do_substitute_element_pointer (Score_element*o, Score_element*n)
+{
+ if (Paper_column *p = dynamic_cast<Paper_column*>(o))
+ cols_.substitute (p, dynamic_cast<Paper_column*>(n));
+}
-
+void
+Line_of_score::output_all ()
+{
+ Interval i(extent(Y_AXIS));
+ if (i.empty_b())
+ warning ("Huh? Empty Line_of_score?");
+ else
+ translate_axis (- i[MAX], Y_AXIS);
+
+ pscore_l_->outputter_l_->start_line (i.length ());
+ Super_element::output_all ();
+ pscore_l_->outputter_l_->stop_line ();
+}
}
Molecule
-Lookup::rest (int j, bool o) const
+Lookup::rest (int j, bool o, String style) const
{
- return afm_find (String ("rests-") + to_str (j) + (o ? "o" : ""));
+ return afm_find (String ("rests-") + to_str (j) + (o ? "o" : "") + style);
}
Molecule
return m;
}
-Molecule
-Lookup::script (String str) const
-{
- return afm_find (String ("scripts-") + str);
-}
-
Molecule
Lookup::special_time_signature (String s, int n, int d) const
{
Lookup::text (String style, String text) const
{
Molecule m;
+ if (style.empty_b ())
+ style = "roman";
int font_mag = 1;
Real font_h = paper_l_->get_var ("font_normal");
font_mag = (int)paper_l_->get_var ("magnification_" + style);
}
+ /*
+ UGH.
+ */
SCM l = gh_eval_str (("(style-to-cmr \"" + style + "\")").ch_C());
if (l != SCM_BOOL_F)
{
*/
#include "lyric-performer.hh"
-#include "text-def.hh"
#include "musical-request.hh"
#include "audio-item.hh"
#include "bar.hh"
#include "lookup.hh"
#include "rest.hh"
-#include "script.hh"
-#include "text-def.hh"
#include "molecule.hh"
#include "misc.hh"
Molecule s;
if (measures_i_ == 1 || measures_i_ == 2 || measures_i_ == 4)
{
- s = (lookup_l ()->rest (- intlog2(measures_i_), 0));
+ s = (lookup_l ()->rest (- intlog2(measures_i_), 0, ""));
s.translate_axis (-s.extent ()[X_AXIS].length () / 2, X_AXIS);
}
else
{
- s = (lookup_l ()->rest (-4, 0));
+ s = (lookup_l ()->rest (-4, 0, ""));
}
mol_p->add_molecule (s);
Real interline_f = staff_line_leading_f ();
if (measures_i_ > 1)
{
- Text_def text;
- text.text_str_ = to_str (measures_i_);
- text.style_str_ = "number";
- text.align_dir_ = CENTER;
- Molecule s = text.get_molecule (paper_l (), UP);
+ Molecule s ( lookup_l ()->text ("number", to_str (measures_i_)));
+
s.translate_axis (3.0 * interline_f, Y_AXIS);
mol_p->add_molecule (s);
}
Music_output_def::print () const
{
#ifndef NPRINT
+ DOUT << "Translators: \n";
translator_p_dict_p_->print ();
+ DOUT << "Other definitions.\n";
scope_p_->print( );
#endif
}
#include "musical-request.hh"
#include "misc.hh"
#include "debug.hh"
-#include "script-def.hh"
-#include "text-def.hh"
-#include "music-list.hh"
-
-
-
-
-void
-Musical_req::do_print () const{}
-void
-Tie_req::do_print () const{}
-
-
-
-
-
-
-void
-Musical_span_req::do_print () const
-{
- Span_req::do_print ();
-}
-
+#include "music-list.hh"
void
Span_req::do_print () const
#endif
}
-
-
-Spacing_req::Spacing_req ()
-{
- next = 0;
- distance = 0;
- strength = 0;
-}
-
-void
-Spacing_req::do_print () const
-{
-#ifndef NPRINT
- DOUT << "next " << next << "dist " << distance << "strength\n";
-#endif
-}
-
-
-
Abbreviation_req::Abbreviation_req ()
{
type_i_ = 0;
-void
-Blank_req::do_print () const
-{
- Spacing_req::do_print ();
-}
-
-Melodic_req::Melodic_req ()
-{
-}
-
void
Melodic_req::transpose (Musical_pitch delta)
{
void
Melodic_req::do_print () const
{
-pitch_.print ();
+ pitch_.print ();
}
-Tonic_req::Tonic_req ()
-{
-}
-void
-Tonic_req::do_print () const
-{
-#ifndef NPRINT
- Melodic_req::do_print ();
-#endif
-}
int
Rhythmic_req::compare (Rhythmic_req const &r1, Rhythmic_req const &r2)
return rh && !compare (*this, *rh);
}
-
-
-
void
Rhythmic_req::do_print () const
{
#endif
}
-void
-Rest_req::do_print () const
-{
- Rhythmic_req::do_print ();
-}
-
-void
-Multi_measure_rest_req::do_print () const
-{
- Rhythmic_req::do_print ();
-}
-
-
-void
-Beam_req::do_print () const
-{
-}
Abbreviation_beam_req::Abbreviation_beam_req ()
{
type_i_ = 0;
}
-void
-Abbreviation_beam_req::do_print () const
-{
-}
-
-
-void
-Slur_req::do_print () const
-{
-}
-
-
-
-
-
-Extender_req::Extender_req ()
-{
-}
-
-void
-Extender_req::do_print () const
-{
-}
-
-
bool
Span_req::do_equal_b (Request*r) const
{
spantype_ = CENTER;
}
-Script_req::Script_req (Script_req const&s)
-{
- dir_ = s.dir_;
- scriptdef_p_ = s.scriptdef_p_ ? s.scriptdef_p_->clone () : 0;
-}
-
-/*
- don't check dirs?
-
- (d1.dir_ == d2.dir_)
- */
-bool
-Script_req::do_equal_b (Request*r) const
-{
- Script_req * s = dynamic_cast <Script_req *> (r);
- return s && scriptdef_p_->equal_b (*s->scriptdef_p_);
-}
-
-Script_req::Script_req ()
-{
- dir_ = CENTER;
- scriptdef_p_ = 0;
-}
-
-
-
-
-void
-Script_req::do_print () const
-{
-#ifndef NPRINT
- DOUT << " dir " << dir_;
- scriptdef_p_->print ();
-#endif
-}
-
-void
-Musical_script_req::do_print () const
-{
- Script_req::do_print ();
-}
-
-Script_req::~Script_req ()
-{
- delete scriptdef_p_;
-}
-
-void
-Skip_req::do_print () const
-{
-#ifndef NPRINT
- DOUT << "duration: " << length_mom ();
-#endif
-}
-
-void
-Dynamic_req::do_print () const
-{
- Musical_req::do_print ();
-}
void
Absolute_dynamic_req::do_print () const
#endif
}
+void
+Text_script_req::do_print () const
+{
+ DOUT << "text" << text_str_
+ << ", style = " << style_str_;
+}
+void
+Articulation_req::do_print () const
+{
+ DOUT << articulation_str_;
+}
+bool
+Articulation_req::do_equal_b (Request*r) const
+{
+ Articulation_req * a = dynamic_cast<Articulation_req*>(r);
+ return articulation_str_ == a->articulation_str_;
+}
return v;
}
-// junk me
-Simultaneous_music *
-My_lily_parser::get_note_element (Note_req *rq, Duration * duration_p)
-{
- Simultaneous_music*v = new Request_chord;
- v->set_spot (here_input ());
-
- v->add_music (rq);
-
- rq->duration_ = *duration_p;
- rq->set_spot (here_input ());
- delete duration_p ;
- return v;
-}
Input
*/
#include "dot-column.hh"
#include "note-column.hh"
-#include "script.hh"
+
#include "note-head.hh"
#include "stem.hh"
#include "rest.hh"
Note_column::Note_column()
{
+ set_axes (X_AXIS,X_AXIS);
stem_l_ = 0;
- dir_ =CENTER;
}
void
return iv;
}
-void
-Note_column::do_pre_processing()
+Direction
+Note_column::dir () const
{
- if (!dir_)
- {
- if (stem_l_)
- dir_ = stem_l_->dir_;
- else if (head_l_arr_.size ())
- {
- // assert (false); // looks obsolete?
- dir_ = sign (head_positions_interval().center ());
- }
- }
- Script_column::do_pre_processing();
+ if (stem_l_)
+ return stem_l_->dir_;
+ else if (head_l_arr_.size ())
+ return sign (head_positions_interval().center ());
+
+ assert (false);
+ return CENTER;
}
-
void
Note_column::set_stem (Stem * stem_l)
{
- add_support (stem_l);
stem_l_ = stem_l;
- /*
- don't add stem to support; mostly invisible for rest-columns (and possibly taken . .)
- */
- Score_element::add_dependency (stem_l);
- for (int i=0; i < script_l_arr_.size(); i++)
- script_l_arr_[i]->set_stem (stem_l);
+ add_dependency (stem_l);
+ add_element (stem_l);
}
-void
-Note_column::add_script (Script *script_l)
-{
- Script_column::add_script (script_l) ;
- if (stem_l_)
- script_l->set_stem (stem_l_);
-}
void
Note_column::do_substitute_element_pointer (Score_element*o, Score_element*n)
head_l_arr_.substitute (dynamic_cast<Note_head *> (o),
(n)? dynamic_cast<Note_head *> (n) : 0);
}
- Script_column::do_substitute_element_pointer (o,n);
+
if (dynamic_cast<Rest *> (o))
{
rest_l_arr_.substitute (dynamic_cast<Rest *> (o),
if (Rest*r=dynamic_cast<Rest *> (h))
{
rest_l_arr_.push (r);
- add_support (r);
}
if (Note_head *nh=dynamic_cast<Note_head *> (h))
{
head_l_arr_.push (nh);
- add_support (nh);
}
+ add_element (h);
}
/**
*mlog << elem_p_arr_.size () + span_p_arr_.size () << " elements. ";
*mlog << "\nLine ... ";
+ line_l_->break_processing ();
for (int i=0; i < lines.size (); i++)
{
*mlog << '[' << flush;
Line_of_score *line_l = lines[i];
- line_l->break_processing ();
+
line_l->post_processing ();
*mlog << i << flush;
line_l->output_all ();
}
void
-Paper_outputter::start_line ()
+Paper_outputter::start_line (Real height)
{
- SCM scm = gh_list (ly_symbol ("start-line"), SCM_UNDEFINED);
+ SCM scm = gh_list (ly_symbol ("start-line"),
+ gh_double2scm (height),
+ SCM_UNDEFINED);
output_scheme (scm);
}
#include "notename-table.hh"
#include "scalar.hh"
#include "translation-property.hh"
-#include "script-def.hh"
#include "lookup.hh"
#include "misc.hh"
#include "my-lily-lexer.hh"
#include "command-request.hh"
#include "musical-request.hh"
#include "my-lily-parser.hh"
-#include "text-def.hh"
+
#include "translator-group.hh"
#include "score.hh"
#include "music-list.hh"
Array<int> *intvec;
Notename_table *chordmodifiertab;
Duration *duration;
- General_script_def * script;
Identifier *id;
Music *music;
Music_list *music_list;
Musical_pitch * pitch;
Midi_def* midi;
Moment *moment;
- Note_req *notereq;
Notename_table *notenametab;
Paper_def *paper;
Real real;
Request * request;
Scalar *scalar;
- Simultaneous_music *chord;
+
String *string;
Tempo_req *tempo;
- Text_def * textdef;
Translator* trans;
char c;
- const char *consstr;
int i;
int ii[10];
}
/* escaped */
%token E_EXCLAMATION E_SMALLER E_BIGGER E_CHAR
-%type <i> dots
+%type <i> dots exclamations questions
%token <i> DIGIT
%token <pitch> NOTENAME_PITCH
%token <pitch> TONICNAME_PITCH
%token <id> IDENTIFIER
%token <id> NOTENAME_TABLE_IDENTIFIER
%token <id> MUSIC_IDENTIFIER
-%token <id> POST_REQUEST_IDENTIFIER
-%token <id> SCRIPT_IDENTIFIER
-%token <id> COMMAND_IDENTIFIER
+%token <id> REQUEST_IDENTIFIER
%token <id> REAL_IDENTIFIER
%token <id> STRING_IDENTIFIER
%token <id> TRANS_IDENTIFIER
%type <outputdef> output_def
%type <scope> mudela_header mudela_header_body
%type <request> open_request_parens close_request_parens open_request close_request
+%type <request> request_with_dir request_that_take_dir verbose_request
%type <i> sub_quotes sup_quotes
%type <music> simple_element request_chord command_element Simple_music Composite_music
%type <music> Alternative_music Repeated_music
%type <duration> entered_notemode_duration explicit_duration
%type <intvec> intastint_list int_list
%type <reqvec> pre_requests post_requests
-
+%type <request> gen_text_def
%type <pitch> explicit_musical_pitch steno_musical_pitch musical_pitch absolute_musical_pitch
%type <pitch> steno_tonic_pitch
-%type <notereq> steno_notepitch
+
%type <pitch_arr> pitch_list
%type <music> chord notemode_chord
%type <pitch_arr> chord_additions chord_subtractions chord_notes
%type <paper> paper_block paper_def_body
%type <real> real_expression real real_with_dimension
%type <request> abbrev_command_req
-%type <request> post_request structured_post_request
+%type <request> post_request
%type <request> command_req verbose_command_req
-%type <request> script_req dynamic_req extender_req
+%type <request> extender_req
%type <string> string
%type <score> score_block score_body
%type <intarr> shape_array
-%type <script> script_definition script_body mudela_script gen_script_def
-%type <textdef> text_def finger
+
%type <string> script_abbreviation
%type <trans> translator_spec_block translator_spec_body
%type <tempo> tempo_request
%type <notenametab> notenames_body notenames_block chordmodifiers_block
-%expect 7
+
%left '-' '+'
;
embedded_scm:
- SCMFILE STRING ';' {
+ SCMFILE STRING semicolon {
read_lily_scm_file (*$2);
delete $2;
}
- | SCM_T STRING ';' {
+ | SCM_T STRING semicolon {
gh_eval_str ($2->ch_l ());
delete $2;
};
check_version:
- VERSION STRING ';' {
+ VERSION STRING semicolon {
Mudela_version ver (*$2);
if (!((ver >= oldest_version) && (ver <= version))) {
if (THIS->ignore_version_b_) {
$$ = new Scope;
THIS->lexer_p_-> scope_l_arr_.push ($$);
}
- | mudela_header_body assignment ';' {
+ | mudela_header_body assignment semicolon {
}
;
}
| post_request {
- $$ = new Request_identifier ($1, POST_REQUEST_IDENTIFIER);
+ $$ = new Request_identifier ($1, REQUEST_IDENTIFIER);
}
| explicit_duration {
$$ = new Duration_identifier ($1, DURATION_IDENTIFIER);
| int {
$$ = new int_identifier (new int ($1), INT_IDENTIFIER);
}
- | script_definition {
- $$ = new General_script_def_identifier ($1, SCRIPT_IDENTIFIER);
-
- }
;
translator_spec_block:
$$ = $1->access_content_Translator (true);
$$-> set_spot (THIS->here_input ());
}
- | TYPE STRING ';' {
+ | TYPE STRING semicolon {
Translator* t = get_translator_l (*$2);
Translator_group * tg = dynamic_cast<Translator_group*> (t);
$$ = t;
delete $2;
}
- | translator_spec_body STRING '=' identifier_init ';' {
+ | translator_spec_body STRING '=' identifier_init semicolon {
Identifier* id = $4;
String_identifier *s = dynamic_cast<String_identifier*> (id);
Real_identifier *r= dynamic_cast<Real_identifier*>(id);
Translator_group * tr = dynamic_cast<Translator_group*>($$);
tr->set_property (*$2, str);
}
- | translator_spec_body NAME STRING ';' {
+ | translator_spec_body NAME STRING semicolon {
$$->type_str_ = *$3;
delete $3;
}
- | translator_spec_body CONSISTS STRING ';' {
+ | translator_spec_body CONSISTS STRING semicolon {
dynamic_cast<Translator_group*> ($$)-> set_element (*$3, true);
delete $3;
}
- | translator_spec_body ACCEPTS STRING ';' {
+ | translator_spec_body ACCEPTS STRING semicolon {
dynamic_cast<Translator_group*> ($$)-> set_acceptor (*$3, true);
delete $3;
}
- | translator_spec_body REMOVE STRING ';' {
+ | translator_spec_body REMOVE STRING semicolon {
dynamic_cast<Translator_group*> ($$)-> set_element (*$3, false);
delete $3;
}
}
;
+
optional_dot:
/* empty */
| '.'
delete $5;
$$->set_lookup ($2, l);
}
- | paper_def_body assignment ';' {
+ | paper_def_body assignment semicolon {
}
| paper_def_body translator_spec_block {
$$->assign_translator ($2);
}
- | paper_def_body SHAPE '=' shape_array ';' {
+ | paper_def_body SHAPE '=' shape_array semicolon {
$$->shape_int_a_ = *$4;
delete $4;
}
| midi_body translator_spec_block {
$$-> assign_translator ($2);
}
- | midi_body tempo_request ';' {
+ | midi_body tempo_request semicolon {
$$->set_tempo ($2->dur_.length_mom (), $2->metronome_i_);
delete $2;
}
| Composite_music
;
-Alternative_music: {
- Music_list* m = new Music_list;
- $$ = new Sequential_music (m);
- }
- | ALTERNATIVE Simultaneous_music {
+Alternative_music:
+ ALTERNATIVE Simultaneous_music {
$$ = $2;
}
| ALTERNATIVE Sequential_music {
command_req:
abbrev_command_req
- | verbose_command_req ';' { $$ = $1; }
+ | verbose_command_req semicolon { $$ = $1; }
;
abbrev_command_req:
| '|' {
$$ = new Barcheck_req;
}
- | COMMAND_IDENTIFIER {
- $$ = $1->access_content_Request (true);
- }
| '~' {
$$ = new Tie_req;
}
m->one_beat_i_=$4;
$$ = m;
}
- | PENALTY '=' int {
+ | PENALTY int {
Break_req * b = new Break_req;
- b->penalty_i_ = $3;
+ b->penalty_i_ = $2;
b-> set_spot (THIS->here_input ());
$$ = b;
}
$$ = key_p;
delete $2;
}
- | KEYSIGNATURE pitch_list {
+ | KEYSIGNATURE pitch_list {
Key_change_req *key_p= new Key_change_req;
key_p->pitch_arr_ = *$2;
key_p->ordinary_key_b_ = false;
$$ = key_p;
delete $2;
}
- | GROUPING intastint_list {
+ | GROUPING intastint_list {
Measure_grouping_req * mr_p = new Measure_grouping_req;
for (int i=0; i < $2->size();)
{
{
$$ = new Link_array<Request>;
}
- | post_requests structured_post_request {
+ | post_requests post_request {
$2->set_spot (THIS->here_input ());
$$->push ($2);
}
- | post_requests close_request {
- $$->push ($2);
- }
;
-structured_post_request:
- script_req
- | post_request
+post_request:
+ verbose_request
+ | request_with_dir
+ | close_request
;
-post_request:
- POST_REQUEST_IDENTIFIER {
+
+request_that_take_dir:
+ gen_text_def
+ | verbose_request
+ | script_abbreviation {
+ Identifier*i = THIS->lexer_p_->lookup_identifier ("dash-" + *$1);
+ Articulation_req *a = new Articulation_req;
+ a->articulation_str_ = *i->access_content_String (false);
+ delete $1;
+ $$ = a;
+ }
+ ;
+
+request_with_dir:
+ script_dir request_that_take_dir {
+ if (G_script_req * gs = dynamic_cast<G_script_req*> ($2))
+ gs->dir_ = $1;
+ else if ($1)
+ $2->warning ("Can't specify direction for this request");
+ $$ = $2;
+ }
+ ;
+
+verbose_request:
+ REQUEST_IDENTIFIER {
$$ = (Request*)$1->access_content_Request (true);
+ $$->set_spot (THIS->here_input ());
}
- | dynamic_req {
- $$ = $1;
+ | ABSDYNAMIC '{' STRING '}' {
+ Absolute_dynamic_req *ad_p = new Absolute_dynamic_req;
+ ad_p ->loudness_str_ = *$3;
+ ad_p->set_spot (THIS->here_input ());
+ delete $3;
+ $$ =ad_p;
+ }
+ | SPANDYNAMIC '{' int int '}' {
+ Span_dynamic_req * sp_p = new Span_dynamic_req;
+ sp_p-> dynamic_dir_ = Direction($3);
+ sp_p->spantype_ = Direction($4);
+ sp_p->set_spot (THIS->here_input ());
+ $$ = sp_p;
}
| abbrev_type {
Abbreviation_req* a = new Abbreviation_req;
+ a->set_spot (THIS->here_input ());
a->type_i_ = $1;
$$ = a;
}
-
+ | SCRIPT STRING {
+ Articulation_req * a = new Articulation_req;
+ a->articulation_str_ = *$2;
+ a->set_spot (THIS->here_input ());
+ $$ = a;
+ delete $2;
+ }
;
optional_modality:
| explicit_musical_pitch
;
-steno_notepitch:
- musical_pitch {
- $$ = new Note_req;
-
- $$->pitch_ = *$1;
- delete $1;
- }
- | steno_notepitch '!' {
- $$->forceacc_b_ = ! $$->forceacc_b_;
- }
- | steno_notepitch '?' {
- $$->forceacc_b_ = ! $$->forceacc_b_;
- $$->cautionary_b_ = ! $$->cautionary_b_;
- }
- ;
-
-
explicit_duration:
DURATION '{' int_list '}' {
$$ = new Duration;
}
;
-dynamic_req:
- ABSDYNAMIC '{' STRING '}' {
- Absolute_dynamic_req *ad_p = new Absolute_dynamic_req;
- ad_p ->loudness_str_ = *$3;
- delete $3;
- $$ =ad_p;
- }
- | SPANDYNAMIC '{' int int '}' {
- Span_dynamic_req * sp_p = new Span_dynamic_req;
- sp_p-> dynamic_dir_ = Direction($3);
- sp_p->spantype_ = Direction($4);
- $$ = sp_p;
- }
- ;
-
-
close_request:
close_request_parens {
$$ = $1;
}
;
-
-
-script_definition:
- SCRIPT '{' script_body '}' { $$ = $3; }
- ;
-
-script_body:
- STRING int int int int int {
- Script_def *s = new Script_def;
- s->set_from_input (*$1,$2, $3,$4,$5, $6);
- $$ = s;
- delete $1;
- }
- ;
-
-script_req:
- script_dir gen_script_def {
- Musical_script_req *m = new Musical_script_req;
- $$ = m;
- m->scriptdef_p_ = $2;
- m->set_spot (THIS->here_input ());
- if (!m->dir_)
- m->dir_ = (Direction)$1;
- }
- ;
-
-gen_script_def:
- text_def {
- $$ = $1;
- ((Text_def*) $$)->align_dir_ = LEFT; /* UGH */
- }
- | mudela_script {
- $$ = $1;
- $$-> set_spot (THIS->here_input ());
- }
- | finger {
- $$ = $1;
- ((Text_def*)$$)->align_dir_ = RIGHT; /* UGH */
- }
- ;
-
-text_def:
+gen_text_def:
string {
- Text_def *t = new Text_def;
+ Text_script_req *t = new Text_script_req;
$$ = t;
t->text_str_ = *$1;
delete $1;
$$->set_spot (THIS->here_input ());
}
- ;
-
-finger:
- DIGIT {
- Text_def* t = new Text_def;
+ | DIGIT {
+ Text_script_req* t = new Text_script_req;
$$ = t;
t->text_str_ = to_str ($1);
t->style_str_ = "finger";
script_abbreviation:
'^' {
- $$ = THIS->lexer_p_
- ->lookup_identifier ("dash-hat")->access_content_String (true)
-
+ $$ = new String ("hat");
}
| '+' {
- $$ = THIS->lexer_p_
- ->lookup_identifier ("dash-plus")->access_content_String (true)
- }
- | '-' {
- $$ = THIS->lexer_p_
- ->lookup_identifier ("dash-dash")->access_content_String (true)
- }
+ $$ = new String ("plus");
+ }
+ | '-' {
+ $$ = new String ("dash");
+ }
| '|' {
- $$ = THIS->lexer_p_
- ->lookup_identifier ("dash-bar")->access_content_String (true)
- }
+ $$ = new String ("bar");
+ }
| '>' {
- $$ = THIS->lexer_p_
- ->lookup_identifier ("dash-larger")->access_content_String (true)
- }
+ $$ = new String ("larger");
+ }
| '.' {
- $$ = THIS->lexer_p_
- ->lookup_identifier ("dash-dot")->access_content_String (true);
+ $$ = new String ("dot");
}
;
-mudela_script:
- SCRIPT_IDENTIFIER { $$ = $1->access_content_General_script_def (true); }
- | script_definition { $$ = $1; }
- | script_abbreviation {
- $$ = THIS->lexer_p_->lookup_identifier (*$1)->access_content_General_script_def (true);
- delete $1;
- }
- ;
script_dir:
'_' { $$ = DOWN; }
}
;
-dots:
- '.' { $$ = 1; }
- | dots '.' { $$ ++; }
- ;
-
entered_notemode_duration:
- /* */ {
+ dots {
$$ = new Duration (THIS->default_duration_);
- }
- | dots {
- $$ = new Duration (THIS->default_duration_);
- $$->dots_i_ = $1;
+ if ($1)
+ $$->dots_i_ = $1;
}
| steno_duration {
THIS->set_last_duration ($1);
;
-
simple_element:
- steno_notepitch notemode_duration {
+ musical_pitch exclamations questions notemode_duration {
if (!THIS->lexer_p_->note_state_b ())
THIS->parser_error (_ ("have to be in Note mode for notes"));
- $1->duration_ = *$2;
- $$ = THIS->get_note_element ($1, $2);
+
+
+ Note_req *n = new Note_req;
+
+ n->pitch_ = *$1;
+ delete $1;
+ n->duration_ = *$4;
+ delete $4;
+ n->forceacc_b_ = $2 % 2;
+ n->cautionary_b_ = $3 % 2;
+
+ Simultaneous_music*v = new Request_chord;
+ v->set_spot (THIS->here_input ());
+ n->set_spot (THIS->here_input ());
+
+ v->add_music (n);
+
+ $$ = v;
}
| RESTNAME notemode_duration {
$$ = THIS->get_rest_element (*$1, $2);
$$ = THIS->get_chord (*$1, $3, $4, $5, *$2);
};
+
chord_additions:
{
$$ = new Array<Musical_pitch>;
}
;
+chord_subtractions:
+ {
+ $$ = new Array<Musical_pitch>;
+ }
+ | '^' chord_notes {
+ $$ = $2;
+ }
+ ;
+
+
+/*
+ forevery : X : optional_X sucks. Devise a solution.
+*/
+
+
chord_addsub:
chord_note optional_dot
| CHORDMODIFIER_PITCH optional_dot
}
;
-chord_subtractions:
- {
- $$ = new Array<Musical_pitch>;
- }
- | '^' chord_notes {
- $$ = $2;
- }
- ;
-
/*
UTILITIES
*/
+dots:
+ { $$ = 0; }
+ | dots '.' { $$ ++; }
+ ;
+
+
+
+exclamations:
+ { $$ = 0; }
+ | exclamations '!' { $$ ++; }
+ ;
+
+questions:
+ { $$ = 0; }
+ | questions '?' { $$ ++; }
+ ;
+semicolon:
+ ';'
+ ;
%%
void
{
Volta_spanner* v = new Volta_spanner;
Scalar prop = get_property ("voltaVisibility", 0);
- v->visible_b_ = prop.to_bool ();
+ if (!prop.to_bool ())
+ v->set_elt_property (transparent_scm_sym, SCM_BOOL_T);
prop = get_property ("voltaSpannerDuration", 0);
if ((i == alternative_music_arr_.size () - 1) || prop.length_i ())
v->last_b_ = true;
- Text_def* t = new Text_def;
- t->text_str_ = alternative_str_arr_[i];
- v->number_p_.set_p (t);
+
+ v->number_str_ = alternative_str_arr_[i];
volta_p_arr_.push (v);
announce_element (Score_element_info (v, alternative_music_arr_[i]));
}
Request::do_equal_b (Request*) const
{
return true;
+
}
#include "collision.hh"
#include "paper-def.hh"
-
-
-
void
Rest_collision::add_column (Note_column *nc_l)
{
{
int dy = rest_l_arr_.size() > 2 ? 6 : 4;
- rest_l_arr_[0]->translate_rests (rest_l_arr_[0]->dir_ *dy);
+ rest_l_arr_[0]->translate_rests (rest_l_arr_[0]->dir () *dy);
// top is last element...
- rest_l_arr_.top()->translate_rests (rest_l_arr_.top ()->dir_* dy);
+ rest_l_arr_.top()->translate_rests (rest_l_arr_.top ()->dir ()* dy);
}
// meisjes met jongetjes
else
{
// int dir_i = - ncol_l_arr_[0]->dir_;
- Direction dir = rest_l_arr_[0]->dir_;
+ Direction dir = rest_l_arr_[0]->dir ();
// minimum move
int minpos = 4;
#include "note-head.hh"
#include "stem.hh"
#include "note-column.hh"
-#include "script.hh"
#include "dot-column.hh"
#include "musical-request.hh"
ncol_p_->set_stem (stem_l_);
stem_l_ = 0;
}
-
- for (int i=0; i < script_l_arr_.size(); i++)
- {
- if (ncol_p_)
- ncol_p_->add_script (script_l_arr_[i]);
- }
-
- script_l_arr_.clear();
}
}
Item * item = dynamic_cast <Item *> (i.elem_l_);
if (!item)
return;
- if (Script *s=dynamic_cast<Script *> (item))
- {
- if (i.req_l_ && dynamic_cast <Musical_req *> (i.req_l_))
- {
- script_l_arr_.push (s);
- }
- }
- else if (Stem*s=dynamic_cast<Stem *> (item))
+ if (Stem*s=dynamic_cast<Stem *> (item))
{
stem_l_ = s;
}
{
ncol_p_->set_elt_property (horizontal_shift_scm_sym, SCM_BOOL_T);
}
-
- if (! ncol_p_->dir_)
- ncol_p_->dir_ =(Direction) int(get_property ("ydirection", 0));
typeset_element (ncol_p_);
ncol_p_ =0;
void
Rhythmic_column_engraver::do_post_move_processing()
{
- script_l_arr_.clear();
dotcol_l_ =0;
stem_l_ =0;
}
return r;
}
-
-/*
- STANDARD METHS
- */
void
Score_element::print() const
{
#ifndef NPRINT
DOUT << classname(this) << "{\n";
DOUT << "dependencies: " << dependency_size();
-
+ if (original_l_)
+ DOUT << "Copy ";
Graphical_element::do_print ();
do_print();
musical_column_l_->add_element(item_p);
}
}
- scoreline_l_->add_element (elem_p);
+ if (!elem_p->dim_cache_[Y_AXIS].parent_l_)
+ scoreline_l_->add_element (elem_p);
}
elem_p_arr_.clear();
}
if (command_column_l_ && command_column_l_->linked_b())
{
pscore_p_->add_column (command_column_l_);
- scoreline_l_->add_element (command_column_l_);
+ scoreline_l_->add_column (command_column_l_);
}
else
{
if (musical_column_l_ && musical_column_l_->linked_b())
{
pscore_p_->add_column (musical_column_l_);
- scoreline_l_->add_element (musical_column_l_);
+ scoreline_l_->add_column (musical_column_l_);
}
else
{
bool
Slur_engraver::do_try_music (Music *req_l)
{
- Musical_req *mus_l = dynamic_cast <Musical_req *> (req_l);
- if (Slur_req *sl = dynamic_cast <Slur_req *> (mus_l))
+ if (Slur_req *sl = dynamic_cast <Slur_req *> (req_l))
{
- new_slur_req_l_arr_.push (dynamic_cast <Slur_req *> (mus_l));
+ new_slur_req_l_arr_.push (sl);
return true;
}
return false;
dir_ = DOWN;
for (int i=0; i < encompass_arr_.size (); i ++)
{
- if (encompass_arr_[i]->dir_ < 0)
+ if (encompass_arr_[i]->dir () < 0)
{
dir_ = UP;
break;
#ifndef NPRINT
DOUT << "Between " << classname (spanned_drul_[LEFT])
<< " and " << classname (spanned_drul_[RIGHT]) << '\n';
- /* if (broken_into_l_arr_.size())
- {
- DOUT << "with broken pieces:\n";
- for (int i=0; i < broken_into_l_arr_.size (); i++)
- broken_into_l_arr_[i]->print ();
- }*/
+
+ if (broken_b ())
+ DOUT << "Broken in " << to_str (broken_info_.size ()) << " pieces";
#endif
}
info.broken_spanner_l_ = span_p;
- /* if (Axis_group_spanner *ags
- = dynamic_cast<Axis_group_spanner*> (span_p))
- {
- do something
- }
- */
span_p->handle_broken_dependencies();
}
#include "beam.hh"
#include "rest.hh"
-Stem::~Stem ()
+void
+Stem::set_direction (Direction d)
{
+ if (!dir_)
+ warning ("Stem direction set already!");
+
+ dir_ = d;
+
+ /*
+ todo
+ */
}
Stem::Stem ()
#include "paper-outputter.hh"
-Super_element::Super_element()
-{
-}
-
-
/**
for administration of what was done already
*/
void
Super_element::pre_processing ()
{
- calculate_dependencies (PRECALCING, PRECALCED, &Score_element::do_pre_processing);
+ calculate_dependencies (PRECALCED, PRECALCING, &Score_element::do_pre_processing);
}
void
Super_element::space_processing ()
{
- calculate_dependencies (SPACING, SPACED, &Score_element::do_space_processing);
+ calculate_dependencies (SPACED, SPACING, &Score_element::do_space_processing);
}
/* for break processing, use only one status, because copies have to
void
Super_element::post_processing ()
{
- calculate_dependencies (POSTCALCING, POSTCALCED, &Score_element::do_post_processing);
+ calculate_dependencies (POSTCALCED, POSTCALCING, &Score_element::do_post_processing);
}
void
Super_element::output_all ()
{
- pscore_l_->outputter_l_->start_line ();
- calculate_dependencies (BREWING, BREWED, &Score_element::output_processing);
- pscore_l_->outputter_l_->stop_line ();
+ calculate_dependencies (BREWED, BREWING, &Score_element::output_processing);
}
#include "engraver.hh"
#include "g-staff-side.hh"
#include "g-text-item.hh"
-#include "text-def.hh"
+#include "musical-request.hh"
#include "note-head.hh"
#include "stem.hh"
#include "staff-symbol.hh"
class Text_engraver : public Engraver
{
- Link_array<Script_req> reqs_;
+ Link_array<Text_script_req> reqs_;
Link_array<G_staff_side_item> positionings_;
Link_array<G_text_item> texts_;
public:
bool
Text_engraver::do_try_music (Music *m)
{
- if (Script_req *r = dynamic_cast<Script_req*> (m))
+ if (Text_script_req *r = dynamic_cast<Text_script_req*> (m))
{
- Text_def * t = dynamic_cast<Text_def*> (r->scriptdef_p_);
- if (!t)
- return false;
reqs_.push (r);
return true;
}
{
for (int i=0; i < reqs_.size (); i++)
{
- Script_req * r = reqs_[i];
- Text_def * t= dynamic_cast<Text_def*> (r->scriptdef_p_);
+ Text_script_req * r = reqs_[i];
G_text_item *text = new G_text_item;
G_staff_side_item *ss = new G_staff_side_item;
ss->set_victim (text);
+ ss->set_elt_property (script_priority_scm_sym,
+ gh_int2scm (200));
+
ss->dir_ = r->dir_;
- Scalar p (get_property ("textstyle", 0)); // textStyle?
- if (p.length_i ())
- text->style_str_ = p;
- text->text_str_ = t->text_str_;
+ text->text_str_ = r->text_str_;
+
+ if (r->style_str_.empty_b ())
+ {
+ Scalar p (get_property ("textStyle", 0));
+ if (p.length_i ())
+ text->style_str_ = p;
+ }
+ else
+ text->style_str_ = r->style_str_;
+
Scalar padding = get_property ("textScriptPadding", 0);
if (padding.length_i() && padding.isnum_b ())
{
if (time_signature_req_l_)
return false;
- if (dynamic_cast <Command_req *> (req_l))
- time_signature_req_l_ = dynamic_cast <Time_signature_change_req *> (req_l);
-
- if (time_signature_req_l_)
- return true;
+ if (Time_signature_change_req *t =
+ dynamic_cast <Time_signature_change_req *> (req_l))
+ {
+ time_signature_req_l_ = t;
+ return true;
+ }
return false;
}
#include "tuplet-spanner.hh"
#include "note-column.hh"
#include "compressed-music.hh"
-#include "text-def.hh"
+
#include "beam.hh"
#include "music-list.hh"
{
Tuplet_spanner* glep = new Tuplet_spanner;
started_span_p_arr_.push (glep);
-
- Text_def *t = new Text_def;
- t->text_str_ = to_str (compressed_music_arr_[i]->den_i_);
- glep->tdef_p_.set_p (t);
+ glep->number_str_ = to_str (compressed_music_arr_[i]->den_i_);
announce_element (Score_element_info (glep, compressed_music_arr_ [i]));
}
}
#include "paper-def.hh"
#include "tuplet-spanner.hh"
#include "stem.hh"
-#include "text-def.hh"
+
#include "note-column.hh"
Tuplet_spanner::Tuplet_spanner ()
beam_l_ =0;
bracket_visibility_b_ = true;
num_visibility_b_ = true;
-
- tdef_p_.set_p(new Text_def);
- tdef_p_->align_dir_ = CENTER;
- tdef_p_->style_str_ = "italic";
}
Molecule*
if (column_arr_.size ()){
Real ncw = column_arr_.top ()->extent (X_AXIS).length ();
- Molecule num (tdef_p_->get_molecule (paper_l (), CENTER));
+ Molecule num (lookup_l ()->text ("italic",
+ number_str_));
if (beam_l_ && !bracket_visibility_b_)
{
dir_ = UP;
for (int i=0; i < column_arr_.size (); i ++)
{
- if (column_arr_[i]->dir_ < 0)
+ if (column_arr_[i]->dir () < 0)
{
dir_ = DOWN;
break;
#include "paper-def.hh"
#include "volta-spanner.hh"
#include "stem.hh"
-#include "text-def.hh"
-#include "pointer.tcc"
-template class P<Text_def>; // UGH
+#include "pointer.tcc"
Volta_spanner::Volta_spanner ()
{
last_b_ = false;
- visible_b_ = true;
- number_p_.set_p (new Text_def);
- number_p_->align_dir_ = LEFT;
}
Molecule*
if (!column_arr_.size ())
return mol_p;
- if (!visible_b_)
- return mol_p;
Real internote_f = paper_l ()->get_realvar (interline_scm_sym)/2.0;
Real w = extent (X_AXIS).length () - dx;
Molecule volta (lookup_l ()->volta (w, last_b_));
Real h = volta.dim_.y ().length ();
- Molecule num (number_p_->get_molecule (paper_l (), LEFT));
+
+
+ Molecule num (lookup_l ()->text ("volta", number_str_));
Real dy = column_arr_.top ()->extent (Y_AXIS) [UP] >
column_arr_[0]->extent (Y_AXIS) [UP];
dy += 2 * h;
dy = dy >? note_column_arr_[i]->extent (Y_AXIS).max ();
dy -= h;
- Text_def two_text;
- two_text.text_str_ = "2";
- two_text.style_str_ = number_p_->style_str_;
- Molecule two (two_text.get_molecule (paper_l (), LEFT));
+ Molecule two (lookup_l ()->text ("number", "2"));
Real gap = two.dim_.x ().length () / 2;
Offset off (num.dim_.x ().length () + gap,
h / internote_f - gap);
set_bounds (LEFT, column_arr_[0]);
set_bounds (RIGHT, column_arr_.top ());
}
-
- // number_p_->style_str_ = "number-1";
- number_p_->style_str_ = "volta";
}
Interval
center=0
-break = { \penalty = 10000; }
-nobreak = { \penalty = -10000; }
+break = \penalty 10000;
+nobreak = \penalty -10000;
major = 0
minor = 3
% ugh. Order matters here.
\consists "Text_engraver";
- \consists "Script_engraver";
+ \consists "G_script_engraver";
+ \consists "G_script_column_engraver";
\consists "Rhythmic_column_engraver";
\consists "Font_size_engraver";
\consists "Slur_engraver";
-% name = \script {
-% indexstring follow_into_staff same_dir_as_stem above_below_staff symbol_can_beinverted priority }
-%
-
-thumb = \script { "thumb" 0 0 1 0 0 }
-accent = \script { "sforzato" 0 -1 0 0 0 }
-marcato = \script { "marcato" 0 -1 0 1 0 }
-staccatissimo = \script { "staccatissimo" 0 -1 0 1 0 }
-portato= \script { "portato" 0 -1 0 1 0 }
-fermata = \script { "fermata" 0 1 0 1 0 }
-stopped = \script { "stopped" 0 0 1 0 0 }
-staccato = \script { "staccato" 1 -1 0 0 0 }
-tenuto = \script {"tenuto" 1 -1 0 0 0 }
-upbow = \script { "upbow" 0 0 1 0 0 }
-downbow = \script { "downbow" 0 0 1 0 0 }
-lheel = \script { "upedalheel" 0 0 -1 0 0 }
-rheel = \script { "dpedalheel" 0 0 1 0 0 }
-ltoe = \script { "upedaltoe" 0 0 -1 0 0 }
-rtoe = \script { "dpedaltoe" 0 0 1 0 0 }
-turn = \script { "turn" 0 0 1 0 0 }
-open = \script { "open" 0 0 1 0 0 }
-flageolet = \script { "flageolet" 0 0 1 0 0 }
-reverseturn = \script { "reverseturn" 0 0 1 0 0 }
-
-
-% could we do without this bloat?
-%
-lbheel = \script { "bheel" 0 0 -1 0 0 }
-rbheel = \script { "bheel" 0 0 1 0 0 }
-lbtoe = \script { "btoe" 0 0 -1 0 0 }
-rbtoe = \script { "btoe" 0 0 1 0 0 }
-lfheel = \script { "fheel" 0 0 -1 0 0 }
-rfheel = \script { "fheel" 0 0 1 0 0 }
-lftoe = \script { "ftoe" 0 0 -1 0 0 }
-rftoe = \script { "ftoe" 0 0 1 0 0 }
-
-%
-% left toe: right heel:
-%
-% u -
-% - u
-% ---|-----|-- --|x----|x--
-% ---|-----|-- --|-----|---
-% --x|----x|-- --|-----|---
-% ^ -
-% - ^
-% back front back front
-%
-%
-% heu, me thought for a moment that order in table_xxx.ly was
-% being translated into priority...
-back = \script { "back" 0 -1 -1 0 0 }
-front = \script { "front" 0 -1 1 0 0 }
-
-trill =\script { "trill" 0 0 1 0
- 2000 % be above text.
-}
-
-prall =\script { "prall" 0 0 1 0 0 }
-mordent =\script { "mordent" 0 0 1 0 0 }
-prallprall =\script { "prallprall" 0 0 1 0 0 }
-prallmordent =\script { "prallmordent" 0 0 1 0 0 }
-upprall =\script { "upprall" 0 0 1 0 0 }
-downprall =\script { "downprall" 0 0 1 0 0 }
+\scmfile "script.scm";
"dash-hat" = "marcato"
"dash-plus" = "stopped"
"dash-bar" = "staccatissimo"
"dash-larger" = "accent"
"dash-dot" = "staccato"
+
+
+thumb = \script "thumb"
+accent = \script "accent"
+marcato = \script "marcato"
+staccatissimo = \script "staccatissimo"
+portato = \script "portato"
+fermata = \script "fermata"
+stopped = \script "stopped"
+staccato = \script "staccato"
+tenuto = \script "tenuto"
+upbow = \script "upbow"
+downbow = \script "downbow"
+lheel = \script "lheel"
+rheel = \script "rheel"
+ltoe = \script "ltoe"
+rtoe = \script "rtoe"
+turn = \script "turn"
+open = \script "open"
+flageolet = \script "flageolet"
+reverseturn = \script "reverseturn"
+trill = \script "trill"
+prall = \script "prall"
+mordent = \script "mordent"
+prallprall = \script "prallprall"
+prallmordent = \script "prallmordent"
+upprall = \script "upprall"
+downprall = \script "downprall"
err_y_a:=0; % no slant
tilt:=0;
superness:=0.495;
- ai_a:=0.400;
+ ai_a:=0.350;
% ai_bi:=1.23;
ai_bi:=1.30; % jcn
% err_y_ai:=0.0938;
(define (spanbar_non_postbreak_visibility d) (if (= d -1) '(#t . #t) '(#f . #f)))
(define (non_postbreak_visibility d) (if (= d 1) '(#t . #t) '(#f . #f)))
+(define (non_prebreak_visibility d) (if (= d -1) '(#t . #t) '(#f . #f)))
;; Score_span_bars are only visible at start of line
;; i.e. if break_dir == RIGHT == 1
(define Span_bar_engraver_visibility non_postbreak_visibility)
-
+(define mark-visibility non_prebreak_visibility)
(define Span_score_bar_engraver_visibility postbreak_only_visibility)
(define Piano_bar_engraver_visibility postbreak_only_visibility)
(define Staff_group_bar_engraver_visibility postbreak_only_visibility)
("volta" . "feta-nummer"))
)
+(define script-alist '())
+(define (articulation-to-scriptdef a)
+ (assoc a script-alist)
+ )
;; Map style names to TeX font names. Return false if
;; no font name found.
(set! font-cmd (cached-fontname font-count))
(set! font-alist (acons font-name font-cmd font-alist))
(set! font-count (+ 1 font-count))
+ (if (equal? font-name "")
+ (error "Empty fontname -- SELECT-FONT"))
(string-append "\\font" font-cmd "=" font-name font-cmd))
(cdr font-cmd)))
"" ;no switch needed
(embedded-ps ((ps-scm 'bezier-sandwich) l)))
- (define (start-line)
+ (define (start-line ht)
(begin
(clear-fontcache)
- "\\hbox{%\n")
+ (string-append"\\vbox to " (number->dim ht) "{\\hbox{%\n"))
)
+ (define (stop-line)
+ "}\\vss}\\interscoreline")
(define (filledbox breapth width depth height)
(string-append
"depth " (number->dim depth)
"height " (number->dim height) " "))
- (define (stop-line)
- "}\\interscoreline")
(define (text s)
(else (error "unknown tag -- PS-SCM " action-name))
)
)
-
-;
+ ;
; Russ McManus, <mcmanus@IDT.NET>
;
; I use the following, which should definitely be provided somewhere
--- /dev/null
+;; (name . '((downindexstring . upindexstring)
+;; follow-into-staff :: bool
+;; dir-relative-to-stem :: int
+;; force-dir :: int
+;; priority :: int
+
+;;TODO? extra padding :: Real (given in staff spaces)
+
+(set! script-alist
+ (append
+ '(("thumb" . (("thumb" . "thumb") #f 0 1 0))
+ ("accent" . (("sforzato" . "sforzato") #f -1 0 0))
+ ("marcato" . (("dmarcato" . "umarcato") #f -1 0 0))
+ ("staccatissimo" . (("dstaccatissimo" . "ustaccatissimo") #f -1 0 0 0))
+ ("portato" . (("dportato" . "uportato") #f -1 0 0))
+ ("fermata" . (("dfermata" . "ufermata") #f 1 0 0))
+ ("stopped" . (("stopped" . "stopped") #f 0 1 0))
+ ("staccato" . (("staccato" . "staccato") #t -1 0 -100))
+ ("tenuto" . (("tenuto" . "tenuto") 1 -1 0 0))
+ ("upbow" . (("upbow" . "upbow") #f 0 1 0))
+ ("downbow" . (("downbow" . "downbow") #f 0 1 0))
+ ("lheel" . (("upedalheel" . "upedalheel") #f 0 -1 0))
+ ("rheel" . (("dpedalheel" . "dpedalheel") #f 0 1 0))
+ ("ltoe" . (("upedaltoe" . "upedaltoe") #f 0 -1 0))
+ ("rtoe" . (("dpedaltoe" . "dpedaltoe") #f 0 1 0))
+ ("turn" . (("turn" . "turn") #f 0 1 0))
+ ("open" . (("open" . "open") #f 0 1 0))
+ ("flageolet" . (("flageolet" . "flageolet") 0 0 1 0))
+ ("reverseturn" . (("reverseturn" . "reverseturn") 0 0 1 0))
+ ("trill" . (("trill" . "trill") #f 0 1 2000))
+ ("prall" . (("prall" . "prall") #f 0 1 0))
+ ("mordent" . (("mordent" . "mordent") #f 0 1 0))
+ ("prallprall" . (("prallprall" . "prallprall") #f 0 1 0))
+ ("prallmordent" . (("prallmordent" . "prallmordent") #f 0 1 0))
+ ("upprall" . (("upprall" . "upprall") #f 0 1 0))
+ ("downprall" . (("downprall" . "downprall") #f 0 1 0)))
+ script-alist)
+ )