#include "musical-request.hh"
#include "bar.hh"
#include "beam.hh"
-#include "chord-tremolo.hh"
#include "rest.hh"
#include "stem.hh"
#include "debug.hh"
beam_p->add_stem ((*stem_l_arr_p_)[i]);
}
+ announce_element (Score_element_info (beam_p, 0));
return beam_p;
}
bool
Auto_beam_engraver::same_grace_state_b (Score_element* e)
{
- bool gr = e->get_elt_property (grace_scm_sym) != SCM_BOOL_F;
+ bool gr = e->get_elt_property ("grace") == SCM_BOOL_T;
SCM wg =get_property ("weAreGraceContext",0);
return (gh_boolean_p (wg) && gh_scm2bool (wg)) == gr;
}
{
end_beam ();
}
- else if (Chord_tremolo *b = dynamic_cast<Chord_tremolo*> (info.elem_l_))
- {
- end_beam ();
- }
else if (Bar *b = dynamic_cast<Bar *> (info.elem_l_))
{
end_beam ();
}
}
}
+
#include <math.h>
-#include "chord-tremolo.hh"
#include "beaming.hh"
#include "proto.hh"
#include "dimensions.hh"
bool knee = false;
int knee_y = 0;
Real internote_f = stems_[0]->staff_line_leading_f ()/2;
- if (gap != SCM_BOOL_F)
+ if (gap != SCM_UNDEFINED)
{
- int auto_gap_i = gh_scm2int (SCM_CDR (gap));
+ int auto_gap_i = gh_scm2int (gap);
for (int i=1; i < stems_.size (); i++)
{
bool is_b = (bool)(sinfo_[i].interstaff_f_ - sinfo_[i-1].interstaff_f_);
int y = (int)(stems_[i]->chord_start_f () / internote_f)
+ (int)sinfo_[i].interstaff_f_;
stems_[i]->dir_ = y < knee_y ? UP : DOWN;
- stems_[i]->set_elt_property (dir_forced_scm_sym, SCM_BOOL_T);
+ stems_[i]->set_elt_property ("dir-forced", SCM_BOOL_T);
}
}
return knee;
bool
Beam::auto_knees ()
{
- if (auto_knee (get_elt_property (auto_interstaff_knee_gap_scm_sym), true))
+ if (auto_knee (get_elt_property ("auto-interstaff-knee-gap"), true))
return true;
- return auto_knee (get_elt_property (auto_knee_gap_scm_sym), false);
+ return auto_knee (get_elt_property ("auto-knee-gap"), false);
}
if (stems_.size () < 2)
{
warning (_ ("beam with less than two stems"));
- set_elt_property (transparent_scm_sym, SCM_BOOL_T);
+ set_elt_property ("transparent", SCM_BOOL_T);
return;
}
set_steminfo ();
/* auto-knees used to only work for slope = 0
anyway, should be able to set slope per beam
- set_elt_property (damping_scm_sym, gh_int2scm(1000));
+ set_elt_property ("damping", gh_int2scm(1000));
*/
sinfo_.clear ();
If dir is not determined: up (see stem::get_default_dir ()) */
- Direction beam_dir;
+ Direction beam_dir = CENTER;
Direction neutral_dir = (Direction)(int)paper_l ()->get_var ("stem_default_neutral_direction");
- SCM a = get_elt_property (gh_symbol2scm ("beam_dir_algorithm"));
- a= gh_cdr (a);
+ SCM a = get_elt_property ("beam-dir-algorithm");
if (a == gh_symbol2scm ("majority")) // should get default from paper.
beam_dir = (count[UP] == count[DOWN]) ? neutral_dir
for (int i=0; i <stems_.size (); i++)
{
Stem *s = stems_[i];
- s->set_elt_property (beam_dir_scm_sym, gh_int2scm (d));
+ s->set_elt_property ("beam-dir", gh_int2scm (d));
- SCM force = s->remove_elt_property (dir_forced_scm_sym);
- if (force == SCM_BOOL_F)
+ SCM force = s->remove_elt_property ("dir-forced");
+ if (force == SCM_UNDEFINED)
s->dir_ = d;
}
}
{
Real interbeam_f = paper_l ()->interbeam_f (multiple_i_);
- Real beam_f = paper_l ()->get_realvar (beam_thickness_scm_sym);;
+ Real beam_f = paper_l ()->get_var ("beam_thickness");;
Real staffline_f = paper_l ()-> get_var ("stafflinethickness");
Real epsilon_f = staffline_f / 8;
Real dy_f = 0.0;
total_count_i++;
}
- bool grace_b = get_elt_property (grace_scm_sym) != SCM_BOOL_F;
+ bool grace_b = get_elt_property ("grace") == SCM_BOOL_T;
String type_str = grace_b ? "grace_" : "";
int stem_max = (int)rint(paper_l ()->get_var ("stem_max"));
Real shorten_f = paper_l ()->get_var (type_str + "forced_stem_shorten"
/*
Chord tremolo needs to beam over invisible stems of wholes
*/
- if (!dynamic_cast<Chord_tremolo*> (this))
+ SCM trem = get_elt_property ("chord-tremolo");
+ if (gh_boolean_p (trem) && gh_scm2bool (trem))
{
if (s->invisible_b ())
continue;
damped = tanh (slope_f_)
corresponds with some tables in [Wanske]
*/
- SCM damp = remove_elt_property (damping_scm_sym);
+ SCM damp = remove_elt_property ("damping");
int damping = 1; // ugh.
- if (damp!= SCM_BOOL_F)
- damping = gh_int2scm (SCM_CDR(damp));
+ if (damp!= SCM_UNDEFINED)
+ damping = gh_int2scm (damp);
if (damping)
slope_f_ = 0.6 * tanh (slope_f_) / damping;
+ n * interline
*/
- SCM q = get_elt_property (gh_symbol2scm ("slope_quantisation"));
- q = gh_cdr (q);
+ SCM q = get_elt_property ("slope-quantisation");
if (q == gh_symbol2scm ("none"))
return;
Real interline_f = stems_[0]->staff_line_leading_f ();
Real internote_f = interline_f / 2;
Real staffline_f = paper_l ()->get_var ("stafflinethickness");
- Real beam_f = paper_l ()->get_realvar (beam_thickness_scm_sym);;
+ Real beam_f = paper_l ()->get_var ("beam_thickness");;
Real dx_f = stems_.top ()->hpos_f () - stems_[0]->hpos_f ();
we only need to quantise the start of the beam as dy is quantised too
if extend_b then stems must *not* get shorter
*/
- SCM q = get_elt_property (gh_symbol2scm ("slope_quantisation"));
- q = gh_cdr (q);
+ SCM q = get_elt_property ("slope-quantisation");
+
/*
----------------------------------------------------------
Real space = stems_[0]->staff_line_leading_f ();
Real internote_f = space /2;
Real staffline_f = paper_l ()->get_var ("stafflinethickness");
- Real beam_f = paper_l ()->get_realvar (beam_thickness_scm_sym);;
+ Real beam_f = paper_l ()->get_var ("beam_thickness");;
/*
[TODO]
Real interbeam_f = paper_l ()->interbeam_f (multiple_i_);
Real internote_f = here->staff_line_leading_f ()/2;
- Real beam_f = paper_l ()->get_realvar (beam_thickness_scm_sym);;
+ Real beam_f = paper_l ()->get_var ("beam_thickness");;
Real dy = interbeam_f;
Real stemdx = staffline_f;
int j = 0;
Real gap_f = 0;
- SCM gap = get_elt_property (beam_gap_scm_sym);
- if (gap != SCM_BOOL_F)
+ SCM gap = get_elt_property ("beam-gap");
+ if (gap != SCM_UNDEFINED)
{
- int gap_i = gh_scm2int (SCM_CDR (gap));
+ int gap_i = gh_scm2int ( (gap));
int nogap = rwholebeams - gap_i;
for (; j < nogap; j++)
return leftbeams;
}
+
/*
- abbreviation-beam-engraver.cc -- implement Chord_tremolo_engraver
+ chord-tremolo-engraver.cc -- implement Chord_tremolo_engraver
source file of the GNU LilyPond music typesetter
#include "time-description.hh"
#include "chord-tremolo-engraver.hh"
#include "stem.hh"
-#include "chord-tremolo.hh"
+#include "beam.hh"
#include "musical-request.hh"
#include "misc.hh"
#include "warn.hh"
prev_start_req_ = reqs_drul_[START];
- abeam_p_ = new Chord_tremolo;
+ abeam_p_ = new Beam;
+ abeam_p_->set_elt_property ("chord-tremolo", SCM_BOOL_T);
+
announce_element (Score_element_info (abeam_p_, reqs_drul_[LEFT]));
}
}
if (s->type_i () != 1)
{
int gap_i =s->flag_i_ - ((s->type_i () >? 2) - 2);
- s->set_elt_property (beam_gap_scm_sym, gh_int2scm(gap_i));
+ s->set_elt_property ("beam-gap", gh_int2scm(gap_i));
}
#else
if (s->type_i () != 1)
{
int gap_i =s->flag_i_ - ((s->type_i () >? 2) - 2);
- abeam_p_->set_elt_property (beam_gap_scm_sym, gh_int2scm(gap_i));
+ abeam_p_->set_elt_property ("beam-gap", gh_int2scm(gap_i));
}
#endif
}
}
}
+
Real w = extent (X_AXIS).length ();
w += (dx_f_drul_[RIGHT] - dx_f_drul_[LEFT]);
- Real h = paper_l ()->get_realvar (extender_height_scm_sym);
+ Real h = paper_l ()->get_var ("extender_height");
Molecule a = lookup_l ()->filledbox ( Box (Interval (0,w), Interval (0,h)));
a.translate (Offset (dx_f_drul_[LEFT], 0));
Extender_spanner::do_post_processing ()
{
// UGH
- Real gap = paper_l ()->get_realvar (interline_scm_sym);
+ Real gap = paper_l ()->get_var ("interline");
Direction d = LEFT;
do
add_dependency (textitem_l);
}
+
w += (dx_f_drul_[RIGHT] - dx_f_drul_[LEFT]);
- Real th = paper_l ()->get_realvar (hyphen_thickness_scm_sym);
- Real h = paper_l ()->get_realvar (hyphen_height_scm_sym);
+ Real th = paper_l ()->get_var ("hyphen_thickness");
+ Real h = paper_l ()->get_var ("hyphen_height");
// UGH. First try: just make the hyphen take 1/3 of the available space
// for length, use a geometric mean of the available space and some minimum
- Real l = paper_l ()->get_realvar (hyphen_minimum_length_scm_sym);
+ Real l = paper_l ()->get_var ("hyphen_minimum_length");
if(l < w)
l = sqrt(l*w);
Molecule a = lookup_l ()->filledbox ( Box (Interval ((w-l)/2,(w+l)/2), Interval (h,h+th)));
Hyphen_spanner::do_post_processing ()
{
// UGH
- Real gap = paper_l ()->get_realvar (interline_scm_sym);
+ Real gap = paper_l ()->get_var ("interline");
Direction d = LEFT;
do
add_dependency (textitem_l);
}
+
/**
Generate an abbreviation beam. Eat stems.
+
+ UGH. Derive me from Beam_engraver.
+
*/
class Chord_tremolo_engraver : public Engraver
{
void typeset_beam ();
Drul_array<Chord_tremolo_req*> reqs_drul_;
Chord_tremolo_req* prev_start_req_;
- Chord_tremolo* abeam_p_;
- Chord_tremolo* finished_abeam_p_;
+ Beam* abeam_p_;
+ Beam* finished_abeam_p_;
};
#endif // Chord_tremolo_ENGRAVER_HH
direction */
class Chord_tremolo : public Beam {
public:
-
-
- Chord_tremolo();
-
VIRTUAL_COPY_CONS(Score_element);
protected:
- virtual void do_print() const;
virtual Molecule stem_beams (Stem *here, Stem *next, Stem *prev) const;
- virtual Molecule* do_brew_molecule_p() const;
};
+#error
#endif // Chord_tremolo_HH
status_i_ = 0;
self_scm_ = SCM_EOL;
original_l_ = 0;
- element_property_alist_ = scm_protect_object (gh_cons (gh_cons (void_scm_sym, SCM_BOOL_T) , SCM_EOL));
+ element_property_alist_ = SCM_EOL;
smobify_self ();
}
return dependency_arr_.size ();
}
+// should also have one that takes SCM arg.
SCM
-Score_element::get_elt_property (SCM sym) const
+Score_element::get_elt_property (String nm) const
{
- SCM s = scm_assq(sym, element_property_alist_);
+ SCM sym = ly_symbol (nm);
+ SCM s = scm_assq(sym, element_property_alist_);
- // is this a good idea?
if (s != SCM_BOOL_F)
- return s;
-
+ return SCM_CDR (s);
+
if (pscore_l_)
{
+ SCM sym2 = ly_symbol (name () + ("::" + nm));
+ SCM val;
+
// should probably check for Type::sym as well.
- if (pscore_l_->paper_l_->default_properties_.elem_b (sym))
- return pscore_l_->paper_l_->default_properties_[sym];
+ Paper_def * p= pscore_l_->paper_l_;
+ if (p->default_properties_.try_retrieve (sym2, &val))
+ return val;
+ else if (p->default_properties_.try_retrieve (sym, &val))
+ return val;
}
- return SCM_BOOL_F;
+ return SCM_UNDEFINED;
}
SCM
-Score_element::remove_elt_property (SCM key)
+Score_element::remove_elt_property (String key)
{
SCM s = get_elt_property (key);
- SCM_CDR(element_property_alist_) = scm_assq_remove_x (SCM_CDR (element_property_alist_), key);
+ SCM sym = ly_symbol (key);
+ element_property_alist_ = scm_assq_remove_x (element_property_alist_, sym);
return s;
}
void
-Score_element::set_elt_property (SCM s, SCM v)
+Score_element::set_elt_property (String k, SCM v)
{
- SCM_CDR(element_property_alist_) =
- scm_assoc_set_x (SCM_CDR (element_property_alist_), s, v);
+ SCM s = ly_symbol (k);
+ element_property_alist_ = scm_assoc_set_x (element_property_alist_, s, v);
}
Interval
if (!lookup_l_)
{
Score_element * urg = (Score_element*)this;
- SCM sz = urg->remove_elt_property (fontsize_scm_sym);
- int i = (sz != SCM_BOOL_F)
- ? gh_scm2int (SCM_CDR (sz))
+ SCM sz = urg->remove_elt_property ("fontsize");
+ int i = (sz != SCM_UNDEFINED)
+ ? gh_scm2int (sz)
: 0;
urg->lookup_l_ = (Lookup*)pscore_l_->paper_l_->lookup_l (i);
void
Score_element::output_processing ()
{
- if (get_elt_property (transparent_scm_sym) != SCM_BOOL_F)
+ if (get_elt_property ("transparent") != SCM_UNDEFINED)
return;
// we're being silly here.
output_p_ = do_brew_molecule_p ();
Offset o (relative_coordinate (0, X_AXIS), relative_coordinate (0, Y_AXIS));
+
+ SCM s = get_elt_property ("extra-offset");
+ if (gh_pair_p (s))
+ {
+ Real il = paper_l ()->get_var ("interline");
+ o[X_AXIS] += il * gh_scm2double (gh_car (s));
+ o[Y_AXIS] += il * gh_scm2double (gh_cdr (s));
+ }
pscore_l_->outputter_l_->output_molecule (output_p_,
o,
{
return SCM_CDR(a) == SCM_CDR(b) ? SCM_BOOL_T : SCM_BOOL_F;
}
+
// Default behaviour: number always, bracket when no beam!
bool bracket_visibility = !parallel_beam_b_;
bool number_visibility = true;
- SCM visibility_sym =get_elt_property (tuplet_visibility_scm_sym);
- if (visibility_sym != SCM_BOOL_F)
+ SCM visibility_sym =get_elt_property ("tuplet-visibility");
+ if (visibility_sym != SCM_UNDEFINED)
{
/*
ARG. Fixme.
3 show number, and bracket-if-no-beam
4 show number, and bracket
*/
- int value = gh_scm2int (SCM_CDR(visibility_sym));
+ int value = gh_scm2int ((visibility_sym));
bracket_visibility = (value == 4 || (value > 1 && !parallel_beam_b_));
number_visibility = (value > 2 || value == 1 ||
(value == 2 && !parallel_beam_b_));
number_str_, paper_l ()));
num.align_to (X_AXIS, CENTER);
num.translate_axis (w/2, X_AXIS);
- Real interline = paper_l ()->get_realvar (interline_scm_sym);
+ Real interline = paper_l ()->get_var ("interline");
Real dy = column_arr_.top ()->extent (Y_AXIS) [dir_]
- column_arr_[0]->extent (Y_AXIS) [dir_];
num.align_to (Y_AXIS, CENTER);
num.translate_axis (dy/2, Y_AXIS);
- Real thick = paper_l ()->get_realvar (tuplet_thick_scm_sym);
+ Real thick = paper_l ()->get_var ("tuplet_thick");
if (bracket_visibility)
{
Real gap = paper_l () -> get_var ("tuplet_spanner_gap");
Tuplet_spanner::get_default_dir () const
{
Direction d = UP;
- SCM dir_sym =get_elt_property (dir_forced_scm_sym);
- if (dir_sym != SCM_BOOL_F) {
- d= (Direction) gh_scm2int (SCM_CDR(dir_sym));
+ SCM dir_sym =get_elt_property ("dir-forced");
+ if (dir_sym != SCM_UNDEFINED) {
+ d= (Direction) gh_scm2int (dir_sym);
if (d != CENTER)
return d;
}
add_dependency (n);
}
+
if (bar_arr_.top ()->type_str_.length_i () > 1)
no_vertical_end = false;
- Real interline_f = paper_l ()->get_realvar (interline_scm_sym);
+ Real interline_f = paper_l ()->get_var ("interline");
Real internote_f = interline_f/2;
- Real t = paper_l ()->get_realvar (volta_thick_scm_sym);
+ Real t = paper_l ()->get_var ("volta_thick");
Real dx = internote_f;
Real w = extent (X_AXIS).length () - dx - get_broken_left_end_align ();
add_dependency (c);
}
+
BuildRoot: /tmp/lilypond-install
Prereq: tetex
-%description
-@BLURB@
+%description
+LilyPond is a music typesetter. It produces beautiful
+sheet music using a high level description file as input. LilyPond is
+part of the GNU Project.
+
%package documentation
Summary: Prebuilt website containing all LilyPond documentation.
# BuildArchitectures: noarch
%description documentation
-@BLURB@
+
The documentation of LilyPond, both in HTML and PostScript.
s1 |
f!16 s16*3 b, s16*3 s2 |
s1 |
- \property Voice.slurVerticalDirection=1
+ \slurdown
s4 e [dis8 ~ dis32 e( fis gis] [a b c d! c b c )a] |
- \property Voice.slurVerticalDirection=0
+ \slurboth
%10
s2 <a8 c,> s8 s4 |
<b8 gis,> s8 s4 <e,8 a,> s8 s4 |
f'4 s s |
s2.*2
%21
- \property Voice.slurVerticalDirection=1
+ \slurup
f16 c'(bes a g f es d )es c' f, es |
- \property Voice.slurVerticalDirection=0
+ \slurboth
bes4 s s
s2.*9
s2 s8.
\skip 2.*1;
\slurdotted
\skip 2.*14;
- \property Voice.textEmptyDimension = 1
+ \emptyText
s2._"Fine"
}
}
\skip 2.*1;
\slurdotted
\skip 2.*14;
- \property Voice.textEmptyDimension = 1
+ \emptyText
s2._"Menuetto I da Capo"
}
\skip 2.*3;
\clef alto;
\skip 2.*11;
- \property Voice.textEmptyDimension = 1
+ \emptyText
s2._"Fine"
}
}
\skip 2.*1;
\slurdotted
\skip 2.*14;
- \property Voice.textEmptyDimension = 1
+ \emptyText
s2._"Menuetto I da Capo"
}
}
\version "1.2.13";
-\include "nederlands.ly" % for correct parsing of note names
-
global = \notes {
\key c \minor;
- \time 4/4;
- \property Staff.timeSignatureStyle = "C"
- \skip 1*31;
- \bar "|."; |
}
dux = \context Voice=two \notes \relative c''{
\voicetwo
\clef violin;
- \property Voice.verticalDirection = "-1"
-
r8 c16 b c8 g as c16 b c8 d |
g, c16 b c8 d f,16 g as4 g16 f |
es c' b a g f! es d c8 es' d c |
\context PianoStaff <
\context Staff = treble <
- \global
\dux
- \comes
+ { \comes \bar "|."; }
+ \time 4/4;
+ \property Score.timeSignatureStyle = "C"
>
\context Staff = bass <
\global