From: fred Date: Tue, 26 Mar 2002 22:46:20 +0000 (+0000) Subject: lilypond-1.3.29 X-Git-Tag: release/1.5.59~1859 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=70a09a099009f85a688a337a79aeac37bdd3d1cf;p=lilypond.git lilypond-1.3.29 --- diff --git a/TODO b/TODO index f5a11cecd9..259faaf8af 100644 --- a/TODO +++ b/TODO @@ -10,6 +10,8 @@ Grep -i for TODO, FIXME and ugh/ugr/urg. .* TODO . * use hash tabs iso. alist_ for elt property? +. * unhardcode stuff in bezier-bow: all sizes other than 20pt are + broken . * control paper-size/-file from commandline ? lilypond --paper=paper16 foo.ly lilypond --paper=paper20 foo.ly @@ -17,6 +19,22 @@ Grep -i for TODO, FIXME and ugh/ugr/urg. . * entangle ly/* paper-params papersize stuff . * fix tremolos. . * change ) c4 to c4-) +. * automated marks. +. * There should be no pagebreak below the title of the movement!! +. * tempo: + +> - Tempo Indications: +> * \tempo 4 = 60 should be printed +> * There should be commands like \alloegro that also do something +> sensible in midi. +> +. * - It should be possible to have Bar numbers on every bar. + +. * dynamics: +> * Notes should be spaced out for crescendos (had to use c^" ") +> * something like c-.->\ff looks ugly. The dynamc indication should +> appear left of the marks +> . * There's insufficient leading between lines of lyrics, so risers like `l' and 'b' collide with the bottom of the line above. diff --git a/input/test/sleur.ly b/input/test/sleur.ly index 0b69da1a7b..66d3d96948 100644 --- a/input/test/sleur.ly +++ b/input/test/sleur.ly @@ -1,8 +1,8 @@ \header{ -title = "sleur"; -subtitle = "test slurs."; enteredby = "jcn"; copyright = "public domain"; +TestedFeatures = "This file tests Feta embedded slurs" + + "(Feta definitively is not an abbreviation of Font-En-TjA)"; } \version "1.3.5"; @@ -167,7 +167,7 @@ clipping = \notes\transpose c'{ } \score{ - \notes{ + \context Staff \notes{ % \property Voice.pletvisibility = 0; % use blend for fast check \blend diff --git a/input/test/slur-area.ly b/input/test/slur-area.ly new file mode 100644 index 0000000000..f16bb43838 --- /dev/null +++ b/input/test/slur-area.ly @@ -0,0 +1,26 @@ +\score{ +\notes\relative c''{ + +\property Voice.slurVerticalDirection = #1 +\property Voice.stemVerticalDirection = #-1 +a(a' a,)a +a(a a')a, +a(d a)a +a(a d)a + +e'8(e e e e e e)e +a,8(d a a a a a)a +a(a a a a a d)a + +c,(g' c e f d b)g +c,(g' c e f d b)g + +\property Voice.noAutoBeaming = ##t +\property Voice.stemVerticalDirection = #1 +a8(a a a a a a)a + +} +\paper{ +indent=0.0\mm; +} +} diff --git a/lily/all-font-metrics.cc b/lily/all-font-metrics.cc index 88f46c07a9..81a4133430 100644 --- a/lily/all-font-metrics.cc +++ b/lily/all-font-metrics.cc @@ -147,6 +147,3 @@ All_font_metrics::font_descriptions () const } - -#include "ly-smobs.icc" -IMPLEMENT_SMOBS(Font_metric); diff --git a/lily/bar.cc b/lily/bar.cc index 90de71251c..e4f66f1d35 100644 --- a/lily/bar.cc +++ b/lily/bar.cc @@ -29,14 +29,11 @@ Bar::get_bar_size () const } -Molecule* -Bar::do_brew_molecule_p () const +Molecule +Bar::do_brew_molecule () const { String s = ly_scm2string (get_elt_property ("glyph")); - Molecule *output - = new Molecule (lookup_l ()->bar (s, get_bar_size (), paper_l ())); - - return output; + return lookup_l ()->bar (s, get_bar_size (), paper_l ()); } diff --git a/lily/beam.cc b/lily/beam.cc index 33f354eb26..d96e15a637 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -708,12 +708,12 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const } -Molecule* -Beam::do_brew_molecule_p () const +Molecule +Beam::do_brew_molecule () const { - Molecule *mol_p = new Molecule; + Molecule mol; if (!stem_count ()) - return mol_p; + return mol; Real x0,dx; if (visible_stem_count ()) { @@ -739,12 +739,12 @@ Beam::do_brew_molecule_p () const Molecule sb = stem_beams (i, next, prev); Real x = i->hpos_f ()-x0; sb.translate (Offset (x, x * dydx + y)); - mol_p->add_molecule (sb); + mol.add_molecule (sb); } - mol_p->translate_axis (x0 + mol.translate_axis (x0 - spanned_drul_[LEFT]->relative_coordinate (0, X_AXIS), X_AXIS); - return mol_p; + return mol; } int diff --git a/lily/breathing-sign.cc b/lily/breathing-sign.cc index f6672d2059..54120930f3 100644 --- a/lily/breathing-sign.cc +++ b/lily/breathing-sign.cc @@ -26,8 +26,8 @@ Breathing_sign::Breathing_sign () set_elt_property ("breakable", SCM_BOOL_T); } -Molecule* -Breathing_sign::do_brew_molecule_p () const +Molecule +Breathing_sign::do_brew_molecule () const { Staff_symbol_referencer_interface si (this); @@ -35,9 +35,7 @@ Breathing_sign::do_brew_molecule_p () const Interval i1(0, space / 6), i2(-space / 2, space / 2); Box b(i1, i2); - Molecule *output = new Molecule (lookup_l()->filledbox(b)); - - return output; + return lookup_l()->filledbox(b); } void diff --git a/lily/chord-name.cc b/lily/chord-name.cc index ba971322fc..e395663bd1 100644 --- a/lily/chord-name.cc +++ b/lily/chord-name.cc @@ -221,8 +221,8 @@ Chord_name::banter (Array pitch_arr, Chord_mol* name_p) const TODO: fix silly to-and-fro scm conversions */ -Molecule* -Chord_name::do_brew_molecule_p () const +Molecule +Chord_name::do_brew_molecule () const { Array pitch_arr; scm_to_array (get_elt_property ("pitches"), &pitch_arr); @@ -286,16 +286,16 @@ Chord_name::do_brew_molecule_p () const if (!name.addition_mol.empty_b ()) name.addition_mol.translate (Offset (0, super_y)); - Molecule* mol_p = new Molecule; - mol_p->add_at_edge (X_AXIS, RIGHT, name.tonic_mol, 0); + Molecule mol; + mol.add_at_edge (X_AXIS, RIGHT, name.tonic_mol, 0); // huh? if (!name.modifier_mol.empty_b ()) - mol_p->add_at_edge (X_AXIS, RIGHT, name.modifier_mol, 0); + mol.add_at_edge (X_AXIS, RIGHT, name.modifier_mol, 0); if (!name.addition_mol.empty_b ()) - mol_p->add_at_edge (X_AXIS, RIGHT, name.addition_mol, 0); + mol.add_at_edge (X_AXIS, RIGHT, name.addition_mol, 0); if (!name.inversion_mol.empty_b ()) - mol_p->add_at_edge (X_AXIS, RIGHT, name.inversion_mol, 0); + mol.add_at_edge (X_AXIS, RIGHT, name.inversion_mol, 0); if (!name.bass_mol.empty_b ()) - mol_p->add_at_edge (X_AXIS, RIGHT, name.bass_mol, 0); - return mol_p; + mol.add_at_edge (X_AXIS, RIGHT, name.bass_mol, 0); + return mol; } diff --git a/lily/crescendo.cc b/lily/crescendo.cc index 481d30bca7..3f0f16b637 100644 --- a/lily/crescendo.cc +++ b/lily/crescendo.cc @@ -22,8 +22,8 @@ Crescendo::Crescendo () -Molecule* -Crescendo::do_brew_molecule_p () const +Molecule +Crescendo::do_brew_molecule () const { Real absdyn_dim = paper_l ()-> get_var ("crescendo_shorten"); Real extra_left = get_broken_left_end_align (); @@ -33,9 +33,11 @@ Crescendo::do_brew_molecule_p () const if (!isdir_b (dir) || !gh_pair_p (dyns)) { -Crescendo * me = (Crescendo*)this; + Crescendo * me = (Crescendo*)this; me->set_elt_property ("transparent", SCM_BOOL_T); - return new Molecule; + Molecule m; + + return m; } Direction gd = to_dir (dir); @@ -78,10 +80,9 @@ Crescendo * me = (Crescendo*)this; Real thick = paper_l ()->get_var ("crescendo_thickness"); const char* hairpin = (gd < 0)? "decrescendo" : "crescendo"; - Molecule * m - = new Molecule; - m->dim_.x () = Interval (0, width); - m->dim_.y () = Interval (-2*height, 2*height); + + Box b (Interval (0, width), + Interval (-2*height, 2*height)); SCM at = gh_list (ly_symbol2scm (hairpin), gh_double2scm (thick), @@ -90,8 +91,9 @@ Crescendo * me = (Crescendo*)this; gh_double2scm (continued ? height/2 : 0.0), SCM_UNDEFINED); - m->add_atom (at); - m->translate_axis (extra_left, X_AXIS); + Molecule m (b, at); + + m.translate_axis (extra_left, X_AXIS); return m; } diff --git a/lily/dots.cc b/lily/dots.cc index 36e0a34844..f63f77ddae 100644 --- a/lily/dots.cc +++ b/lily/dots.cc @@ -39,14 +39,11 @@ Dots::do_post_processing () si.set_position (p + directional_element (this).get ()); } } -Molecule* -Dots::do_brew_molecule_p () const +Molecule +Dots::do_brew_molecule () const { - Molecule *out = new Molecule; - Molecule fill = lookup_l ()->fill (Box (Interval (0,0), - Interval (0,0))); - out->add_molecule (fill); - + Molecule mol (lookup_l ()->fill (Box (Interval (0,0), + Interval (0,0)))); Molecule d = lookup_l ()->afm_find (String ("dots-dot")); Real dw = d.dim_[X_AXIS].length (); @@ -56,10 +53,10 @@ Dots::do_brew_molecule_p () const for (int i = gh_scm2int (get_elt_property ("dot-count")); i--; ) { d.translate_axis (2*dw,X_AXIS); - out->add_molecule (d); + mol.add_molecule (d); } - return out; + return mol; } diff --git a/lily/extender-spanner.cc b/lily/extender-spanner.cc index e70e848035..ff02c16d92 100644 --- a/lily/extender-spanner.cc +++ b/lily/extender-spanner.cc @@ -30,10 +30,10 @@ Extender_spanner::Extender_spanner () -Molecule* -Extender_spanner::do_brew_molecule_p () const +Molecule +Extender_spanner::do_brew_molecule () const { - Molecule* mol_p = new Molecule; + Molecule mol; Real w = spanner_length (); @@ -42,9 +42,9 @@ Extender_spanner::do_brew_molecule_p () const Molecule a = lookup_l ()->filledbox ( Box (Interval (0,w), Interval (0,h))); a.translate (Offset (dx_f_drul_[LEFT], 0)); - mol_p->add_molecule (a); + mol.add_molecule (a); - return mol_p; + return mol; } diff --git a/lily/font-metric.cc b/lily/font-metric.cc index c872d5b8d9..ef615ae0a9 100644 --- a/lily/font-metric.cc +++ b/lily/font-metric.cc @@ -126,3 +126,5 @@ Font_metric::print_smob (SCM s, SCM port, scm_print_state * ) } IMPLEMENT_UNSMOB(Font_metric, metrics); +IMPLEMENT_SMOBS(Font_metric); + diff --git a/lily/hyphen-spanner.cc b/lily/hyphen-spanner.cc index be36b99bf6..65470ea81c 100644 --- a/lily/hyphen-spanner.cc +++ b/lily/hyphen-spanner.cc @@ -30,10 +30,10 @@ Hyphen_spanner::Hyphen_spanner () dim_cache_[Y_AXIS]->set_callback (Dimension_cache::point_dimension_callback); } -Molecule* -Hyphen_spanner::do_brew_molecule_p () const +Molecule +Hyphen_spanner::do_brew_molecule () const { - Molecule* mol_p = new Molecule; + Molecule mol; Real w = spanner_length (); @@ -50,9 +50,9 @@ Hyphen_spanner::do_brew_molecule_p () const Molecule a = lookup_l ()->filledbox ( Box (Interval ((w-l)/2,(w+l)/2), Interval (h,h+th))); a.translate (Offset (dx_f_drul_[LEFT], 0)); - mol_p->add_molecule (a); + mol.add_molecule (a); - return mol_p; + return mol; } diff --git a/lily/include/bar.hh b/lily/include/bar.hh index 21ee05890c..1e4f8c539a 100644 --- a/lily/include/bar.hh +++ b/lily/include/bar.hh @@ -17,7 +17,7 @@ public: Bar(); protected: virtual void do_pre_processing (); - virtual Molecule* do_brew_molecule_p () const; + virtual Molecule do_brew_molecule () const; virtual Real get_bar_size () const; }; #endif // BAR_HH diff --git a/lily/include/beam.hh b/lily/include/beam.hh index 966f3f08e8..aff606c7a9 100644 --- a/lily/include/beam.hh +++ b/lily/include/beam.hh @@ -47,7 +47,7 @@ protected: virtual void do_pre_processing (); virtual void do_post_processing (); - virtual Molecule*do_brew_molecule_p () const; + virtual Molecule do_brew_molecule () const; Molecule stem_beams (Stem *here, Stem *next, Stem *prev) const; private: diff --git a/lily/include/breathing-sign.hh b/lily/include/breathing-sign.hh index bda300aaa0..83cf87e5e8 100644 --- a/lily/include/breathing-sign.hh +++ b/lily/include/breathing-sign.hh @@ -20,7 +20,7 @@ public: Breathing_sign (); protected: virtual void do_post_processing (); - virtual Molecule* do_brew_molecule_p () const; + virtual Molecule do_brew_molecule () const; }; diff --git a/lily/include/chord-name.hh b/lily/include/chord-name.hh index dc49f205c2..ae1ddc0500 100644 --- a/lily/include/chord-name.hh +++ b/lily/include/chord-name.hh @@ -40,7 +40,7 @@ public: void banter (Array pitch_arr, Chord_mol* name_p) const; protected: - virtual Molecule* do_brew_molecule_p () const; + virtual Molecule do_brew_molecule () const; }; #endif // CHORD_NAME_HH diff --git a/lily/include/crescendo.hh b/lily/include/crescendo.hh index ef7b6f3310..115b98b9fd 100644 --- a/lily/include/crescendo.hh +++ b/lily/include/crescendo.hh @@ -21,7 +21,7 @@ public: Crescendo(); protected: VIRTUAL_COPY_CONS(Score_element); - virtual Molecule*do_brew_molecule_p() const; + virtual Molecule do_brew_molecule() const; private: Molecule get_symbol() const; diff --git a/lily/include/dots.hh b/lily/include/dots.hh index 647a125513..6a36c9ef06 100644 --- a/lily/include/dots.hh +++ b/lily/include/dots.hh @@ -21,7 +21,7 @@ class Dots : public Item { protected: - virtual Molecule * do_brew_molecule_p () const; + virtual Molecule do_brew_molecule () const; virtual void do_post_processing (); public: diff --git a/lily/include/extender-spanner.hh b/lily/include/extender-spanner.hh index cb24e42ded..0fa11e6f57 100644 --- a/lily/include/extender-spanner.hh +++ b/lily/include/extender-spanner.hh @@ -34,7 +34,7 @@ public: void set_textitem (Direction, Item*); protected: - virtual Molecule* do_brew_molecule_p () const; + virtual Molecule do_brew_molecule () const; void do_post_processing (); VIRTUAL_COPY_CONS (Score_element); diff --git a/lily/include/hyphen-spanner.hh b/lily/include/hyphen-spanner.hh index 3086facc32..2530a5e116 100644 --- a/lily/include/hyphen-spanner.hh +++ b/lily/include/hyphen-spanner.hh @@ -25,7 +25,7 @@ Hyphen_spanner (); void set_textitem (Direction, Item*); protected: - virtual Molecule* do_brew_molecule_p () const; + virtual Molecule do_brew_molecule () const; Interval do_height () const; void do_post_processing (); diff --git a/lily/include/key-item.hh b/lily/include/key-item.hh index 6c78e9f29e..55f320c9c9 100644 --- a/lily/include/key-item.hh +++ b/lily/include/key-item.hh @@ -36,7 +36,7 @@ public: int calculate_position(int p, int a) const; protected: - virtual Molecule* do_brew_molecule_p() const; + virtual Molecule do_brew_molecule() const; }; #endif // KEYITEM_HH diff --git a/lily/include/local-key-item.hh b/lily/include/local-key-item.hh index b1d20b3ac4..3e2063167b 100644 --- a/lily/include/local-key-item.hh +++ b/lily/include/local-key-item.hh @@ -50,7 +50,7 @@ public: void add_pitch (Musical_pitch, bool cautionary, bool natural); protected: virtual void do_pre_processing(); - virtual Molecule* do_brew_molecule_p() const; + virtual Molecule do_brew_molecule() const; }; #endif // LOCALKEYITEM_HH diff --git a/lily/include/ly-smobs.icc b/lily/include/ly-smobs.icc index 97da61e6d0..10e9b03f30 100644 --- a/lily/include/ly-smobs.icc +++ b/lily/include/ly-smobs.icc @@ -18,7 +18,18 @@ unsmob_ ## name ( SCM s) \ return SMOB_TO_TYPE(CL, s); \ else \ return 0; \ -} +}\ +SCM smobify (CL *cl)\ +{\ + SCM s; \ + \ + SCM_NEWCELL(s); \ + SCM_SETCAR(s,CL::smob_tag_); \ + void * me_p = cl; \ + SCM_SETCDR(s,me_p); \ +return s;\ +}\ + #define IMPLEMENT_SMOBS(CL)\ @@ -55,14 +66,8 @@ CL::smobify_self () \ This is local. We don't assign to self_scm_ directly, to assure \ that S isn't GC-ed from under us. \ */ \ - SCM s; \ - \ - SCM_NEWCELL(s); \ + SCM s = smobify (this); \ self_scm_ = s; \ - \ - SCM_SETCAR(s,smob_tag_); \ - void * me_p = this; \ - SCM_SETCDR(s,me_p); \ scm_protect_object (s); \ \ /* no scm_done_malloc() ! */ \ diff --git a/lily/include/molecule.hh b/lily/include/molecule.hh index f5e94ef60a..7342d0d406 100644 --- a/lily/include/molecule.hh +++ b/lily/include/molecule.hh @@ -8,45 +8,51 @@ #ifndef MOLECULE_HH #define MOLECULE_HH +#include // size_t #include "lily-proto.hh" #include "box.hh" #include "axes.hh" #include "direction.hh" -#include "cons.hh" -#include "protected-scm.hh" - -//#define ATOM_SMOB +#include "lily-guile.hh" /** a group of individually translated symbols. You can add molecules to the top, to the right, etc. + It is implemented as a "tree" of scheme expressions, as in + + Expr = combine Expr Expr + | translate Offset Expr + | SCHEME + ; + + SCHEME is a Scheme expression that --when eval'd-- produces the + desired output. + + + Because of the way that Molecule is implemented, it is the most + efficient to add "fresh" molecules to what you're going to build. + Dimension behavior: Empty molecules have empty dimensions. If add_at_edge is used to init the molecule, we assume that DIMENSIONS = (Interval(0,0),Interval(0,0) - + */ class Molecule { - Protected_scm atom_list_; - - friend class Paper_outputter; - + /// can't alloc on heap. + void * operator new (size_t s); public: Box dim_; - + SCM expr_; + + Molecule (Box, SCM s); Molecule(); - ~Molecule(); /** Set dimensions to empty, or to (Interval(0,0),Interval(0,0) */ void set_empty (bool); void add_at_edge (Axis a, Direction d, const Molecule &m, Real padding); - - /** - Add an atom. The molecule assumes responsibility for cleaning. - */ - void add_atom (SCM as); void add_molecule (Molecule const &m); void translate (Offset); @@ -62,13 +68,10 @@ public: void translate_axis (Real,Axis); + /// how big is #this#? Box extent() const; Interval extent (Axis) const; - - Molecule (const Molecule&s); - - void operator=(const Molecule&); bool empty_b() const; void print ()const; }; diff --git a/lily/include/multi-measure-rest.hh b/lily/include/multi-measure-rest.hh index b86e566146..527e93fcd6 100644 --- a/lily/include/multi-measure-rest.hh +++ b/lily/include/multi-measure-rest.hh @@ -21,7 +21,7 @@ public: void add_column (Item*); Molecule compound_rest (int)const; protected: - virtual Molecule *do_brew_molecule_p () const; + virtual Molecule do_brew_molecule () const; VIRTUAL_COPY_CONS (Score_element); virtual void do_add_processing (); diff --git a/lily/include/note-head.hh b/lily/include/note-head.hh index 25fdda52b4..fbebc0a404 100644 --- a/lily/include/note-head.hh +++ b/lily/include/note-head.hh @@ -24,7 +24,7 @@ public: protected: virtual void do_pre_processing(); - virtual Molecule* do_brew_molecule_p() const; + virtual Molecule do_brew_molecule() const; }; #endif // NOTEHEAD_HH diff --git a/lily/include/paper-outputter.hh b/lily/include/paper-outputter.hh index 09e8f58bdd..3a1d343c27 100644 --- a/lily/include/paper-outputter.hh +++ b/lily/include/paper-outputter.hh @@ -16,6 +16,7 @@ #include "lily-guile.hh" #include "protected-scm.hh" +// huh? #ifdef __powerpc__ #include "protected-scm.hh" #endif @@ -31,8 +32,6 @@ public: Paper_outputter (); void dump_onto (Paper_stream *); - - void output_int_def (String k, int v); void output_Real_def (String k, Real v); void output_String_def (String k, String v); @@ -41,7 +40,7 @@ public: void output_font_def (int i, String str); void output_font_switch (int i); void output_header (); - void output_molecule (Molecule const *, Offset, char const *); + void output_molecule (SCM expr, Offset, char const *); void output_comment (String s); void output_scheme (SCM scm); diff --git a/lily/include/rest.hh b/lily/include/rest.hh index ce95e6396b..56b13441a6 100644 --- a/lily/include/rest.hh +++ b/lily/include/rest.hh @@ -16,6 +16,6 @@ class Rest : public Rhythmic_head { protected: virtual void do_post_processing (); - virtual Molecule * do_brew_molecule_p () const; + virtual Molecule do_brew_molecule () const; }; #endif // REST_HH diff --git a/lily/include/score-element.hh b/lily/include/score-element.hh index 2a962607fd..e3bec466ef 100644 --- a/lily/include/score-element.hh +++ b/lily/include/score-element.hh @@ -62,7 +62,7 @@ public: int status_i_; Paper_score *pscore_l_; - Molecule * output_p_; + Score_element (); Score_element (Score_element const&); virtual void print () const; @@ -137,7 +137,7 @@ protected: /// do printing of derived info. virtual void do_print () const; /// generate the molecule - virtual Molecule* do_brew_molecule_p () const; + virtual Molecule do_brew_molecule () const; ///executed directly after the item is added to the Paper_score virtual void do_add_processing (); /// do calculations before determining horizontal spacing diff --git a/lily/include/script.hh b/lily/include/script.hh index 8902a94bbf..b9c0be1238 100644 --- a/lily/include/script.hh +++ b/lily/include/script.hh @@ -26,7 +26,7 @@ public: protected: virtual void do_pre_processing (); virtual void do_post_processing (); - Molecule* do_brew_molecule_p () const; + Molecule do_brew_molecule () const; }; #endif /* Stem_SCRIPT_HH */ diff --git a/lily/include/span-bar.hh b/lily/include/span-bar.hh index 77b6429fe3..8100bbafed 100644 --- a/lily/include/span-bar.hh +++ b/lily/include/span-bar.hh @@ -38,7 +38,7 @@ protected: virtual void do_pre_processing(); virtual void do_post_processing(); - virtual Molecule * do_brew_molecule_p() const; + virtual Molecule do_brew_molecule() const; }; #endif // SPAN_BAR_HH diff --git a/lily/include/staff-symbol.hh b/lily/include/staff-symbol.hh index ea6a408653..88821052fe 100644 --- a/lily/include/staff-symbol.hh +++ b/lily/include/staff-symbol.hh @@ -23,6 +23,6 @@ public: int line_count () const; protected: VIRTUAL_COPY_CONS(Score_element); - virtual Molecule* do_brew_molecule_p() const; + virtual Molecule do_brew_molecule() const; }; #endif // STAFFSYM_HH diff --git a/lily/include/stem-tremolo.hh b/lily/include/stem-tremolo.hh index 9ef3b06829..2e963007e2 100644 --- a/lily/include/stem-tremolo.hh +++ b/lily/include/stem-tremolo.hh @@ -16,7 +16,7 @@ class Stem_tremolo : public Item { protected: Stem * stem_l () const; - virtual Molecule *do_brew_molecule_p () const; + virtual Molecule do_brew_molecule () const; static Interval dim_callback (Dimension_cache const*); public: diff --git a/lily/include/stem.hh b/lily/include/stem.hh index 2f8298c4d8..b31627019f 100644 --- a/lily/include/stem.hh +++ b/lily/include/stem.hh @@ -91,7 +91,7 @@ protected: virtual void do_pre_processing(); static Interval dim_callback (Dimension_cache const*); - virtual Molecule* do_brew_molecule_p() const; + virtual Molecule do_brew_molecule() const; void set_spacing_hints () ; }; diff --git a/lily/include/text-item.hh b/lily/include/text-item.hh index e3c7a89c33..f6aaa02928 100644 --- a/lily/include/text-item.hh +++ b/lily/include/text-item.hh @@ -20,7 +20,7 @@ class Text_item : public Item public: VIRTUAL_COPY_CONS (Score_element); protected: - virtual Molecule *do_brew_molecule_p () const; + virtual Molecule do_brew_molecule () const; }; #endif /* Text_ITEM_HH */ diff --git a/lily/include/tie.hh b/lily/include/tie.hh index 5e07334424..53dc0733ec 100644 --- a/lily/include/tie.hh +++ b/lily/include/tie.hh @@ -29,7 +29,7 @@ public: virtual Direction get_default_dir() const; protected: - virtual Molecule* do_brew_molecule_p () const; + virtual Molecule do_brew_molecule () const; virtual Array get_encompass_offset_arr () const; Bezier get_curve () const; diff --git a/lily/include/time-signature.hh b/lily/include/time-signature.hh index 4d02f04693..3bdc1208e1 100644 --- a/lily/include/time-signature.hh +++ b/lily/include/time-signature.hh @@ -24,7 +24,7 @@ class Time_signature: public Item Molecule time_signature (int, int)const; protected: - virtual Molecule*do_brew_molecule_p() const; + virtual Molecule do_brew_molecule() const; public: Time_signature () ; diff --git a/lily/include/tuplet-spanner.hh b/lily/include/tuplet-spanner.hh index e201413197..a38a9dcb4c 100644 --- a/lily/include/tuplet-spanner.hh +++ b/lily/include/tuplet-spanner.hh @@ -28,7 +28,7 @@ protected: void calc_dy (Real *) const; void calc_position_and_height (Real*,Real *dy)const; - virtual Molecule* do_brew_molecule_p () const; + virtual Molecule do_brew_molecule () const; VIRTUAL_COPY_CONS(Score_element); virtual void do_add_processing (); virtual void do_post_processing (); diff --git a/lily/include/volta-spanner.hh b/lily/include/volta-spanner.hh index a4f32c0354..bdc42ffdf4 100644 --- a/lily/include/volta-spanner.hh +++ b/lily/include/volta-spanner.hh @@ -22,7 +22,7 @@ public: void add_bar (Bar*); protected: - virtual Molecule* do_brew_molecule_p () const; + virtual Molecule do_brew_molecule () const; VIRTUAL_COPY_CONS (Score_element); virtual void do_add_processing (); diff --git a/lily/key-item.cc b/lily/key-item.cc index 56ab8a0506..55c594c01c 100644 --- a/lily/key-item.cc +++ b/lily/key-item.cc @@ -93,10 +93,10 @@ Key_item::calculate_position(int p, int a) const - space the `natural' signs wider - dehair this */ -Molecule* -Key_item::do_brew_molecule_p() const +Molecule +Key_item::do_brew_molecule() const { - Molecule*output = new Molecule; + Molecule mol; Staff_symbol_referencer_interface si (this); Real inter = si.staff_space ()/2.0; @@ -118,7 +118,7 @@ Key_item::do_brew_molecule_p() const Molecule m =lookup_l ()->afm_find ("accidentals-0"); m.translate_axis (calculate_position(old_pitch_arr_[i], old_acc_arr_[i]) * inter, Y_AXIS); - output->add_at_edge (X_AXIS, RIGHT, m,0); + mol.add_at_edge (X_AXIS, RIGHT, m,0); } } @@ -130,17 +130,17 @@ Key_item::do_brew_molecule_p() const Interval x(0, inter); Interval y(0,0); - output->add_at_edge (X_AXIS, RIGHT, lookup_l()->fill (Box(x,y)),0); + mol.add_at_edge (X_AXIS, RIGHT, lookup_l()->fill (Box(x,y)),0); } for (int i =0; i < pitch_arr_.size(); i++) { Molecule m = lookup_l ()->afm_find ("accidentals-" + to_str (acc_arr_[i])); m.translate_axis (calculate_position(pitch_arr_[i], acc_arr_[i]) * inter, Y_AXIS); - output->add_at_edge (X_AXIS, RIGHT, m, 0); + mol.add_at_edge (X_AXIS, RIGHT, m, 0); } - return output; + return mol; } diff --git a/lily/local-key-item.cc b/lily/local-key-item.cc index d18824b443..249abd0743 100644 --- a/lily/local-key-item.cc +++ b/lily/local-key-item.cc @@ -58,13 +58,17 @@ Local_key_item::accidental (int j, bool cautionary, bool natural) const return m; } -Molecule* -Local_key_item::do_brew_molecule_p() const +/* + UGH. clean me up + */ +Molecule +Local_key_item::do_brew_molecule() const { - Molecule*output = new Molecule; + Molecule mol; Staff_symbol_referencer_interface si (this); Real note_distance = si.staff_space ()/2; - Molecule *octave_mol_p = 0; + Molecule octave_mol; + bool oct_b = false; int lastoct = -100; for (int i = 0; i < accidental_arr_.size(); i++) @@ -73,14 +77,14 @@ Local_key_item::do_brew_molecule_p() const // do one octave if (p.octave_i_ != lastoct) { - if (octave_mol_p) + if (oct_b) { Real dy =lastoct*7* note_distance; - octave_mol_p->translate_axis (dy, Y_AXIS); - output->add_molecule (*octave_mol_p); - delete octave_mol_p; + octave_mol.translate_axis (dy, Y_AXIS); + mol.add_molecule (octave_mol); + octave_mol = Molecule (); } - octave_mol_p= new Molecule; + oct_b = true; } lastoct = p.octave_i_; @@ -94,15 +98,15 @@ Local_key_item::do_brew_molecule_p() const accidental_arr_[i].natural_b_)); m.translate_axis (dy, Y_AXIS); - octave_mol_p->add_at_edge (X_AXIS, RIGHT, m, 0); + octave_mol.add_at_edge (X_AXIS, RIGHT, m, 0); } - if (octave_mol_p) + if (oct_b) { Real dy =lastoct*7*note_distance; - octave_mol_p->translate_axis (dy, Y_AXIS); - output->add_molecule (*octave_mol_p); - delete octave_mol_p; + octave_mol.translate_axis (dy, Y_AXIS); + mol.add_molecule (octave_mol); + octave_mol = Molecule (); } if (accidental_arr_.size()) @@ -123,10 +127,10 @@ Local_key_item::do_brew_molecule_p() const Box b(Interval (0, gh_scm2double (pads[d]) * note_distance), Interval (0,0)); Molecule m (lookup_l ()->fill (b)); - output->add_at_edge (X_AXIS, d, m, 0); + mol.add_at_edge (X_AXIS, d, m, 0); } while ( flip (&d)!= LEFT); } - return output; + return mol; } diff --git a/lily/moment.cc b/lily/moment.cc index 3d7a69474e..45002d8eed 100644 --- a/lily/moment.cc +++ b/lily/moment.cc @@ -64,6 +64,7 @@ make_rational (SCM n, SCM d) #include "ly-smobs.icc" +IMPLEMENT_UNSMOB(Moment,moment); IMPLEMENT_SMOBS(Moment); void diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index 2b5ff1ac50..cba889d3f7 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -30,8 +30,8 @@ Multi_measure_rest::Multi_measure_rest () [TODO] 17 * variable-sized multi-measure rest symbol: |====| ?? */ -Molecule* -Multi_measure_rest::do_brew_molecule_p () const +Molecule +Multi_measure_rest::do_brew_molecule () const { Real staff_space = staff_symbol_referencer (this).staff_space (); @@ -48,7 +48,7 @@ Multi_measure_rest::do_brew_molecule_p () const sp_iv[d] = coldim[-d] ; } while ((flip (&d)) != LEFT); - Molecule *mol_p = new Molecule; + Molecule mol; Real x_off = 0.0; Real rx = spanned_drul_[LEFT]->relative_coordinate (0, X_AXIS); @@ -119,17 +119,17 @@ Multi_measure_rest::do_brew_molecule_p () const s = lookup_l ()->afm_find (idx); } - mol_p->add_molecule (s); + mol.add_molecule (s); if (measures > 1) { Molecule s (lookup_l ()->text ("number", to_str (measures), paper_l ())); s.align_to (X_AXIS, CENTER); s.translate_axis (3.0 * staff_space, Y_AXIS); - mol_p->add_molecule (s); + mol.add_molecule (s); } - mol_p->translate_axis (x_off, X_AXIS); - return mol_p; + mol.translate_axis (x_off, X_AXIS); + return mol; } /* diff --git a/lily/note-head.cc b/lily/note-head.cc index d7da247660..188d967f3b 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -26,7 +26,7 @@ Note_head::ledger_line (Interval xwid) const { Drul_array endings; endings[LEFT] = lookup_l()->afm_find ("noteheads-ledgerending"); - Molecule * e = &endings[LEFT]; + Molecule *e = &endings[LEFT]; endings[RIGHT] = *e; Real thick = e->dim_[Y_AXIS].length(); @@ -79,8 +79,8 @@ Note_head::do_pre_processing () -Molecule* -Note_head::do_brew_molecule_p() const +Molecule +Note_head::do_brew_molecule() const { Staff_symbol_referencer_interface si (this); @@ -98,15 +98,14 @@ Note_head::do_brew_molecule_p() const type = ly_scm2string (style); } - Molecule* out = - new Molecule (lookup_l()->afm_find (String ("noteheads-") + to_str (balltype_i ()) + type)); + Molecule out = lookup_l()->afm_find (String ("noteheads-") + to_str (balltype_i ()) + type); - Box ledgerless = out->dim_; + Box ledgerless = out.dim_; if (streepjes_i) { Direction dir = (Direction)sign (p); - Interval hd = out->dim_[X_AXIS]; + Interval hd = out.dim_[X_AXIS]; Real hw = hd.length ()/4; Molecule ledger (ledger_line (Interval (hd[LEFT] - hw, @@ -119,11 +118,11 @@ Note_head::do_brew_molecule_p() const Molecule s (ledger); s.translate_axis (-dir * inter_f * (i*2 + parity), Y_AXIS); - out->add_molecule (s); + out.add_molecule (s); } } - out->dim_ = ledgerless; + out.dim_ = ledgerless; return out; } diff --git a/lily/rest.cc b/lily/rest.cc index 671c59bf72..783372390c 100644 --- a/lily/rest.cc +++ b/lily/rest.cc @@ -37,8 +37,8 @@ Rest::do_post_processing () } -Molecule * -Rest::do_brew_molecule_p () const +Molecule +Rest::do_brew_molecule () const { bool ledger_b =false; @@ -58,7 +58,7 @@ Rest::do_brew_molecule_p () const String idx = ("rests-") + to_str (balltype_i ()) + (ledger_b ? "o" : "") + style; - return new Molecule(lookup_l ()->afm_find (idx)); + return lookup_l ()->afm_find (idx); } diff --git a/lily/scm-hash.cc b/lily/scm-hash.cc index e864d60875..83357769fa 100644 --- a/lily/scm-hash.cc +++ b/lily/scm-hash.cc @@ -31,8 +31,6 @@ Scheme_hash_table::do_smobify_self () { } -#include "ly-smobs.icc" -IMPLEMENT_SMOBS(Scheme_hash_table); SCM Scheme_hash_table::mark_smob (SCM s) @@ -108,3 +106,7 @@ Scheme_hash_table::to_alist () const return l; } + +#include "ly-smobs.icc" +IMPLEMENT_UNSMOB(Scheme_hash_table,scheme_hash); +IMPLEMENT_SMOBS(Scheme_hash_table); diff --git a/lily/score-element.cc b/lily/score-element.cc index 63a89e500f..bdc28e626a 100644 --- a/lily/score-element.cc +++ b/lily/score-element.cc @@ -30,7 +30,6 @@ Score_element::Score_element() { - output_p_ =0; dim_cache_[X_AXIS] = new Dimension_cache; dim_cache_[Y_AXIS] = new Dimension_cache; dim_cache_[X_AXIS]->elt_l_ = dim_cache_[Y_AXIS]->elt_l_ = this; @@ -66,7 +65,6 @@ Score_element::Score_element (Score_element const&s) original_l_ =(Score_element*) &s; element_property_alist_ = SCM_EOL; // onstack; - output_p_ =0; status_i_ = s.status_i_; lookup_l_ = s.lookup_l_; pscore_l_ = s.pscore_l_; @@ -76,7 +74,6 @@ Score_element::Score_element (Score_element const&s) Score_element::~Score_element() { - assert (!output_p_); assert (status_i_ >=0); status_i_ = -1; @@ -146,12 +143,8 @@ Interval Score_element::molecule_extent(Dimension_cache const *c) { Score_element *s = dynamic_cast(c->element_l()); - Molecule*m = s->do_brew_molecule_p(); - - Interval iv = m->extent()[c->axis ()]; - - delete m; - return iv; + Molecule m = s->do_brew_molecule(); + return m.extent()[c->axis ()]; } @@ -255,11 +248,8 @@ Score_element::output_processing () if (to_boolean (get_elt_property ("transparent"))) return; - // we're being silly here. - if (output_p_) - delete output_p_; - output_p_ = do_brew_molecule_p (); + Molecule m (do_brew_molecule ()); Offset o (relative_coordinate (0, X_AXIS), relative_coordinate (0, Y_AXIS)); SCM s = get_elt_property ("extra-offset"); @@ -270,12 +260,7 @@ Score_element::output_processing () o[Y_AXIS] += il * gh_scm2double (gh_cdr (s)); } - pscore_l_->outputter_l_->output_molecule (output_p_, - o, - classname(this)); - - delete output_p_; - output_p_ =0; + pscore_l_->outputter_l_->output_molecule (m.expr_, o, classname(this)); } /* @@ -316,22 +301,20 @@ Score_element::do_add_processing() -Molecule* -Score_element::do_brew_molecule_p() const +Molecule +Score_element::do_brew_molecule() const { SCM glyph = get_elt_property ("glyph"); if (gh_string_p (glyph)) { - Molecule*output = new Molecule (lookup_l ()->afm_find (String (ly_scm2string (glyph)))); + return lookup_l ()->afm_find (String (ly_scm2string (glyph))); - return output; } else { Interval emp; emp.set_empty (); - Molecule a (lookup_l ()->fill (Box (emp,emp))); - return new Molecule (a); + return lookup_l ()->fill (Box (emp,emp)); } } @@ -609,8 +592,8 @@ Score_element::fixup_refpoint () #include "ly-smobs.icc" -IMPLEMENT_SMOBS(Score_element); IMPLEMENT_UNSMOB(Score_element, element); +IMPLEMENT_SMOBS(Score_element); SCM Score_element::mark_smob (SCM ses) { diff --git a/lily/script.cc b/lily/script.cc index 494faed2b4..7e19e16940 100644 --- a/lily/script.cc +++ b/lily/script.cc @@ -56,15 +56,15 @@ Script::do_post_processing () i.set_direction (d); } -Molecule* -Script::do_brew_molecule_p () const +Molecule +Script::do_brew_molecule () const { Direction dir = DOWN; SCM d = get_elt_property ("direction"); if (isdir_b (d)) dir = to_dir (d); - return new Molecule (get_molecule (dir)); + return get_molecule (dir); } diff --git a/lily/span-bar.cc b/lily/span-bar.cc index 4393de2def..0ee3142afd 100644 --- a/lily/span-bar.cc +++ b/lily/span-bar.cc @@ -123,15 +123,15 @@ Span_bar::height_callback (Dimension_cache const *c) return s->get_spanned_interval (); } -Molecule* -Span_bar::do_brew_molecule_p () const +Molecule +Span_bar::do_brew_molecule () const { Interval iv (get_spanned_interval ()); - Molecule*output = new Molecule; + Molecule output; SCM s = get_elt_property ("glyph"); if (gh_string_p (s) && !iv.empty_b()) { - output->add_molecule (lookup_l ()->bar (ly_scm2string (s), + output.add_molecule (lookup_l ()->bar (ly_scm2string (s), iv.length (), paper_l ())); } diff --git a/lily/staff-symbol.cc b/lily/staff-symbol.cc index 10d7927201..21123e75d9 100644 --- a/lily/staff-symbol.cc +++ b/lily/staff-symbol.cc @@ -15,8 +15,8 @@ -Molecule* -Staff_symbol::do_brew_molecule_p() const +Molecule +Staff_symbol::do_brew_molecule() const { Score_element * common = spanned_drul_[LEFT]->common_refpoint (spanned_drul_[RIGHT], X_AXIS); @@ -28,18 +28,18 @@ Staff_symbol::do_brew_molecule_p() const ; Real t = paper_l ()->get_var ("stafflinethickness"); - Molecule rule = lookup_l ()->filledbox (Box (Interval (0,width), - Interval (-t/2, t/2))); - int l = line_count (); Real height = (l-1) * staff_space () /2; - Molecule * m = new Molecule; + Molecule m; for (int i=0; i < l; i++) { - Molecule a (rule); + Molecule a = + lookup_l ()->filledbox (Box (Interval (0,width), + Interval (-t/2, t/2))); + a.translate_axis (height - i * staff_space (), Y_AXIS); - m->add_molecule (a); + m.add_molecule (a); } return m; diff --git a/lily/stem-tremolo.cc b/lily/stem-tremolo.cc index 57b35d875e..d6b2fcfa4c 100644 --- a/lily/stem-tremolo.cc +++ b/lily/stem-tremolo.cc @@ -42,8 +42,8 @@ Stem_tremolo::dim_callback (Dimension_cache const *c) } -Molecule* -Stem_tremolo::do_brew_molecule_p () const +Molecule +Stem_tremolo::do_brew_molecule () const { Stem * st = stem_l (); int mult =0; @@ -85,20 +85,20 @@ Stem_tremolo::do_brew_molecule_p () const abbrev_flags = gh_scm2int (a); } - Molecule *beams= new Molecule; + Molecule mol; for (int i = 0; i < abbrev_flags; i++) { Molecule b (a); b.translate_axis (interbeam_f * i, Y_AXIS); - beams->add_molecule (b); + mol.add_molecule (b); } - beams->translate_axis (-beams->extent ()[Y_AXIS].center (), Y_AXIS); + mol.translate_axis (-mol.extent ()[Y_AXIS].center (), Y_AXIS); if (st) { if (st->beam_l ()) { - beams->translate (Offset(st->hpos_f () - hpos_f (), + mol.translate (Offset(st->hpos_f () - hpos_f (), st->stem_end_position () * half_staff_space - directional_element (st->beam_l ()).get () * beams_i * interbeam_f)); } @@ -107,7 +107,7 @@ Stem_tremolo::do_brew_molecule_p () const /* Beams should intersect one beamthickness below staff end */ - Real dy = - beams->extent ()[Y_AXIS].length () / 2 * st->get_direction (); + Real dy = - mol.extent ()[Y_AXIS].length () / 2 * st->get_direction (); /* uhg. Should use relative coords and placement @@ -117,7 +117,7 @@ Stem_tremolo::do_brew_molecule_p () const : 0.0; dy += st->stem_end_position (); - beams->translate (Offset(st->hpos_f () - hpos_f ()+ + mol.translate (Offset(st->hpos_f () - hpos_f ()+ whole_note_correction, dy)); } @@ -127,7 +127,7 @@ Stem_tremolo::do_brew_molecule_p () const */ } - return beams; + return mol; } diff --git a/lily/stem.cc b/lily/stem.cc index 2061caf1c2..ce3312a9b1 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -444,10 +444,10 @@ Stem::dim_callback (Dimension_cache const* c) const Real ANGLE = 20* (2.0*M_PI/360.0); // ugh! -Molecule* -Stem::do_brew_molecule_p () const +Molecule +Stem::do_brew_molecule () const { - Molecule *mol_p =new Molecule; + Molecule mol; Staff_symbol_referencer_interface si (first_head ()); @@ -468,17 +468,17 @@ Stem::do_brew_molecule_p () const Real stem_width = paper_l ()->get_var ("stemthickness"); Molecule ss =lookup_l ()->filledbox (Box (Interval (-stem_width/2, stem_width/2), Interval (stem_y[DOWN]*dy, stem_y[UP]*dy))); - mol_p->add_molecule (ss); + mol.add_molecule (ss); } if (!beam_l () && abs (flag_i ()) > 2) { Molecule fl = flag (); fl.translate_axis(stem_y[get_direction ()]*dy, Y_AXIS); - mol_p->add_molecule (fl); + mol.add_molecule (fl); } - return mol_p; + return mol; } Real diff --git a/lily/text-item.cc b/lily/text-item.cc index 034173e7c5..ea0c6f2475 100644 --- a/lily/text-item.cc +++ b/lily/text-item.cc @@ -13,17 +13,15 @@ #include "paper-def.hh" #include "lookup.hh" -Molecule* -Text_item::do_brew_molecule_p () const +Molecule +Text_item::do_brew_molecule () const { SCM style = get_elt_property ("style"); String st = gh_string_p (style) ? ly_scm2string (style) : ""; SCM txt = get_elt_property ("text"); String t = gh_string_p (txt) ? ly_scm2string (txt) : ""; - Molecule a= paper_l ()->lookup_l(0)->text (st, t, paper_l ()); - - return new Molecule (a); + return paper_l ()->lookup_l(0)->text (st, t, paper_l ()); } diff --git a/lily/time-signature.cc b/lily/time-signature.cc index 24f0fa73f0..0c11decc33 100644 --- a/lily/time-signature.cc +++ b/lily/time-signature.cc @@ -19,8 +19,8 @@ Time_signature::Time_signature () } // ugh.! -Molecule* -Time_signature::do_brew_molecule_p () const +Molecule +Time_signature::do_brew_molecule () const { SCM st = get_elt_property ("style"); @@ -39,15 +39,15 @@ Time_signature::do_brew_molecule_p () const String style (ly_scm2string (st)); if (style[0]=='1') { - return new Molecule (time_signature (n, 0)); + return time_signature (n, 0); } else { - return new Molecule (special_time_signature (style, n, d)); + return special_time_signature (style, n, d); } } else - return new Molecule (time_signature (n,d)); + return time_signature (n,d); } Molecule diff --git a/lily/tuplet-spanner.cc b/lily/tuplet-spanner.cc index 766b636fe0..36782cb6fc 100644 --- a/lily/tuplet-spanner.cc +++ b/lily/tuplet-spanner.cc @@ -31,10 +31,10 @@ Tuplet_spanner::Tuplet_spanner () /* TODO. */ -Molecule* -Tuplet_spanner::do_brew_molecule_p () const +Molecule +Tuplet_spanner::do_brew_molecule () const { - Molecule* mol_p = new Molecule; + Molecule mol; // Default behaviour: number always, bracket when no beam! bool par_beam = to_boolean (get_elt_property ("parallel-beam")); @@ -82,7 +82,7 @@ Tuplet_spanner::do_brew_molecule_p () const num.translate_axis (dy/2, Y_AXIS); - mol_p->add_molecule (num); + mol.add_molecule (num); } Real thick = paper_l ()->get_var ("tuplet_thick"); @@ -99,12 +99,13 @@ Tuplet_spanner::do_brew_molecule_p () const gh_int2scm (dir), SCM_UNDEFINED); - mol_p->add_atom (at); + Box b; + mol.add_molecule (Molecule (b, at)); } - mol_p->translate_axis (dir * staff_space, Y_AXIS); + mol.translate_axis (dir * staff_space, Y_AXIS); } - return mol_p; + return mol; } void diff --git a/lily/volta-spanner.cc b/lily/volta-spanner.cc index fba5da4831..0fac7a6c23 100644 --- a/lily/volta-spanner.cc +++ b/lily/volta-spanner.cc @@ -32,16 +32,16 @@ Volta_spanner::Volta_spanner () /* FIXME: too complicated. */ -Molecule* -Volta_spanner::do_brew_molecule_p () const +Molecule +Volta_spanner::do_brew_molecule () const { - Molecule* mol_p = new Molecule; + Molecule mol; Link_array bar_arr = Group_interface__extract_elements (this, (Bar*)0, "bars"); if (!bar_arr.size ()) - return mol_p; + return mol; Link_array note_column_arr = Group_interface__extract_elements (this, (Score_element*)0, "note-columns"); @@ -68,8 +68,6 @@ Volta_spanner::do_brew_molecule_p () const Real w = spanner_length() - dx - get_broken_left_end_align (); Real h = paper_l()->get_var ("volta_spanner_height"); - Molecule volta; - SCM at = (gh_list (ly_symbol2scm ("volta"), gh_double2scm (h), gh_double2scm (w), @@ -77,10 +75,8 @@ Volta_spanner::do_brew_molecule_p () const gh_int2scm (no_vertical_start), gh_int2scm (no_vertical_end), SCM_UNDEFINED)); - - volta.dim_[Y_AXIS] = Interval (- h/2, h/2); - volta.dim_[X_AXIS] = Interval (0, w); - volta.add_atom (at); + Box b (Interval (- h/2, h/2), Interval (0, w)); + Molecule volta(b,at); Molecule num (lookup_l ()->text ("volta", ly_scm2string (get_elt_property("text")), @@ -103,10 +99,10 @@ Volta_spanner::do_brew_molecule_p () const Offset off (num.dim_.x ().length () + gap, h / half_staff_space - gap); num.translate (off); - mol_p->add_molecule (volta); - mol_p->add_molecule (num); - mol_p->translate (Offset (0, dy)); - return mol_p; + mol.add_molecule (volta); + mol.add_molecule (num); + mol.translate (Offset (0, dy)); + return mol; } void diff --git a/ly/params-as.ly b/ly/params-as.ly index 2a7838c996..974dae0b7b 100644 --- a/ly/params-as.ly +++ b/ly/params-as.ly @@ -67,6 +67,27 @@ slur_y_gap = 0.25 * \staffspace; slur_y_free = 0.75 * \staffspace; slur_x_minimum = 1.5 * \staffspace; + +% use tangent controls or area asymmetry? +bezier_area = 1.0; +bezier_asymmetry = 1.0; +bezier_beautiful = 2.0; + +% The constants that define the valid areas for the middle control points +% Used in de_uglyfy. Bit empirical. +bezier_control1 = 1.5; +bezier_control2 = 0.8; +bezier_control3 = -2.0; + +% URG: the magic constants for area asymmetry +bezier_pct_c0 = -0.2; +bezier_pct_c3 = 0.000006; +bezier_pct_out_max = 0.8; +bezier_pct_in_max = 1.2; +bezier_area_steps = 1.0; + +bezier_before_blowfit = 0.5; + %{ Like beams, slurs often aren't as steep as the notes they encompass. This sets the amount of damping. diff --git a/mf/as5.af b/mf/as5.af index a8fd2500e3..72159223f0 100644 --- a/mf/as5.af +++ b/mf/as5.af @@ -4,6 +4,12 @@ Comment (c) 2000 Jan Nieuwenhuizen + Comment Thanks go to out to participants in discussions on + Comment alt.ascii-art and rec.music.compose + + Comment noteheads-0 by llizard/ejm + Comment and Shaun Mead + Comment Lines that start with TAB or FF make up the .afm Comment TABs are comments Comment `Comment' is the afm comment prefix diff --git a/mf/as9.af b/mf/as9.af index c2597e9935..60af874e37 100644 --- a/mf/as9.af +++ b/mf/as9.af @@ -3,6 +3,16 @@ Comment part of LilyPond's [ascii music font] Comment (c) 2000 Jan Nieuwenhuizen + + Comment Thanks go to out to participants in discussions on + Comment alt.ascii-art and rec.music.compose + + Comment first noteheads-2 (although erroneously named) by + Comment Wesley Clifford + Comment rests-2 by Ben Norwood + Comment accidentals--1 and suggestions for noteheads by + Comment Ben Norwood + Comment Lines that start with TAB or FF make up the .afm Comment TABs are comments diff --git a/midi2ly/mudela-stream.cc b/midi2ly/mudela-stream.cc index 1ec52fc4a1..b185a9bbcd 100644 --- a/midi2ly/mudela-stream.cc +++ b/midi2ly/mudela-stream.cc @@ -100,7 +100,7 @@ Mudela_stream::header() *os_p_ << filename_str_g; *os_p_ << "\n\n"; // ugh - *os_p_ << "\\version \"1.2.7\";\n"; + *os_p_ << "\\version \"1.3.4\";\n"; } void