From cc288cebe296287d2f99c517869f96c646677f37 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Thu, 24 Feb 2000 18:30:43 +0100 Subject: [PATCH] release: 1.3.27 =========== * Bugfix: font used in volta-spanner calculation. * Added simple selection list to webpage, inspired by sawmill. * Devised kludge for ascii 5 character font pitches. * Substitutions: interline, 1997,1998, @stack.nl and small typo fixes. 1.3.26.h --- CHANGES | 45 +- Documentation/topdocs/index.tely | 19 + Documentation/user/refman.itely | 27 ++ TODO | 72 +-- VERSION | 4 +- input/bugs/b.ly | 2 + input/test/generic-output-property.ly | 10 + lily/dynamic-engraver.cc | 11 + lily/engraver.cc | 6 +- lily/group-interface.cc | 12 +- lily/include/group-interface.hh | 17 +- lily/include/output-property.hh | 27 ++ lily/include/request-iterator.hh | 3 +- lily/include/scm-hash.hh | 2 +- lily/include/score-element.hh | 3 + lily/include/translator.hh | 3 + lily/lily-guile.cc | 4 +- lily/moment.cc | 16 +- lily/music-iterator.cc | 11 +- lily/my-lily-lexer.cc | 1 + lily/output-property-engraver.cc | 66 +++ lily/output-property-engraver.hh | 61 +++ lily/output-property.cc | 16 + lily/paper-column.cc | 5 +- lily/paper-outputter.cc | 3 - lily/parser.yy | 21 +- lily/request-iterator.cc | 10 +- lily/scm-hash.cc | 6 +- lily/score-element.cc | 60 +++ lily/score-element.cc.orig | 649 -------------------------- lily/score-engraver.cc | 30 +- lily/score.cc | 12 +- lily/slur.cc | 10 +- lily/spacing-engraver.cc | 11 +- lily/staff-symbol-referencer.cc | 2 +- ly/engraver.ly | 11 +- make/out/lilypond.lsm | 8 +- make/out/lilypond.spec | 4 +- mf/feta-accordion.mf | 4 + scm/lily.scm | 20 + scripts/ly2dvi.py | 2 +- 41 files changed, 513 insertions(+), 793 deletions(-) create mode 100644 input/bugs/b.ly create mode 100644 input/test/generic-output-property.ly create mode 100644 lily/include/output-property.hh create mode 100644 lily/output-property-engraver.cc create mode 100644 lily/output-property-engraver.hh create mode 100644 lily/output-property.cc delete mode 100644 lily/score-element.cc.orig diff --git a/CHANGES b/CHANGES index eae8018ba1..d0896a7d87 100644 --- a/CHANGES +++ b/CHANGES @@ -1,9 +1,22 @@ ---- ../lilypond-1.3.26.hwn2/CHANGES Thu Feb 24 13:52:54 2000 -++ b/CHANGES Thu Feb 24 17:15:46 2000 -@@ -2,6 +2,14 @@ - 1.3.26.hwn2 - =========== +1.3.26.jcn2 +=========== + +* Bugfix: font used in volta-spanner calculation. + +* Added simple selection list to webpage, inspired by sawmill. +* Devised kludge for ascii 5 character font pitches. + +* Substitutions: interline, 1997,1998, @stack.nl and small typo fixes. + +1.3.26.hwn1 +=========== + +* Plug memory leaks related to Moment: + - Spacing_engraver::do_pre_move_processing () + - make_rational ()/make-rational + - Paper_column::Paper_column () + * Plug memory leak in Paper_outputter::output_{String,Real,int}_def() * Plug memory leak in Score_engraver::set_columns () @@ -12,24 +25,20 @@ * Plug memory leak in Score_element::molecule_extent () - * Bugfix: don't crash if a slur doesn't span anything. - - * Bugfix: don't crash if doing beams without a staff symbol.1.3.26.jcn2 -=========== +* Bugfix: don't crash if a slur doesn't span anything. -* Bugfix: font used in volta-spanner calculation. +* Bugfix: don't crash if doing beams without a staff symbol. -* Added simple selection list to webpage, inspired by sawmill. +* Generic element property setting: -1.3.26.jcn1 -=========== + \outputproperty #predicate #'symbol = #value -* Devised kludge for ascii 5 character font pitches. - -* Substitutions: interline, 1997,1998, @stack.nl and small typo fixes. +Will set the element property symbol to value, for any elements that +return true for PREDICATE. This allows you to virtually tweak *ANY* +property of the output. Example in input/test/generic-output-property.ly -1.3.25.jcn2 -=========== +1.3.26 +====== * lilypond as as2ly: --help and --version to stdout. Regular identify to stderr. This fixes help2man's manpage generation. diff --git a/Documentation/topdocs/index.tely b/Documentation/topdocs/index.tely index 90142fb51e..e87837690f 100644 --- a/Documentation/topdocs/index.tely +++ b/Documentation/topdocs/index.tely @@ -144,6 +144,25 @@ If you have questions, do write to the mailing lists! (But don't forget to read the @uref{Documentation/out-www/faq.html, Frequently Asked Questions} first.) +@html +

+[ + Download + | + FAQ + | + Documentation + | + Music archives + | + Mailing lists + | + + Regression test + | + News +] +@end html @table @samp @item info-gnu-music@@gnu.org diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index 4a5a95c7a2..1d222f5953 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -784,6 +784,33 @@ Usually this is used to switch staffs in Piano music, e.g. @end example +@cindex output properties + + +These allow you to tweak what is happening in the back-end +directly. If you want to control every detail of the output +formatting, this is the feature to use. The downside to this is that +you need to know exactly how the backend works. Example: + + +@mudela[fragment,verbatim] +\relative c'' { c4 + \context Staff \outputproperty + #(make-type-checker 'Note_head) + #'extra-offset = #'(5.0 . 7.5) + } +@end mudela + +This selects all note heads occurring at current staff level, and sets +the extra-offset of those heads to (5,7.5), shifting them up and +right. + +Use of this feature is entirely on your own risk: if you use this, the +result will depend very heavily on the implentation of the backend, +which we change unscrupulously. + + + @cindex commands diff --git a/TODO b/TODO index 1f0b03638b..9fb9933e9f 100644 --- a/TODO +++ b/TODO @@ -19,6 +19,30 @@ Grep -i for TODO, FIXME and ugh/ugr/urg. . * change ) c4 to c4-) . * internationalize GUILE msgs. . * unbroken marks. +. * chubb: +-- Take a piece of early music, and typeset it as closely as possible to +the original edition. This means: moveable clefs, sometimes funny or no +time signatures, few or no bar lines, few or no ties, slurs or +phrasemarks, ornaments implied by the structure of the music, or +indicated by, e.g., one or more thick lines through the stem of a note +(Purcell and Farnaby both use this extensively, but with rather +different meanings). For Dowland's music it may also mean being able +to rotate one or more staves (but I can do this in LaTeX). + +-- Add to this music a set of critical marks that: + * regularises clef, time and key signature. + * add slurs, phrase marks, articulation, etc. + * Halve or quarter the durations, so that minims become crotchets, say. + * add ornaments (mordents, trills, turns etc) + * add regular barlines (which sometimes will mean splitting a note + and adding a tie, e.g., in some of Byrd's music) + * Add footnotes to particular symbols, groups of notes, etc. + * When translating from chant notation, add a square bracket over a + group of notes to indicate a ligature in the original +etc. + * Discretionary sharp or flat signs, for Musica Ficta + +-- print out both editions from the same source. . * write smobifying howto. . * put property test files in refman. . * alignment within @itemize @@ -28,7 +52,6 @@ Grep -i for TODO, FIXME and ugh/ugr/urg. . * \grace { c d } c1 in midi . * \prop slurdir in grace notes . * Make fingering and playing instructions Music_wrappers? -. * \eltproperty "=Context" "Elt_name" "prop-name" #value . * script columns . * Must stop before this music ends: verse=\lyrics { @@ -72,9 +95,6 @@ level elements (key, clef, meter, etc). This construction makes - if I change the property minVerticalAlign in a multi staff score with lyrics the change affects the lyrics too. I would like the change to _only_ affect staves. - -- I would like to be able to influence the sloping of xtuplet brackets - - after the leading measure in the above mentioned score I want a double bar line fully drawn across the staves and after that keep to the ChoirStaff bar line types in the rest of the scores @@ -102,8 +122,6 @@ ChoirStaff bar line types in the rest of the scores . * [c8. c16 c16 c16] in 6/8 timesig. . * Rewrite Stem, Beam (hairy) . * beams over barlines -. * Rests and beams don't work too well together. Example: - [ r8 g''16 des'] [r8 c16 a] . * autoBeamMelisma: if I explicitly beam notes in a staff with auto beaming disabled I would like to have these beams also to be melismatic. @@ -193,12 +211,10 @@ repeated section with different words for each repeat. . * \selectmusic to cut pieces from music. . * formatting of input stuff. . * deps for ly2dvi -. * TODO: merge atom & molecule; make tree from molecule. . * Align_element::padding ? . * use streambufs and iostream to provide IO handling for TeX stream, mudela stream, data-file. . * seriously buffer TeX output (do profile of writing .5 mb TeX file.) -. * fix partial measures in meaningful way. . * uniformise recent feta contributions. . * bigger and fatter 4/4 C . * relative mode for midi2ly @@ -216,10 +232,6 @@ to provide IO handling for TeX stream, mudela stream, data-file. . * text-items clash with stems/beams . * --include, -I option for ly2dvi (pass on to lily) . * fix placement of beam-less abbrev -. * \meter 3/4; - <{\voiceone cis4. cis8 cis4 | cis4 cis cis | r1 } - {\voicetwo cis,4 r r | r2. | r1 }> | - } . * Musical_pitch (analogous to Duration and Rhythmic_req) think about, analogous to pitch: * { a4 a16 } c <-- duration of c? @@ -236,15 +248,12 @@ to provide IO handling for TeX stream, mudela stream, data-file. I understand the implementation of repeats well enough. . * add mudela-book-doc source to webstie. . * fix singleStaffBracket -. * rename -. * partial -> anacrouse . * move paper vars into engraver properties . * add new glyphs to font.ly . * more intelligent file searching . * disable spaces in TeX stuff . * handle ^C for tmp/file creation. . * make LilyPond RPM fully relocatable -. * better hshift (dots, distance, head dependent) . * didot / big point. . * clefs (AG): The "8" should appear closer to the actual clef, touching it. @@ -254,6 +263,7 @@ touching it. .* FONT . * the bracket is ugly (wings are too parabolic, should be more circular) +. * fix accordion turning paths. . * versioning for Feta . * rewrite dynamic signs. They're kind of spaghetti now. . * The `3' in the meter key is a one or two pixels too thin (at 600dpi) @@ -267,7 +277,6 @@ touching it. . * work out sizes of character fonts. . * more symbols . * piano pedals: Ped/* -. * maxima notehead . * coda signs: Segno, O+ . * glissando, arpeggio . * lengthened trill @@ -286,34 +295,11 @@ touching it. do_one_file(String,String) [scores.cc:124] Reading 4 bytes from 0xefffeca8 on the stack. Address 0xefffeca8 is 728 bytes below frame pointer in function -. * Array axeses; - - for (int i=0; i < loose_elems.size (); i++) - { - Score_element* elt = loose_elems[i]; - /* - with which axes do we have to meddle? - */ - int j =0; - Axis as [2]; - for (int a = X_AXIS; a < NO_AXES; ++a) - if (elt->parent_l (Axis (a)) == this) - as[j++] = Axis (a); - if (j == 1) - as[j++] = as[0]; - - axeses.push (as); - } - . * patch: don't touch timestamp if all patches fail. . * MetaPost: should not generate setgray for unfill -. * check out GCC signatures? . * glibc 2.0: f = fopen ("/dev/null", "r") assert (feof (f)) -. * tetex: mfplain.mem -> INSTALL -. * mfplain.ini not in tetex 0.9 -> INSTALL - .* PROJECTS . * Scripts: @@ -365,14 +351,6 @@ touching it. . * output header info to MIDI too. . * dump \header into easily parsable format. -. * a musical dictionary. See Documentation/vocabulary-*, other -languages: -. * explanations -. * italian -. * german -. * dutch -. * swedish - . * chords . * guitar chords (fret diagrams) . * other chord name styles (american(?) style) diff --git a/VERSION b/VERSION index 6ea5f58835..4e6268cb09 100644 --- a/VERSION +++ b/VERSION @@ -1,8 +1,8 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 -PATCH_LEVEL=26 -MY_PATCH_LEVEL=hwn3 +PATCH_LEVEL=27 +MY_PATCH_LEVEL= # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/input/bugs/b.ly b/input/bugs/b.ly new file mode 100644 index 0000000000..87ff53e5a3 --- /dev/null +++ b/input/bugs/b.ly @@ -0,0 +1,2 @@ + +\score { \notes <{ [ r8 g''16 des'] [r8 c16 a] }>} diff --git a/input/test/generic-output-property.ly b/input/test/generic-output-property.ly new file mode 100644 index 0000000000..3a7661efcc --- /dev/null +++ b/input/test/generic-output-property.ly @@ -0,0 +1,10 @@ + +\score +{ +\notes { + c''4 + \outputproperty #(make-type-checker 'Note_head) #'staff-position = #20 + c''4 + +} +} diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index c6c35a908f..7f519db38b 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -18,6 +18,7 @@ #include "engraver.hh" #include "stem.hh" #include "note-head.hh" +#include "group-interface.hh" /** print text & hairpin dynamics. @@ -36,6 +37,9 @@ public: Dynamic_engraver(); protected: + + void announce_element (Score_element_info); + virtual void do_removal_processing (); virtual void acknowledge_element (Score_element_info); virtual bool do_try_music (Music *req_l); @@ -45,6 +49,13 @@ protected: virtual void typeset_element (Score_element*); }; +void +Dynamic_engraver::announce_element (Score_element_info i) +{ + group (i.elem_l_, "interfaces").add_thing (ly_symbol2scm ("dynamic")); + + Engraver::announce_element (i); +} Dynamic_engraver::Dynamic_engraver() diff --git a/lily/engraver.cc b/lily/engraver.cc index 7b2fb0c90c..40bc87f9c1 100644 --- a/lily/engraver.cc +++ b/lily/engraver.cc @@ -1,7 +1,7 @@ /* engraver.cc -- implement Engraver - Sourcefile of GNU LilyPond musictypesetter + Sourcefile of GNU LilyPond music type setter (c) 1997--2000 Han-Wen Nienhuys */ @@ -13,6 +13,7 @@ #include "debug.hh" #include "paper-def.hh" #include "score-element.hh" +#include "group-interface.hh" void Engraver::fill_staff_info (Staff_info&) @@ -23,6 +24,9 @@ Engraver::fill_staff_info (Staff_info&) void Engraver::announce_element (Score_element_info i) { + Score_element * e = i.elem_l_; + group (e, "interfaces").add_thing (ly_symbol2scm (e->name())); + if (!i.origin_trans_l_) i.origin_trans_l_ = this; daddy_grav_l()->announce_element (i); diff --git a/lily/group-interface.cc b/lily/group-interface.cc index d9ae970c19..628a9fff58 100644 --- a/lily/group-interface.cc +++ b/lily/group-interface.cc @@ -35,11 +35,19 @@ Group_interface::add_element (Score_element*p) { p->used_b_ = true; elt_l_->used_b_ = true; - + + add_thing (p->self_scm_); +} + +void +Group_interface::add_thing (SCM s) +{ elt_l_->set_elt_property (name_, - gh_cons (p->self_scm_, elt_l_->get_elt_property (name_))); + gh_cons (s, elt_l_->get_elt_property (name_))); + } + int Group_interface::count () { diff --git a/lily/include/group-interface.hh b/lily/include/group-interface.hh index bf461a4052..eb21db6ee6 100644 --- a/lily/include/group-interface.hh +++ b/lily/include/group-interface.hh @@ -15,6 +15,15 @@ #include "lily-guile.hh" #include "smobs.hh" +/* + rename to list interface? + */ + +/** + Look at Score element ELT as thing which has a list property called + NAME_. Normally the list would contain Score_elements, but + sometimes it can be different things. +*/ struct Group_interface { Score_element * elt_l_; @@ -23,6 +32,7 @@ public: Group_interface (Score_element const*); Group_interface (Score_element const*, String); int count (); + void add_thing (SCM); bool has_interface_b (); void set_interface (); void add_element (Score_element*); @@ -31,10 +41,9 @@ public: Group_interface group (Score_element*); Group_interface group (Score_element*, String); -/* - template - Link_array Group_interface__extract_elements (T *, String name); -*/ +/** + Put all score elements of ELT's property called NAME into an array, + and return it. */ template Link_array Group_interface__extract_elements (Score_element const *elt, T *, String name) diff --git a/lily/include/output-property.hh b/lily/include/output-property.hh new file mode 100644 index 0000000000..f266642eb2 --- /dev/null +++ b/lily/include/output-property.hh @@ -0,0 +1,27 @@ +/* + output-property.hh -- declare Output_property + + source file of the GNU LilyPond music typesetter + + (c) 2000 Han-Wen Nienhuys + + */ + +#ifndef OUTPUT_PROPERTY_HH +#define OUTPUT_PROPERTY_HH + +#include "music.hh" +#include "protected-scm.hh" + +class Output_property : public Music +{ +public: + Output_property(SCM, SCM, SCM); + + /** + relevant stuff: the predicate, the symbol, the value + */ + Protected_scm pred_sym_val_list_; +}; + +#endif /* OUTPUT_PROPERTY_HH */ diff --git a/lily/include/request-iterator.hh b/lily/include/request-iterator.hh index 53a7a76070..ea2b07b026 100644 --- a/lily/include/request-iterator.hh +++ b/lily/include/request-iterator.hh @@ -12,10 +12,9 @@ #include "music-iterator.hh" -class Request_iterator : public Music_iterator +class Simple_music_iterator : public Music_iterator { public: - Request_iterator (); protected: virtual void do_process_and_next (Moment ); }; diff --git a/lily/include/scm-hash.hh b/lily/include/scm-hash.hh index 3bc455f88a..0a15bfce9a 100644 --- a/lily/include/scm-hash.hh +++ b/lily/include/scm-hash.hh @@ -27,7 +27,7 @@ public: WARNING: putting something in assumes responsibility for cleaning up. */ void set (SCM k, SCM v); - SCM get (SCM k); + SCM get (SCM k) const; Scheme_hash_table (); void operator = (Scheme_hash_table const &); diff --git a/lily/include/score-element.hh b/lily/include/score-element.hh index f37990f7ee..2a962607fd 100644 --- a/lily/include/score-element.hh +++ b/lily/include/score-element.hh @@ -154,6 +154,9 @@ protected: static Interval dim_cache_callback (Dimension_cache const*); public: + static SCM ly_set_elt_property (SCM, SCM,SCM); + static SCM ly_get_elt_property (SCM, SCM); + virtual void handle_broken_dependencies (); virtual void handle_prebroken_dependencies (); diff --git a/lily/include/translator.hh b/lily/include/translator.hh index 6c4e314941..df5f253254 100644 --- a/lily/include/translator.hh +++ b/lily/include/translator.hh @@ -67,6 +67,9 @@ public: virtual Moment now_mom () const; protected: + /* + UGH. Clean this up. + */ enum { ORPHAN, VIRGIN, diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index e317ea5438..036bd19039 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -220,7 +220,7 @@ ly_isdir_p (SCM s) } -void +static void init_functions () { scm_make_gsubr ("ly-warn", 1, 0, 0, (SCM(*)(...))ly_warning); @@ -310,9 +310,7 @@ to_boolean (SCM s) /* Appendable list L: the cdr contains the list, the car the last cons in the list. - */ - SCM appendable_list () { diff --git a/lily/moment.cc b/lily/moment.cc index ebe3b0b190..3d7a69474e 100644 --- a/lily/moment.cc +++ b/lily/moment.cc @@ -39,21 +39,27 @@ Moment::print_smob (SCM s, SCM port, scm_print_state *) void Moment::do_smobify_self () -{} +{ +} SCM make_rational (SCM n, SCM d) { + Moment *r; + SCM retval = SCM_EOL; if (SCM_INUMP (n) && SCM_INUMP(d)) { - Moment *r = new Moment (gh_scm2int (n), gh_scm2int (d)); - return r->smobify_self (); + r= new Moment (gh_scm2int (n), gh_scm2int (d)); } else { - ::error ("Not a number"); - assert(false); + ::error ("make-moment takes two integer arguments."); + r = new Moment (1,1); } + + retval = r->smobify_self (); + scm_unprotect_object (r->self_scm_); + return retval ; } #include "ly-smobs.icc" diff --git a/lily/music-iterator.cc b/lily/music-iterator.cc index 590271201c..edbb722e24 100644 --- a/lily/music-iterator.cc +++ b/lily/music-iterator.cc @@ -5,6 +5,10 @@ (c) 1997--2000 Han-Wen Nienhuys */ + +/* + UGH. too many includes. + */ #include "debug.hh" #include "music-list.hh" #include "music-iterator.hh" @@ -32,6 +36,7 @@ #include "auto-change-iterator.hh" #include "request.hh" #include "request-iterator.hh" +#include "output-property.hh" void Music_iterator::do_print() const @@ -149,12 +154,10 @@ Music_iterator::static_get_iterator_p (Music const *m) else p = new Unfolded_repeat_iterator; } - else if (Request const * r = dynamic_cast (m)) + else { - p = new Request_iterator ; + p = new Simple_music_iterator ; } - else - assert (0); p->music_l_ = m; return p; diff --git a/lily/my-lily-lexer.cc b/lily/my-lily-lexer.cc index f413a5dc9a..0e74531f07 100644 --- a/lily/my-lily-lexer.cc +++ b/lily/my-lily-lexer.cc @@ -57,6 +57,7 @@ static Keyword_ent the_key_tab[]={ {"name", NAME}, {"notenames", NOTENAMES}, {"notes", NOTES}, + {"outputproperty", OUTPUTPROPERTY}, {"partial", PARTIAL}, {"paper", PAPER}, {"penalty", PENALTY}, diff --git a/lily/output-property-engraver.cc b/lily/output-property-engraver.cc new file mode 100644 index 0000000000..6f0b6cf88f --- /dev/null +++ b/lily/output-property-engraver.cc @@ -0,0 +1,66 @@ +/* + output-property-engraver.cc -- implement Output_property_engraver + + source file of the GNU LilyPond music typesetter + + (c) 2000 Han-Wen Nienhuys + + */ + +#include "output-property.hh" +#include "engraver.hh" +#include "score-element.hh" + +class Output_property_engraver : public Engraver +{ +public: + VIRTUAL_COPY_CONS(Translator); +protected: + + Link_array props_; + + virtual void do_pre_move_processing (); + virtual void acknowledge_element (Score_element_info); + virtual bool do_try_music (Music*); +}; + + +bool +Output_property_engraver::do_try_music (Music* m) +{ + if (Output_property * o = dynamic_cast (m)) + { + props_.push (o); + return true; + } + return false; +} + +void +Output_property_engraver::acknowledge_element (Score_element_info inf) +{ + for (int i=props_.size (); i--; ) + { + Output_property * o = props_[i]; + SCM pred = gh_car (o->pred_sym_val_list_); + /* + should typecheck pred. + */ + SCM result=gh_apply (pred, + gh_list (inf.elem_l_->self_scm_, SCM_UNDEFINED)); + if (to_boolean (result)) + { + Score_element::ly_set_elt_property (inf.elem_l_->self_scm_, + gh_cadr (o->pred_sym_val_list_), + gh_caddr (o->pred_sym_val_list_)); + } + } +} + +void +Output_property_engraver::do_pre_move_processing () +{ + props_.clear (); +} + +ADD_THIS_TRANSLATOR(Output_property_engraver); diff --git a/lily/output-property-engraver.hh b/lily/output-property-engraver.hh new file mode 100644 index 0000000000..ef30fdf091 --- /dev/null +++ b/lily/output-property-engraver.hh @@ -0,0 +1,61 @@ +/* + output-property-engraver.cc -- implement Output_property_engraver + + source file of the GNU LilyPond music typesetter + + (c) 2000 Han-Wen Nienhuys + + */ + +#include "output-property.hh" +#include "engraver.hh" + +class Output_property_engraver : public Engraver +{ +public: + Output_property_engraver(); + VIRTUAL_COPY_CONS(Translator); +protected: + + Link_array props_; + + virtual void do_acknowledge_element (Score_element_info); + virtual bool do_try_music (Music*); +}; + + +Output_property_engraver::do_try_music (Music* m) +{ + if (Output_property * o = dynamic_cast (m)) + { + props_.push (m); + return true; + } + return false; +} + +void +Output_property_engraver::do_acknowledge_element (Score_element_info i) +{ + for (int i=props_.size (); i--; ) + { + Output_property * o = props_[i]; + SCM pred = gh_car (o->pred_sym_val_list_); + /* + should typecheck pred. + */ + SCM result=gh_apply (pred, + gh_listify (i.elem_l_->self_scm_, SCM_UNDEFINED)); + if (to_boolean (result)) + { + i.elem_l_->set_elt_property (gh_cadr (o->pred_sym_val_list_), + gh_caddr (o->pred_sym_val_list_)); + } + } +} + +void +Output_property_engraver::do_pre_move_processing () +{ + props_.clear (); +} diff --git a/lily/output-property.cc b/lily/output-property.cc new file mode 100644 index 0000000000..e8a2d6a463 --- /dev/null +++ b/lily/output-property.cc @@ -0,0 +1,16 @@ +/* + output-property.cc -- implement Output_property + + source file of the GNU LilyPond music typesetter + + (c) 2000 Han-Wen Nienhuys + + */ +#include "output-property.hh" +#include "lily-guile.hh" + +Output_property::Output_property(SCM pred, SCM sym, SCM val) +{ + pred_sym_val_list_ = gh_list (pred, sym, val, SCM_UNDEFINED); +} + diff --git a/lily/paper-column.cc b/lily/paper-column.cc index 7b3309513b..59d61683ab 100644 --- a/lily/paper-column.cc +++ b/lily/paper-column.cc @@ -122,7 +122,10 @@ Paper_column::column_l () const Paper_column::Paper_column (Moment w) { - set_elt_property ("when", (new Moment (w))->smobify_self ()); + SCM when = (new Moment (w))->smobify_self ();; + scm_unprotect_object (when); + set_elt_property ("when", when); + set_axes (X_AXIS, X_AXIS); line_l_=0; diff --git a/lily/paper-outputter.cc b/lily/paper-outputter.cc index 40a4b966fe..c8dbed177d 100644 --- a/lily/paper-outputter.cc +++ b/lily/paper-outputter.cc @@ -222,9 +222,6 @@ Paper_outputter::dump_onto (Paper_stream *ps) *ps << c; free (c); } - cout << "\nCells in use: " << scm_cells_allocated << endl; - cout << "protects " << scm_ilength (scm_protects) << endl; - } } diff --git a/lily/parser.yy b/lily/parser.yy index a3a54d31f9..83669c3717 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -41,6 +41,7 @@ #include "mudela-version.hh" #include "grace-music.hh" #include "auto-change-music.hh" +#include "output-property.hh" // mmm Mudela_version oldest_version ("1.3.4"); @@ -111,7 +112,6 @@ of the parse stack onto the heap. */ Translator_group* trans; char c; int i; - int ii[10]; } %{ @@ -182,6 +182,7 @@ yylex (YYSTYPE *s, void * v_l) %token SPANREQUEST %token COMMANDSPANREQUEST %token TEMPO +%token OUTPUTPROPERTY %token TIME_T %token TIMES %token TRANSLATOR @@ -558,13 +559,13 @@ paper_def_body: if (!gh_symbol_p ($2)) THIS->parser_error ("expect a symbol as lvalue"); else - $$->default_properties_[$2] = $4; + $$->default_properties_.set ($2, $4); } | paper_def_body SCM_T '=' real semicolon { if (!gh_symbol_p ($2)) THIS->parser_error ("expect a symbol as lvalue"); else - $$->default_properties_[$2] = gh_double2scm ($4); + $$->default_properties_.set ($2, gh_double2scm ($4)); } | paper_def_body translator_spec_block { $$->assign_translator ($2); @@ -742,6 +743,20 @@ Simultaneous_music: Simple_music: request_chord { $$ = $1; } + | OUTPUTPROPERTY embedded_scm embedded_scm '=' embedded_scm { + SCM pred = $2; + if (!gh_symbol_p ($3)) + { + THIS->parser_error (_("Second argument must be a symbol")); + } + /*hould check # args */ + if (!gh_procedure_p (pred)) + { + THIS->parser_error (_("First argument must be a procedure taking 1 argument")); + } + + $$ = new Output_property (pred,$3, $5); + } | MUSIC_IDENTIFIER { $$ = $1->access_content_Music (true); } | property_def | translator_change diff --git a/lily/request-iterator.cc b/lily/request-iterator.cc index 94d5e90dcc..6cefe8b5b5 100644 --- a/lily/request-iterator.cc +++ b/lily/request-iterator.cc @@ -1,5 +1,5 @@ /* - request-iterator.cc -- implement + request-iterator.cc -- implement Simple_music_iterator source file of the GNU LilyPond music typesetter @@ -9,19 +9,15 @@ #include "request-iterator.hh" #include "music.hh" -Request_iterator::Request_iterator() -{ -} - void -Request_iterator::do_process_and_next (Moment m) +Simple_music_iterator::do_process_and_next (Moment m) { if (first_b_) { bool g= try_music (music_l_); if (!g) - music_l_->warning (_f ("Junking request: `%s'", classname(music_l_))); + music_l_->warning (_f ("Junking music: `%s'", classname(music_l_))); first_b_ = false; } diff --git a/lily/scm-hash.cc b/lily/scm-hash.cc index ca0920fd42..e864d60875 100644 --- a/lily/scm-hash.cc +++ b/lily/scm-hash.cc @@ -65,7 +65,7 @@ Scheme_hash_table::print_smob (SCM s, SCM p, scm_print_state*) { assert (SMOB_IS_TYPE_B (Scheme_hash_table, s)); char str[1000]; - sprintf (str, "# i (*me); i.ok(); i++) @@ -88,9 +88,9 @@ Scheme_hash_table::set (SCM k, SCM v) } SCM -Scheme_hash_table::get (SCM k) +Scheme_hash_table::get (SCM k)const { - return elem (k); + return const_elem (k); } diff --git a/lily/score-element.cc b/lily/score-element.cc index 5a46ce458c..cfa1bfd569 100644 --- a/lily/score-element.cc +++ b/lily/score-element.cc @@ -51,6 +51,7 @@ Score_element::Score_element() set_elt_property ("dependencies", SCM_EOL); + set_elt_property ("interfaces", SCM_EOL); } SCM ly_deep_copy (SCM); @@ -651,3 +652,62 @@ Score_element::equal_p (SCM a, SCM b) { return gh_cdr(a) == gh_cdr(b) ? SCM_BOOL_T : SCM_BOOL_F; } + + +SCM +Score_element::ly_set_elt_property (SCM elt, SCM sym, SCM val) +{ + Score_element * sc = unsmob_element (elt); + + if (!gh_symbol_p (sym)) + { + error ("Not a symbol"); + ly_display_scm (sym); + return SCM_UNDEFINED; + } + + if (sc) + { + sc->element_property_alist_ = scm_assoc_set_x (sc->element_property_alist_, sym, val); + } + else + { + error ("Not a score element"); + ly_display_scm (elt); + } + + return SCM_UNDEFINED; +} + + +SCM +Score_element::ly_get_elt_property (SCM elt, SCM sym) +{ + Score_element * sc = unsmob_element (elt); + + if (sc) + { + SCM s = scm_assq(sym, sc->element_property_alist_); + + if (s != SCM_BOOL_F) + return gh_cdr (s); + else + return SCM_UNDEFINED; + } + else + { + error ("Not a score element"); + ly_display_scm (elt); + } + return SCM_UNDEFINED; +} + + +static void +init_functions () +{ + scm_make_gsubr ("ly-get-elt-property", 2, 0, 0, (SCM(*)(...))Score_element::ly_get_elt_property); + scm_make_gsubr ("ly-set-elt-property", 3, 0, 0, (SCM(*)(...))Score_element::ly_set_elt_property); +} + +ADD_SCM_INIT_FUNC(scoreelt, init_functions); diff --git a/lily/score-element.cc.orig b/lily/score-element.cc.orig deleted file mode 100644 index 42a7d083c2..0000000000 --- a/lily/score-element.cc.orig +++ /dev/null @@ -1,649 +0,0 @@ -/* - score-elem.cc -- implement Score_element - - source file of the GNU LilyPond music typesetter - - (c) 1997--2000 Han-Wen Nienhuys -*/ - - -#include - -#include "group-interface.hh" -#include "misc.hh" -#include "paper-score.hh" -#include "paper-def.hh" -#include "lookup.hh" -#include "molecule.hh" -#include "score-element.hh" -#include "debug.hh" -#include "spanner.hh" -#include "line-of-score.hh" -#include "item.hh" -#include "paper-column.hh" -#include "molecule.hh" -#include "misc.hh" -#include "paper-outputter.hh" -#include "dimension-cache.hh" -#include "side-position-interface.hh" -#include "item.hh" - -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; - - used_b_ = false; - - dim_cache_[X_AXIS]->set_callback (molecule_extent); - dim_cache_[Y_AXIS]->set_callback (molecule_extent); - used_b_ = false; - pscore_l_=0; - lookup_l_ =0; - status_i_ = 0; - self_scm_ = SCM_EOL; - original_l_ = 0; - element_property_alist_ = SCM_EOL; - - smobify_self (); - - - set_elt_property ("dependencies", SCM_EOL); -} - -SCM ly_deep_copy (SCM); - -SCM -ly_deep_copy (SCM l) -{ - if (gh_pair_p (l)) - { - return gh_cons (ly_deep_copy (gh_car (l)), ly_deep_copy (gh_cdr (l))); - } - else - return l; -} - - -Score_element::Score_element (Score_element const&s) -{ - dim_cache_[X_AXIS] = new Dimension_cache (*s.dim_cache_[X_AXIS]); - dim_cache_[Y_AXIS] = new Dimension_cache (*s.dim_cache_[Y_AXIS]); - dim_cache_[X_AXIS]->elt_l_ = dim_cache_[Y_AXIS]->elt_l_ = this; - - self_scm_ = SCM_EOL; - used_b_ = true; - original_l_ =(Score_element*) &s; - - /* - should protect because smobify_self () might trigger GC. - */ - SCM onstack = ly_deep_copy (s.element_property_alist_); - element_property_alist_ = onstack; - - output_p_ =0; - status_i_ = s.status_i_; - lookup_l_ = s.lookup_l_; - pscore_l_ = s.pscore_l_; - - smobify_self (); -} - -Score_element::~Score_element() -{ - assert (!output_p_); - assert (status_i_ >=0); - status_i_ = -1; - - delete dim_cache_[X_AXIS]; - delete dim_cache_[Y_AXIS]; -} - - -Real -Score_element::get_real (String s) const -{ - return gh_scm2double (get_elt_property (s)); -} - -void -Score_element::set_real (String s, Real r) -{ - set_elt_property (s, gh_double2scm (r)); -} - -// should also have one that takes SCM arg. -SCM -Score_element::get_elt_property (String nm) const -{ - SCM sym = ly_symbol2scm (nm.ch_C()); - SCM s = scm_assq(sym, element_property_alist_); - - if (s != SCM_BOOL_F) - return gh_cdr (s); - - if (pscore_l_) - { - SCM sym2 = ly_symbol2scm ((name () + ("::" + nm)).ch_C()); - SCM val; - - // should probably check for Type::sym as well. - 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_UNDEFINED; -} - -SCM -Score_element::remove_elt_property (String key) -{ - SCM s = get_elt_property (key); - SCM sym = ly_symbol2scm (key.ch_C()); - element_property_alist_ = scm_assq_remove_x (element_property_alist_, sym); - return s; -} - -/* - UGH. assoc vs. assq - */ -void -Score_element::set_elt_property (String k, SCM v) -{ - SCM s = ly_symbol2scm (k.ch_C( )); - element_property_alist_ = scm_assoc_set_x (element_property_alist_, s, v); -} - -Interval -Score_element::molecule_extent(Dimension_cache const *c) -{ - Score_element *s = dynamic_cast(c->element_l()); - Molecule*m = s->do_brew_molecule_p(); - return m->extent()[c->axis ()]; -} - - -void -Score_element::print() const -{ -#ifndef NPRINT - DEBUG_OUT << classname(this) << "{\n"; - - if (flower_dstream && !flower_dstream->silent_b ("Score_element")) - ly_display_scm (element_property_alist_); - - if (original_l_) - DEBUG_OUT << "Copy "; - do_print(); - - DEBUG_OUT << "}\n"; -#endif -} - -Paper_def* -Score_element::paper_l () const -{ - return pscore_l_ ? pscore_l_->paper_l_ : 0; -} - -Lookup const * -Score_element::lookup_l () const -{ - if (!lookup_l_) - { - Score_element * urg = (Score_element*)this; - SCM sz = urg->remove_elt_property ("fontsize"); - int i = (gh_number_p (sz)) - ? gh_scm2int (sz) - : 0; - - urg->lookup_l_ = (Lookup*)pscore_l_->paper_l_->lookup_l (i); - } - return lookup_l_; -} - -void -Score_element::add_processing() -{ - assert (status_i_ >=0); - if (status_i_) - return; - status_i_ ++; - -#if 0 - /* - UGH. UGH. UGH. - */ - if (get_elt_property ("self-alignment-X") != SCM_UNDEFINED - && !dim_cache_[X_AXIS]->off_callback_l_) - { - dim_cache_[X_AXIS]->off_callbacks_.push (Side_position_interface::aligned_on_self); - } - - if (get_elt_property ("self-alignment-Y") != SCM_UNDEFINED - && !dim_cache_[X_AXIS]->off_callback_l_) - - { - dim_cache_[Y_AXIS]->set_offset_callback (Side_position_interface::aligned_on_self); - } -#endif - - do_add_processing(); -} - -void -Score_element::calculate_dependencies (int final, int busy, - Score_element_method_pointer funcptr) -{ - assert (status_i_ >=0); - - if (status_i_ >= final) - return; - - assert (status_i_!= busy); - status_i_= busy; - - Link_array dependency_arr = - Group_interface__extract_elements (this, (Score_element*)0, "dependencies"); - - for (int i=0; i < dependency_arr.size(); i++) - dependency_arr[i]->calculate_dependencies (final, busy, funcptr); - - Link_array extra (get_extra_dependencies()); - for (int i=0; i < extra.size(); i++) - extra[i]->calculate_dependencies (final, busy, funcptr); - - (this->*funcptr)(); - status_i_= final; -} - -void -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 (); - 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, - classname(this)); - - delete output_p_; - output_p_ =0; -} - -/* - - VIRTUAL STUBS - - */ -void -Score_element::do_break_processing() -{ -} - -void -Score_element::do_post_processing() -{ -} - -void -Score_element::do_breakable_col_processing() -{ - handle_prebroken_dependencies(); -} - -void -Score_element::do_pre_processing() -{ -} - -void -Score_element::do_space_processing () -{ -} - -void -Score_element::do_add_processing() -{ -} - - - -Molecule* -Score_element::do_brew_molecule_p() 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 output; - } - else - { - Interval emp; - emp.set_empty (); - Molecule a (lookup_l ()->fill (Box (emp,emp))); - return new Molecule (a); - } -} - - -Line_of_score * -Score_element::line_l() const -{ - return 0; -} - -void -Score_element::add_dependency (Score_element*e) -{ - if (e) - { - Group_interface gi (this, "dependencies"); - gi.add_element (e); - } - else - programming_error ("Null dependency added"); -} - - - - -/** - Do break substitution in S, using CRITERION. Return new value. - CRITERION is either a SMOB pointer to the desired line, or a number - representing the break direction. */ -SCM -Score_element::handle_broken_smobs (SCM s, SCM criterion) -{ - again: - - - Score_element *sc = unsmob_element ( s); - if (sc) - { - if (criterion == SCM_UNDEFINED) - return SCM_UNDEFINED; - else if (gh_number_p (criterion)) - { - Item * i = dynamic_cast (sc); - Direction d = to_dir (criterion); - if (i && i->break_status_dir () != d) - { - Item *br = i->find_broken_piece (d); - return (br) ? br->self_scm_ : SCM_UNDEFINED; - } - } - else - { - Score_element * ln = unsmob_element ( criterion); - Line_of_score * line = dynamic_cast (ln); - Score_element * br =0; - Line_of_score * dep_line = sc->line_l (); - if (dep_line != line) - { - br = sc->find_broken_piece (line); - return (br) ? br->self_scm_ : SCM_UNDEFINED; - } - if (!dep_line) - return SCM_UNDEFINED; - } - } - else if (gh_pair_p (s)) - { - /* - UGH! breaks on circular lists. - */ - SCM car = handle_broken_smobs (gh_car (s), criterion); - SCM cdr = gh_cdr (s); - - if (car == SCM_UNDEFINED - && (gh_pair_p (cdr) || cdr == SCM_EOL)) - { - /* - This is tail-recursion, ie. - - return handle_broken_smobs (cdr, criterion); - - We don't want to rely on the compiler to do this. */ - s = cdr; - goto again; - } - - gh_set_car_x (s, car); - gh_set_cdr_x (s, handle_broken_smobs (cdr, criterion)); - return s; - } - return s; -} - -void -Score_element::handle_broken_dependencies() -{ - Line_of_score *line = line_l(); - element_property_alist_ = handle_broken_smobs (element_property_alist_, - line ? line->self_scm_ : SCM_UNDEFINED); - - if (!line) - return; -} - - -/* - TODO: cleanify. - */ -void -Score_element::handle_prebroken_dependencies() -{ - if (Item*i =dynamic_cast (this)) - { - element_property_alist_ - = handle_broken_smobs (element_property_alist_, - gh_int2scm (i->break_status_dir ())); - } -} - - - - - -Link_array -Score_element::get_extra_dependencies() const -{ - Link_array empty; - return empty; -} - -bool -Score_element::linked_b() const -{ - return used_b_; -} - -void -Score_element::do_print () const -{ -} - -Score_element* -Score_element::find_broken_piece (Line_of_score*) const -{ - return 0; -} - - - -void -Score_element::translate_axis (Real y, Axis a) -{ - dim_cache_[a]->translate (y); -} - -Real -Score_element::relative_coordinate (Score_element const*e, Axis a) const -{ - return dim_cache_[a]->relative_coordinate (e ? e->dim_cache_[a] : 0); -} - -Score_element * -Score_element::common_refpoint (Score_element const* s, Axis a) const -{ - Dimension_cache *dim = dim_cache_[a]->common_refpoint (s->dim_cache_[a]); - return dim ? dim->element_l () : 0; -} - -void -Score_element::set_empty (Axis a) -{ - dim_cache_[a]->callback_l_ =0; -} - -bool -Score_element::empty_b (Axis a)const -{ - return !dim_cache_[a]->callback_l_; -} - -Interval -Score_element::extent (Axis a) const -{ - Dimension_cache const * d = dim_cache_[a]; - - return d->get_dim (); -} - - -Score_element* -Score_element::parent_l (Axis a) const -{ - Dimension_cache*d= dim_cache_[a]->parent_l_; - return d ? d->elt_l_ : 0; -} - -Score_element * -Score_element::common_refpoint (Link_array gs, Axis a) const -{ - Dimension_cache * common = dim_cache_[a]; - for (int i=0; i < gs.size (); i++) - { - common = common->common_refpoint (gs[i]->dim_cache_[a]); - } - - return common->element_l (); -} - -char const * -Score_element::name () const -{ - return classname (this); -} - - -void -Score_element::set_parent (Score_element *g, Axis a) -{ - dim_cache_[a]->parent_l_ = g ? g->dim_cache_[a]: 0; -} - -void -Score_element::fixup_refpoint () -{ - for (int a = X_AXIS; a < NO_AXES; a ++) - { - Axis ax = (Axis)a; - Score_element * par = parent_l (ax); - - if (!par) - continue; - - if (par->line_l () != line_l ()) - { - Score_element * newpar = par->find_broken_piece (line_l ()); - set_parent (newpar, ax); - } - - if (Item * i = dynamic_cast (this)) - { - Item *pari = dynamic_cast (par); - - if (pari && i) - { - Direction my_dir = i->break_status_dir () ; - if (my_dir!= pari->break_status_dir()) - { - Item *newpar = pari->find_broken_piece (my_dir); - set_parent (newpar, ax); - } - } - } - } -} - - - -/**************************************************** - SMOB funcs - ****************************************************/ - - -#include "ly-smobs.icc" - -IMPLEMENT_SMOBS(Score_element); -IMPLEMENT_UNSMOB(Score_element, element); -SCM -Score_element::mark_smob (SCM ses) -{ - Score_element * s = SMOB_TO_TYPE (Score_element, ses); - if (s->self_scm_ != ses) - { - programming_error ("SMOB marking gone awry"); - return SCM_EOL; - } - return s->element_property_alist_; -} - -int -Score_element::print_smob (SCM s, SCM port, scm_print_state *) -{ - Score_element *sc = (Score_element *) gh_cdr (s); - - scm_puts ("#name (), port); - - // scm_puts (" properties = ", port); - // scm_display (sc->element_property_alist_, port); - scm_puts (" >", port); - return 1; -} - -void -Score_element::do_smobify_self () -{ -} - -SCM -Score_element::equal_p (SCM a, SCM b) -{ - return gh_cdr(a) == gh_cdr(b) ? SCM_BOOL_T : SCM_BOOL_F; -} diff --git a/lily/score-engraver.cc b/lily/score-engraver.cc index 8b9c53e05f..ed74043951 100644 --- a/lily/score-engraver.cc +++ b/lily/score-engraver.cc @@ -176,21 +176,23 @@ Score_engraver::set_columns (Paper_column *new_command_l, for (int i=00; i< 2; i++) { - if (*current[i] && (*current[i])->linked_b()) + if (*current[i]) { - pscore_p_->add_column ((*current[i])); - scoreline_l_->add_column ((*current[i])); - } - else - { - *current[i] =0; - - /* - We're forgetting about this column. Dump it, and make SCM - forget it. - - (UGH.) */ - scm_unprotect_object ((*current[i])->self_scm_); + if ((*current[i])->linked_b()) + { + pscore_p_->add_column ((*current[i])); + scoreline_l_->add_column ((*current[i])); + } + else + { + /* + We're forgetting about this column. Dump it, and make SCM + forget it. + + (UGH.) */ + scm_unprotect_object ((*current[i])->self_scm_); + *current[i] =0; + } } if (news[i]) *current[i] = news[i]; diff --git a/lily/score.cc b/lily/score.cc index af396f13af..da9c2d1da1 100644 --- a/lily/score.cc +++ b/lily/score.cc @@ -52,9 +52,6 @@ void Score::run_translator (Music_output_def *odef_l) { Cpu_timer timer; - scm_gc(); - cout << "\nCells in use: " << scm_cells_allocated << endl; - cout << "protects: " << scm_ilength (scm_protects) << endl; Global_translator * trans_p = odef_l->get_global_translator_p(); @@ -102,11 +99,12 @@ Score::run_translator (Music_output_def *odef_l) output->process(); delete output ; - // force GC + /* + force GC. At this point, GUILE may give back mallocated area to + the system. + */ + scm_gc(); - cout << "\nCells in use: " << scm_cells_allocated < encompass_arr = Group_interface__extract_elements (this, (Note_column*)0, "note-columns"); - set_bounds (LEFT, encompass_arr[0]); - if (encompass_arr.size () > 1) - set_bounds (RIGHT, encompass_arr.top ()); + + if (encompass_arr.size ()) + { + set_bounds (LEFT, encompass_arr[0]); + if (encompass_arr.size () > 1) + set_bounds (RIGHT, encompass_arr.top ()); + } } diff --git a/lily/spacing-engraver.cc b/lily/spacing-engraver.cc index 8f4672537e..7f3ac132fc 100644 --- a/lily/spacing-engraver.cc +++ b/lily/spacing-engraver.cc @@ -97,11 +97,14 @@ Spacing_engraver::do_pre_move_processing () Paper_column * sc = dynamic_cast (get_staff_info ().musical_pcol_l ()); - sc->set_elt_property ("shortest-playing-duration", - (new Moment (shortest_playing))->smobify_self ()); + SCM sh = (new Moment (shortest_playing))->smobify_self (); + SCM st = (new Moment (starter))->smobify_self (); + + scm_unprotect_object (st); + scm_unprotect_object (sh); - sc->set_elt_property ("shortest-starter-duration", - (new Moment (starter))->smobify_self ()); + sc->set_elt_property ("shortest-playing-duration", sh); + sc->set_elt_property ("shortest-starter-duration", st); } void diff --git a/lily/staff-symbol-referencer.cc b/lily/staff-symbol-referencer.cc index d08cee919e..64522e734f 100644 --- a/lily/staff-symbol-referencer.cc +++ b/lily/staff-symbol-referencer.cc @@ -55,7 +55,7 @@ Staff_symbol_referencer_interface::staff_space () const if (st) return st->staff_space (); else if (elt_l_->pscore_l_ && elt_l_->paper_l ()) - elt_l_->paper_l ()->get_var ("interline"); + return elt_l_->paper_l ()->get_var ("interline"); return 0.0; } diff --git a/ly/engraver.ly b/ly/engraver.ly index 5604407d63..177cbb8d53 100644 --- a/ly/engraver.ly +++ b/ly/engraver.ly @@ -5,7 +5,7 @@ StaffContext=\translator { \type "Engraver_group_engraver"; \name Staff ; - + \consists "Output_property_engraver"; barAuto = ##t voltaVisibility = ##t Generic_property_list = #generic-staff-properties @@ -92,7 +92,8 @@ RhythmicStaffContext=\translator{ \type "Engraver_group_engraver"; numberOfStaffLines = #1 \consists "Property_engraver"; - + \consists "Output_property_engraver"; + Generic_property_list = #generic-staff-properties barSize = #'staff-height @@ -113,6 +114,7 @@ VoiceContext = \translator { \type "Engraver_group_engraver"; dynamicPadding = #5.0 Generic_property_list = #generic-voice-properties + \consists "Output_property_engraver"; \consists "Dynamic_engraver"; % must come before text_engraver. \name Voice ; @@ -145,6 +147,7 @@ VoiceContext = \translator { GraceContext=\translator { \type "Grace_engraver_group"; \name "Grace"; + \consists "Output_property_engraver"; Generic_property_list = #generic-grace-properties @@ -179,6 +182,7 @@ GraceContext=\translator { ThreadContext = \translator{ \type Engraver_group_engraver; \consists "Note_heads_engraver" ; + \consists "Output_property_engraver"; Generic_property_list = #generic-thread-properties \consists "Property_engraver"; \name Thread; @@ -211,6 +215,7 @@ PianoStaffContext = \translator{\GrandStaffContext StaffGroupContext= \translator { \type "Engraver_group_engraver"; \consists "Span_bar_engraver"; + \consists "Output_property_engraver"; \consists "Staff_group_bar_engraver"; \name StaffGroup; @@ -251,6 +256,7 @@ LyricsContext = \translator { \translator{ \type "Engraver_group_engraver"; + \consists "Output_property_engraver"; \consistsend "Axis_group_engraver"; \name ChordNameVoice ; @@ -311,6 +317,7 @@ ScoreContext = \translator { \name Score; \consists "Timing_engraver"; + \consists "Output_property_engraver"; \consists "Span_score_bar_engraver"; % \consists "Score_priority_engraver"; diff --git a/make/out/lilypond.lsm b/make/out/lilypond.lsm index 51583cc764..568d4527b9 100644 --- a/make/out/lilypond.lsm +++ b/make/out/lilypond.lsm @@ -1,15 +1,15 @@ Begin3 Title: LilyPond -Version: 1.3.26 -Entered-date: 23FEB00 +Version: 1.3.27 +Entered-date: 24FEB00 Description: Keywords: music notation typesetting midi fonts engraving Author: hanwen@cs.uu.nl (Han-Wen Nienhuys) janneke@gnu.org (Jan Nieuwenhuizen) Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys) Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert - 1000k lilypond-1.3.26.tar.gz + 1000k lilypond-1.3.27.tar.gz Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/ - 1000k lilypond-1.3.26.tar.gz + 1000k lilypond-1.3.27.tar.gz Copying-policy: GPL End diff --git a/make/out/lilypond.spec b/make/out/lilypond.spec index 2d6bb4ef29..06fa453754 100644 --- a/make/out/lilypond.spec +++ b/make/out/lilypond.spec @@ -1,9 +1,9 @@ Name: lilypond -Version: 1.3.26 +Version: 1.3.27 Release: 1 Copyright: GPL Group: Applications/Publishing -Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.26.tar.gz +Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.27.tar.gz Summary: A program for printing sheet music. URL: http://www.cs.uu.nl/~hanwen/lilypond # get Packager from (undocumented?) ~/.rpmmacros! diff --git a/mf/feta-accordion.mf b/mf/feta-accordion.mf index 2ac7cdecbe..7694cc3a18 100644 --- a/mf/feta-accordion.mf +++ b/mf/feta-accordion.mf @@ -62,6 +62,7 @@ fet_beginchar("accStdbase", "accStdbase", "accStdbase") currentpicture := currentpicture shifted (0, r); fet_endchar; +%%% strange turning path. fet_beginchar("accBayanbase", "accBayanbase", "accBayanbase") save lh; lh = accreg_lh; @@ -143,6 +144,7 @@ def def_some_vars = cTwo = 0.60; enddef; +%%% strange turning path. fet_beginchar("accSB", "accSB", "accSB") set_char_box(.4staffsize#, .4staffsize#, 0, 2.4staff_space#); def_some_vars; @@ -172,6 +174,7 @@ fet_beginchar("accSB", "accSB", "accSB") currentpicture := currentpicture shifted (0, 2.4staff_space); fet_endchar; +%%% strange turning path. fet_beginchar("accBB", "accBB", "accBB") set_char_box(.4staffsize#, .4staffsize#, 0, 2.4staff_space#); def_some_vars; @@ -196,6 +199,7 @@ fet_beginchar("accBB", "accBB", "accBB") fet_endchar; +%%% strange turning path. fet_beginchar("accOldEE", "accOldEE", "accOldEE") set_char_box(staff_space#, staff_space#, 0, 2staff_space#); show w; diff --git a/scm/lily.scm b/scm/lily.scm index a57d0e9e08..b6ea62e1df 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -216,7 +216,27 @@ (font-load-command (car x) (cdr x))) font-name-alist) )) +;;;;;;;;;;;;;;;;;;;; + +; Make a function that checks score element for being of a specific type. +(define (make-type-checker name) + (lambda (elt) + (not (not (memq name (ly-get-elt-property elt 'interfaces)))))) + + + + + + + + + + + + + +;;;;;;;;;;;;;;;;;;; TeX output (define (tex-scm action-name) (define (unknown) "%\n\\unknown%\n") diff --git a/scripts/ly2dvi.py b/scripts/ly2dvi.py index e9a09c5959..6c27cae35f 100644 --- a/scripts/ly2dvi.py +++ b/scripts/ly2dvi.py @@ -341,7 +341,7 @@ class TeXOutput: this.write(r""" %% \vfill\hfill{\mudelatagline} \makeatletter -\renewcommand{\@oddfoot}{\thefooter\hfill{\mudelatagline}}% +\renewcommand{\@oddfoot}{\mudelatagline}% \makeatother \end{document} """) -- 2.39.2