From: fred Date: Tue, 26 Mar 2002 23:55:14 +0000 (+0000) Subject: lilypond-1.3.83 X-Git-Tag: release/1.5.59~1338 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=deacc7d34bee61f8766b4fa61242e95a78526f72;p=lilypond.git lilypond-1.3.83 --- diff --git a/CHANGES b/CHANGES index cb52b11d60..1e2dd72443 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,28 @@ + +1.3.83 +====== + +* small doc updates. + +* Cleanups related to barline handling: + + - Removed Translator_group::get_simple_translator (), and - + + - use properties to communicate about barlines and time sigs. (NOTE: + by default a time-signature of 4/4 is printed.) + + - fix repeat bar behavior. + + +* cleaned up Directional_element_interface + +* add name field to score-elements. + +* comment in some unprotects for Music in parser. Should bring down + cpu time and plug some leaks. + +* robustness fixes for etf2ly, tuplets, grace notes. + 1.3.82 ====== diff --git a/Documentation/bibliography/computer-notation.bib b/Documentation/bibliography/computer-notation.bib index 72ce9c38aa..00a3e9cd8d 100644 --- a/Documentation/bibliography/computer-notation.bib +++ b/Documentation/bibliography/computer-notation.bib @@ -541,7 +541,8 @@ surprising that LilyPond is more mature. title = {how to read and write tab: a guide to tab notation}, author = {Howard Wright}, email={Howard.Wright@ed.ac.uk}, - HTML={http://wabakimi.carleton.ca/~phacket2/guitar/tabfaq.html}, + HTML={http://www.guitartabs.cc/tabfaq.shtml} +% HTML={http://wabakimi.carleton.ca/~phacket2/guitar/tabfaq.html}, } diff --git a/Documentation/faq.texi b/Documentation/faq.texi index ae39d2e12b..298e69af76 100644 --- a/Documentation/faq.texi +++ b/Documentation/faq.texi @@ -22,6 +22,8 @@ @node Miscellaneous, ,,top @section Miscellaneous +[FIXME: rewrite FAQ, include general questions] + @subsubsection HELP! I'm stuck! Please read this document carefully. If you are still at loss, send @@ -160,7 +162,7 @@ symbols (notably lyrics and @code{^"text"} commands). Yes, see the @file{twinkle-pop} example. -@subsubsection Do you support guitar chord diagrams? +@subsubsection Do you support guitar fret diagrams? No. We ourselves don't play guitar, and don't know the fine points of this notation. We would welcome anyone who could give this a try. @@ -169,7 +171,6 @@ this notation. We would welcome anyone who could give this a try. No. The same as for the previous question goes. - @subsubsection Do you support multiple staff-sizes? Yes. At this time you can choose between 11, 13, 16, 19, 20, 23 and 20 @@ -249,7 +250,7 @@ staff/lyricline @end example -@subsubsection How do I put more than one marking on a note. +@subsubsection How do I put more than one marking on a note? You can stack them @example @@ -276,7 +277,7 @@ This also works for crescendi, eg, @end example -@subsubsection How do I combine multiple pieces into one document +@subsubsection How do I combine multiple pieces into one document? There are several solutions: @@ -308,10 +309,6 @@ in each individual piece from toplevel into the @code{\paper} block. There are several examples in the @file{mutopia} directory. -@subsubsection How do I get bar numbers? - -See @file{input/test/bar-scripts.ly}. - @subsubsection How do I change the tagline 'Lily was here'? In the @code{\header} field, add a @code{tagline} entry, e.g. @@ -384,23 +381,16 @@ participate. @subsubsection Is there a GUI frontend? Should I start building one? -LilyPond currently has no graphical interface. We (LilyPond authors) -don't feel the need to write a GUI, but several others do: - -Matthew Hiller has extended Midiscore and Koobase to handle mudela. -Check out @uref{http://zoo.cs.yale.edu/~meh25/}. He is now working on -`Denemo', a GTK based notation program (which is still being developed). - -Federico Mena-Quintero and Elliot Lee of RedHat Advanced Development -labs have plans to write a GNOME based Music notation program. However, -there is no code, only plans. +Matthew Hiller has extended Midiscore and Koobase to handle mudela, He +is now working on @uref{http://denemo.sourceforge.net/,Denemo}, a GTK +based notation program. This is the most advanced LilyPond front-end +currently available. Chris Cannam is working a rewrite of Rosegarden. The new design should be more modular, and could conceivably be used to output mudela. However, the not much seems to have happened the past year. See @uref{http://www.all-day-breakfast.com/rosegarden/development.html}. - @subsubsection I want to implement XXXX! How should I do this? Your best bet of getting us to include code, is to present it as a @@ -427,7 +417,7 @@ the file ~/.gdbinit. @example define printstr - print $arg0->strh_.data->data_byte_p_ + print $arg0->ch_C() end define printscm @@ -449,8 +439,8 @@ LilyPond uses a lot CPU time, and insane amounts of memory. The amount of memory it requires is proportional to the size of the score, in other words. For a moderately complex piano scores of 5 pages, the footprint can easily become 20 megs. (Our favorite test is the coriolan: -approx. 100 megs for a 50 page orchestral). If your system has not got -enough memory, it can easily start swapping. +approx. 100 megs for a 50 page orchestral score). If your system has not +got enough memory, it can easily start swapping. A part of the memory is used as temporary storage, and is reclaimed through GUILE's garbage collection. A way to trade in CPU time for @@ -587,8 +577,8 @@ i.e. do something like: @end itemize -Direct PS output is still experimental. For creating nice looking ps -output, use TeX and @code{dvips}. +Direct PS output is not used often, and therefore likely to exhibit +bugs. For creating nice looking ps output, use TeX and @code{dvips}. @subsubsection The beams and slurs are gone when using the XDvi magnifying glass!? @@ -764,6 +754,21 @@ See @uref{http://www.geocities.com/Vienna/Studio/1714/harpsichord.html} for a summary of copyright relative to old music, also for the expert forum for such subsubsections. +Benjy (benjy@@indiansprings.org) + +@quotation +(In the UK, the typesetting of a piece of music goes out of copyright 25 year\s +after it is published. Maybe you can tell me what copyright law says in othe\r +countries.) +@end quotation + +The US has had several schemes over the last century meaning that +anything published after January 1, 1923 and before 1964 requires that +you put in some work to determine its status. However, anything +published before 1923 is fair game in the US. See +@uref{http://www.loc.gov/copyright/circs/circ22.html} for the whole +twisted tale. + @node Windows32,, ,top @section Windows32 diff --git a/Documentation/topdocs/INSTALL.texi b/Documentation/topdocs/INSTALL.texi index 3583f2a772..d06812d6e4 100644 --- a/Documentation/topdocs/INSTALL.texi +++ b/Documentation/topdocs/INSTALL.texi @@ -182,9 +182,6 @@ man2html can be had from @uref{http://askdonald.ask.uni-karlsruhe.de/hppd/hpux/N The website will build without this utility, but you will not see our hypertextified bibliography. -@item @uref{http://www.zib.de/Visual/software/doc++/index.html,DOC++} - A documentation system for C++ sources, which is used for the - LilyPond sources. @end itemize @section Configuring and compiling @@ -203,17 +200,20 @@ to install GNU LilyPond, simply type: This will install a number of files, something close to: @example - /usr/local/man/man1/mi2mu.1 + /usr/local/man/man1/midi2ly.1 + /usr/local/man/man1/abc2ly.1 + /usr/local/man/man1/etf2ly.1 /usr/local/man/man1/convert-mudela.1 /usr/local/man/man1/mudela-book.1 /usr/local/man/man1/lilypond.1 /usr/local/bin/lilypond - /usr/local/bin/mi2mu + /usr/local/bin/midi2ly /usr/local/bin/convert-mudela /usr/local/bin/mudela-book /usr/local/bin/abc2ly + /usr/local/bin/etf2ly /usr/local/share/lilypond/* - /usr/local/share/locale/@{it,nl@}/LC_MESSAGES/lilypond.mo + /usr/local/share/locale/@{....@}/LC_MESSAGES/lilypond.mo @end example @@ -339,8 +339,7 @@ You can make the rpm by issuing @end example Precompiled i386 RedHat RPMS are available from -@uref{ftp://freshmeat.net/pub/rpms/lilypond/,ftp://freshmeat.net/pub/rpms/lilypond/} and -@uref{http://linux.umbc.edu/software/lilypond/rpms/,http://linux.umbc.edu/software/lilypond/rpms/}. +@uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/RedHat/}. For compilation on a RedHat system you need these packages, in addition to the those needed for running: @@ -374,10 +373,10 @@ mailing your problems. If you find bugs, please send bug reports to @email{bug-gnu-music@@gnu.org}. -Known bugs that are LilyPond's fault are listed in @file{TODO}, or -demonstrated in @file{input/bugs/}. +Bugs that are LilyPond's fault are listed in our TODO list on the +web, or demonstrated in @file{input/bugs/}. -Known bugs that are not LilyPond's fault are documented here. +Bugs that are not LilyPond's fault are documented here. @unnumbered LinuxPPC Bugs: diff --git a/Documentation/user/mudela-book.tely b/Documentation/user/mudela-book.tely index 6c7bdacef2..65ef7fa736 100644 --- a/Documentation/user/mudela-book.tely +++ b/Documentation/user/mudela-book.tely @@ -150,12 +150,12 @@ will set the @code{linewidth} variable to -1, so Lilypond will make the music as short as possible but without breaking the line. Here is a well know harmonic progression: @mudela[veryverbatim, intertext="produce a well known harmonic progression:"] - + \context Voice { } @end mudela If you want to place music examples in the text, @mudela[eps] - +\context Voice { } @end mudela , you can use the @code{eps} option. This will create the music as eps graphics and include it into the document with the @@ -164,7 +164,7 @@ eps graphics and include it into the document with the The code used look like this: @example @@mudela[eps] - + \context Voice { } @@end mudela @end example diff --git a/VERSION b/VERSION index 7992718877..745ecaa54b 100644 --- a/VERSION +++ b/VERSION @@ -1,7 +1,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 -PATCH_LEVEL=82 +PATCH_LEVEL=83 MY_PATCH_LEVEL= # use the above to send patches: MY_PATCH_LEVEL is always empty for a diff --git a/lily/bar-engraver.cc b/lily/bar-engraver.cc index bbb1af8238..c9d1466f6f 100644 --- a/lily/bar-engraver.cc +++ b/lily/bar-engraver.cc @@ -13,7 +13,7 @@ #include "musical-request.hh" #include "multi-measure-rest.hh" #include "command-request.hh" -#include "timing-engraver.hh" + #include "engraver-group-engraver.hh" #include "warn.hh" #include "item.hh" @@ -30,77 +30,54 @@ Bar_engraver::create_bar () if (!bar_p_) { bar_p_ = new Item (get_property ("basicBarProperties")); - - SCM default_type = get_property ("defaultBarType"); - if (gh_string_p (default_type)) - { - bar_p_->set_elt_property ("glyph", default_type); // ugh - } - announce_element (bar_p_, 0); } } -/** - Make a barline. If there are both |: and :| requested, merge them - to :|:. -*/ -void -Bar_engraver::request_bar (String requested_type) +void +Bar_engraver::do_creation_processing () { - if (!now_mom ()) - { - SCM prop = get_property ("barAtLineStart"); - if (!to_boolean (prop)) - return; - } - bool bar_existed = bar_p_; - create_bar (); - if (bar_existed && requested_type == "") - { - return; - } - - String current = ly_scm2string (bar_p_->get_elt_property ("glyph")); - - if ((requested_type == "|:" && current== ":|") - || (requested_type == ":|" && current == "|:")) - requested_type = ":|:"; +} - - bar_p_->set_elt_property ("glyph", - ly_str02scm (requested_type.ch_C ())); +void +Bar_engraver::do_removal_processing () +{ + typeset_bar (); } -void -Bar_engraver::do_creation_processing () +/* + Bar_engraver should come *after* any engravers that expect bars to + modify whichBar in do_process_music () be typeset +*/ +void +Bar_engraver::do_process_music() { + SCM b =get_property ("whichBar"); + if (gh_string_p (b)) + { + create_bar (); + } } void -Bar_engraver::do_removal_processing () +Bar_engraver::typeset_bar () { if (bar_p_) { + SCM gl = get_property ("whichBar"); + if (scm_equal_p (gl, bar_p_->get_elt_property ("glyph")) != SCM_BOOL_T) + bar_p_->set_elt_property ("glyph", gl); typeset_element (bar_p_); bar_p_ =0; } } -void -Bar_engraver::do_process_music() -{ - Translator * t = daddy_grav_l ()->get_simple_translator ("Timing_engraver"); // UGH.! - - Timing_engraver * te = dynamic_cast(t); - String which = (te) ? te->which_bar () : ""; - - if (which.length_i ()) - { - create_bar(); - bar_p_->set_elt_property ("glyph", ly_str02scm (which.ch_C ())); - } - +/* + lines may only be broken if there is a barline in all staffs +*/ +void +Bar_engraver::do_pre_move_processing() +{ if (!bar_p_) { Score_engraver * e = 0; @@ -109,23 +86,14 @@ Bar_engraver::do_process_music() { e = dynamic_cast (t); } - + if (!e) programming_error ("No score engraver!"); else - e->forbid_breaks (); - } -} - - -void -Bar_engraver::do_pre_move_processing() -{ - if (bar_p_) - { - typeset_element (bar_p_); - bar_p_ =0; + e->forbid_breaks (); // guh. Use properties! } + else + typeset_bar (); } ADD_THIS_TRANSLATOR(Bar_engraver); diff --git a/lily/bar.cc b/lily/bar.cc index 00625374fe..5419f3fa4b 100644 --- a/lily/bar.cc +++ b/lily/bar.cc @@ -158,9 +158,11 @@ Bar::before_line_breaking (SCM smob) { me->set_elt_property ("molecule-callback", SCM_BOOL_T); me->set_extent_callback (0, X_AXIS); + // leave y_extent for spanbar? } - else if (! gh_equal_p (g, orig)) + + if (! gh_equal_p (g, orig)) me->set_elt_property ("glyph", g); diff --git a/lily/chord.cc b/lily/chord.cc index ef1c58a66f..5cb2870461 100644 --- a/lily/chord.cc +++ b/lily/chord.cc @@ -10,10 +10,8 @@ #include "musical-request.hh" #include "warn.hh" #include "debug.hh" -#include "molecule.hh" -#include "paper-def.hh" -#include "lookup.hh" -#include "lookup.hh" +#include "music-list.hh" +#include "musical-request.hh" int compare (Chord* left, Chord* right) @@ -516,3 +514,59 @@ Chord::rebuild_with_bass (Array* pitch_arr_p, int bass_i) pitch_arr_p->insert (bass, 0); } + +// junk me +Simultaneous_music * +get_chord (Musical_pitch tonic, + Array* add_arr_p, + Array* sub_arr_p, + Musical_pitch* inversion_p, + Musical_pitch* bass_p, + Duration d) +{ + + /* + UARGAUGRAGRUAUGRUINAGRAUGIRNA + + ugh + */ + Chord chord = to_chord (tonic, add_arr_p, sub_arr_p, inversion_p, bass_p); + inversion_p = 0; + bass_p = 0; + + Tonic_req* t = new Tonic_req; + t->pitch_ = tonic; + SCM l = gh_cons (t->self_scm (), SCM_EOL); + + //urg + if (chord.inversion_b_ + && Chord::find_notename_i (&chord.pitch_arr_, chord.inversion_pitch_) > 0) + { + Inversion_req* i = new Inversion_req; + i->pitch_ = chord.inversion_pitch_; + l = gh_cons (i->self_scm (), l); + } + + if (chord.bass_b_) + { + Bass_req* b = new Bass_req; + b->pitch_ = chord.bass_pitch_; + l = gh_cons (b->self_scm (), l); + } + + Array pitch_arr = chord.to_pitch_arr (); + for (int i = pitch_arr.size (); --i >= 0;) + { + Musical_pitch p = pitch_arr[i]; + Note_req* n = new Note_req; + n->pitch_ = p; + n->duration_ = d; + l = gh_cons (n->self_scm (), l); + } + + Simultaneous_music*v = new Request_chord (l); + + return v; +} + + diff --git a/lily/group-interface.cc b/lily/group-interface.cc index 7337f84c3b..ffbbf06c5d 100644 --- a/lily/group-interface.cc +++ b/lily/group-interface.cc @@ -9,14 +9,17 @@ #include "group-interface.hh" #include "score-element.hh" -Group_interface::Group_interface (Score_element const* e) +/* + ugh: clean me, junk elt_l_ field + */ +Group_interface::Group_interface (Score_element * e) { elt_l_ = (Score_element*)e; name_ = "elements"; } -Group_interface::Group_interface (Score_element const *e, String s) +Group_interface::Group_interface (Score_element *e, String s) { elt_l_ =(Score_element*)e; name_ = s; diff --git a/lily/include/chord.hh b/lily/include/chord.hh index ce00613275..561032eefb 100644 --- a/lily/include/chord.hh +++ b/lily/include/chord.hh @@ -52,4 +52,13 @@ Chord to_chord (Array pitch_arr, Tonic_req* tonic_req, Inversion_ int compare (Chord*, Chord*); +Simultaneous_music *get_chord (Musical_pitch tonic, + Array* add_arr_p, + Array* sub_arr_p, + Musical_pitch* inversion_p, + Musical_pitch* bass_p, + Duration d); + + + #endif // CHORD_HH diff --git a/lily/include/group-interface.hh b/lily/include/group-interface.hh index 9ae9cac612..66308caf44 100644 --- a/lily/include/group-interface.hh +++ b/lily/include/group-interface.hh @@ -28,8 +28,8 @@ struct Group_interface Score_element * elt_l_; String name_; public: - Group_interface (Score_element const*); - Group_interface (Score_element const*, String); + Group_interface (Score_element *); + Group_interface (Score_element *, String); int count (); void add_thing (SCM); bool has_interface (); @@ -40,8 +40,8 @@ struct Pointer_group_interface { Score_element * elt_l_; String name_; public: - Pointer_group_interface (Score_element const*); - Pointer_group_interface (Score_element const*, String); + Pointer_group_interface (Score_element*); + Pointer_group_interface (Score_element*, String); int count (); void set_interface (); static bool has_interface (Score_element*); diff --git a/lily/include/repeated-music.hh b/lily/include/repeated-music.hh index cb9b9b5760..3c70ae5a30 100644 --- a/lily/include/repeated-music.hh +++ b/lily/include/repeated-music.hh @@ -70,7 +70,6 @@ public: Moment body_length_mom () const; Moment alternatives_length_mom () const; - void print() const; /// Transpose, with the interval central C to #p# virtual void transpose (Musical_pitch p); @@ -80,8 +79,6 @@ public: Repeated_music (Music*, int , Music_sequence*); Repeated_music (Repeated_music const&); -protected: - virtual void do_print() const; }; diff --git a/lily/include/span-bar.hh b/lily/include/span-bar.hh index da2de18188..b13a68364f 100644 --- a/lily/include/span-bar.hh +++ b/lily/include/span-bar.hh @@ -29,6 +29,7 @@ public: static bool has_interface (Score_element*); static Interval get_spanned_interval (Score_element*); static void add_bar (Score_element*,Score_element*); + static void evaluate_glyph (Score_element*); static void evaluate_empty (Score_element*); static Interval width_callback(Score_element *, Axis) ; static SCM get_bar_size (SCM); diff --git a/lily/my-lily-parser.cc b/lily/my-lily-parser.cc index b7bd385961..faf2a68b86 100644 --- a/lily/my-lily-parser.cc +++ b/lily/my-lily-parser.cc @@ -11,17 +11,9 @@ #include "my-lily-lexer.hh" #include "debug.hh" #include "main.hh" -#include "music-list.hh" -#include "musical-request.hh" -#include "command-request.hh" -#include "lily-guile.hh" #include "parser.hh" -#include "scope.hh" #include "file-results.hh" -#include "midi-def.hh" -#include "paper-def.hh" -#include "identifier.hh" -#include "chord.hh" +#include "scope.hh" My_lily_parser::My_lily_parser (Sources * source_l) { @@ -97,62 +89,6 @@ My_lily_parser::set_last_duration (Duration const *d) default_duration_ = *d; } -// junk me -Simultaneous_music * -My_lily_parser::get_chord (Musical_pitch tonic, - Array* add_arr_p, - Array* sub_arr_p, - Musical_pitch* inversion_p, - Musical_pitch* bass_p, - Duration d) -{ - - /* - UARGAUGRAGRUAUGRUINAGRAUGIRNA - - ugh - */ - Chord chord = to_chord (tonic, add_arr_p, sub_arr_p, inversion_p, bass_p); - inversion_p = 0; - bass_p = 0; - - Tonic_req* t = new Tonic_req; - t->pitch_ = tonic; - SCM l = gh_cons (t->self_scm (), SCM_EOL); - - //urg - if (chord.inversion_b_ - && Chord::find_notename_i (&chord.pitch_arr_, chord.inversion_pitch_) > 0) - { - Inversion_req* i = new Inversion_req; - i->pitch_ = chord.inversion_pitch_; - l = gh_cons (i->self_scm (), l); - } - - if (chord.bass_b_) - { - Bass_req* b = new Bass_req; - b->pitch_ = chord.bass_pitch_; - l = gh_cons (b->self_scm (), l); - } - - Array pitch_arr = chord.to_pitch_arr (); - for (int i = pitch_arr.size (); --i >= 0;) - { - Musical_pitch p = pitch_arr[i]; - Note_req* n = new Note_req; - n->pitch_ = p; - n->duration_ = d; - l = gh_cons (n->self_scm (), l); - } - - Simultaneous_music*v = new Request_chord (l); - v->set_spot (here_input ()); - - return v; -} - - Input My_lily_parser::pop_spot() diff --git a/lily/parser.yy b/lily/parser.yy index 84a0b042d8..8db7014cdf 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -43,6 +43,7 @@ #include "auto-change-music.hh" #include "part-combine-music.hh" #include "output-property.hh" +#include "chord.hh" bool is_duration_b (int t) @@ -90,12 +91,11 @@ print_mudela_versions (ostream &os) Music *music; Score *score; Scope *scope; - Interval *interval; + Musical_req* musreq; Music_output_def * outputdef; Musical_pitch * pitch; Midi_def* midi; - Moment *moment; Real real; Request * request; @@ -365,8 +365,6 @@ assignment: /* TODO: devise standard for protection in parser. - if (SCM_NIMP($4)) - scm_unprotect_object ($4); The parser stack lives on the C-stack, which means that all objects can be unprotected as soon as they're here. @@ -389,12 +387,15 @@ identifier_init: } | translator_spec_block { $$ = $1->self_scm (); + scm_unprotect_object ($$); } | Music { $$ = $1->self_scm (); + scm_unprotect_object ($$); } | post_request { $$ = $1->self_scm (); + scm_unprotect_object ($$); } | explicit_duration { $$ = (new Duration_identifier ($1, DURATION_IDENTIFIER))->self_scm (); @@ -502,7 +503,7 @@ score_body: $$->set_spot (THIS->here_input ()); SCM m = $1->self_scm (); -// scm_unprotect_object (m); + scm_unprotect_object (m); $$->music_ = m; } | SCORE_IDENTIFIER { @@ -603,7 +604,7 @@ Music_list: /* empty */ { | Music_list Music { SCM s = $$; SCM c = gh_cons ($2->self_scm (), SCM_EOL); -// scm_unprotect_object ($2->self_scm ()); /* UGH */ + scm_unprotect_object ($2->self_scm ()); /* UGH */ if (gh_pair_p (gh_cdr (s))) @@ -1393,7 +1394,8 @@ simple_element: chord: steno_tonic_pitch optional_notemode_duration chord_additions chord_subtractions chord_inversion chord_bass { - $$ = THIS->get_chord (*$1, $3, $4, $5, $6, *$2); + $$ = get_chord (*$1, $3, $4, $5, $6, *$2); + $$->set_spot (THIS->here_input ()); }; chord_additions: diff --git a/lily/pointer-group-interface.cc b/lily/pointer-group-interface.cc index f1a6ae4011..aef7b46a4f 100644 --- a/lily/pointer-group-interface.cc +++ b/lily/pointer-group-interface.cc @@ -9,18 +9,25 @@ #include "group-interface.hh" #include "score-element.hh" -Pointer_group_interface::Pointer_group_interface (Score_element const* e) +/* + UGH clean me . + */ +Pointer_group_interface::Pointer_group_interface (Score_element * e) { - elt_l_ = (Score_element*)e; + elt_l_ = e; name_ = "elements"; } -Pointer_group_interface::Pointer_group_interface (Score_element const *e, String s) +Pointer_group_interface::Pointer_group_interface (Score_element *e, String s) { elt_l_ =(Score_element*)e; name_ = s; } + +/* + duh. + */ bool Pointer_group_interface::has_interface () { @@ -47,9 +54,5 @@ Pointer_group_interface::count () void Pointer_group_interface::set_interface () { - if (!has_interface ()) - { - elt_l_->set_elt_property (name_.ch_C(), SCM_EOL); - } } diff --git a/lily/repeated-music.cc b/lily/repeated-music.cc index 2e8e0e3d02..baae892504 100644 --- a/lily/repeated-music.cc +++ b/lily/repeated-music.cc @@ -26,7 +26,11 @@ Repeated_music::alternatives ()const Repeated_music::Repeated_music(Music *beg, int times, Music_sequence * alts) { - set_mus_property ("body", beg->self_scm ()); + if (beg) + { + set_mus_property ("body", beg->self_scm ()); + scm_unprotect_object (beg->self_scm ()); + } fold_b_ = false; repeats_i_ = times; volta_fold_b_ = true; @@ -34,6 +38,7 @@ Repeated_music::Repeated_music(Music *beg, int times, Music_sequence * alts) { alts->truncate (times); set_mus_property ("alternatives", alts->self_scm ()); + scm_unprotect_object (alts->self_scm ()); } } @@ -47,20 +52,6 @@ Repeated_music::Repeated_music (Repeated_music const &s) } -void -Repeated_music::do_print () const -{ -#ifndef NPRINT - DEBUG_OUT << "Fold = " << fold_b_ << " reps: " << repeats_i_; - - if (body ()) - body ()->print(); - - if (alternatives ()) - alternatives ()->print(); -#endif -} - Musical_pitch Repeated_music::to_relative_octave (Musical_pitch p) { diff --git a/lily/span-bar-engraver.cc b/lily/span-bar-engraver.cc index a228a1b298..5fbd94f254 100644 --- a/lily/span-bar-engraver.cc +++ b/lily/span-bar-engraver.cc @@ -59,10 +59,7 @@ Span_bar_engraver::acknowledge_element (Score_element_info i) { spanbar_p_ = new Item (get_property ("basicSpanBarProperties")); Span_bar::set_interface (spanbar_p_); - spanbar_p_->set_elt_property ("glyph", bar_l_arr_[0]->get_elt_property ("glyph")); - spanbar_p_->set_elt_property ("visibility-lambda", - bar_l_arr_[0]->get_elt_property ("visibility-lambda")); - + spanbar_p_->set_parent (bar_l_arr_[0], Y_AXIS); spanbar_p_->set_parent (bar_l_arr_[0], X_AXIS); @@ -77,6 +74,12 @@ Span_bar_engraver::do_pre_move_processing() { for (int i=0; i < bar_l_arr_.size() ; i++) Span_bar::add_bar( spanbar_p_,bar_l_arr_[i]); + + SCM vissym =ly_symbol2scm ("visibility-lambda"); + SCM vis = bar_l_arr_[0]->get_elt_property (vissym); + if (scm_equal_p (spanbar_p_->get_elt_property (vissym), vis) != SCM_BOOL_T) + spanbar_p_->set_elt_property (vissym, vis); + typeset_element (spanbar_p_); spanbar_p_ =0; } diff --git a/lily/span-bar.cc b/lily/span-bar.cc index 722dd45d77..54b5ef953c 100644 --- a/lily/span-bar.cc +++ b/lily/span-bar.cc @@ -43,10 +43,13 @@ MAKE_SCHEME_CALLBACK(Span_bar,before_line_breaking); SCM Span_bar::before_line_breaking (SCM smob) { - Bar::before_line_breaking (smob); - evaluate_empty (unsmob_element (smob)); + evaluate_glyph (unsmob_element (smob)); + /* + no need to call Bar::before_line_breaking (), because the info + in ELEMENTS already has been procced by Bar::before_line_breaking(). + */ return SCM_UNSPECIFIED; } @@ -77,31 +80,39 @@ Span_bar::evaluate_empty (Score_element*me) { me->suicide (); } - - SCM gl = me->get_elt_property ("glyph"); +} + +void +Span_bar::evaluate_glyph (Score_element*me) +{ + SCM elts = me->get_elt_property ("elements"); + Score_element * b = unsmob_element (gh_car (elts)); + SCM glsym =ly_symbol2scm ("glyph"); + SCM gl =b ->get_elt_property (glsym); if (!gh_string_p (gl)) { me->suicide (); return ; } - else { - String type_str = ly_scm2string (gl); - String orig = type_str; - if (type_str == "|:") - { - type_str= ".|"; - } - else if (type_str== ":|") - { - type_str= "|."; - } - else if (type_str== ":|:") - { - type_str= ".|."; - } - if (orig != type_str) - me->set_elt_property ("glyph", ly_str02scm (type_str.ch_C())); - } + + String type = ly_scm2string (gl); + + if (type == "|:") + { + type = ".|"; + } + else if (type== ":|") + { + type = "|."; + } + else if (type== ":|:") + { + type = ".|."; + } + + gl = ly_str02scm (type.ch_C()); + if (scm_equal_p (me->get_elt_property (glsym), gl) != SCM_BOOL_T) + me->set_elt_property (glsym, gl); } Interval diff --git a/lily/time-signature-engraver.cc b/lily/time-signature-engraver.cc index 99f7898328..8eeb7e3109 100644 --- a/lily/time-signature-engraver.cc +++ b/lily/time-signature-engraver.cc @@ -10,7 +10,7 @@ #include "command-request.hh" #include "engraver.hh" -#include "timing-engraver.hh" + #include "engraver-group-engraver.hh" @@ -24,7 +24,7 @@ protected: public: VIRTUAL_COPY_CONS(Translator); Item * time_signature_p_; - + SCM last_time_fraction_; Time_signature_engraver(); }; @@ -32,39 +32,25 @@ public: Time_signature_engraver::Time_signature_engraver() { time_signature_p_ =0; + last_time_fraction_ = SCM_EOL; } void Time_signature_engraver::do_process_music() { /* - UGH. - this should use properties. - */ - Translator * result = - daddy_grav_l()->get_simple_translator ("Timing_engraver"); // ugh - - if (!result) - { - warning (_ ("lost in time:")); - warning (_f ("can't find: `%s'", " Timing_translator")); - return ; - } - - Timing_engraver * timing_grav_l= dynamic_cast (result); - - Time_signature_change_req *req = timing_grav_l->time_signature_req_l(); - if (req) + not rigorously safe, since the value might get GC'd and + reallocated in the same spot */ + SCM fr= get_property ("timeSignatureFraction"); + if (last_time_fraction_ != fr) { + last_time_fraction_ = fr; time_signature_p_ = new Item (get_property ("basicTimeSignatureProperties")); - time_signature_p_->set_elt_property ("fraction", - gh_cons (gh_int2scm (req->beats_i_), - gh_int2scm (req->one_beat_i_))); + time_signature_p_->set_elt_property ("fraction",fr); } - if (time_signature_p_) - announce_element (time_signature_p_, req); + announce_element (time_signature_p_, 0); } void diff --git a/lily/timing-engraver.cc b/lily/timing-engraver.cc index 68c34aeff6..95b68d0369 100644 --- a/lily/timing-engraver.cc +++ b/lily/timing-engraver.cc @@ -6,11 +6,27 @@ (c) 1997--2000 Han-Wen Nienhuys */ -#include "score-engraver.hh" -#include "timing-engraver.hh" +#include "translator-group.hh" #include "command-request.hh" #include "score-element-info.hh" #include "multi-measure-rest.hh" +#include "timing-translator.hh" +#include "engraver.hh" + +/** + Do time bookkeeping + */ +class Timing_engraver : public Timing_translator, public Engraver +{ + Bar_req * bar_req_l_; +protected: + virtual bool do_try_music (Music * ); + virtual void do_post_move_processing (); + virtual void do_process_music (); +public: + String which_bar (); + VIRTUAL_COPY_CONS(Translator); +}; ADD_THIS_TRANSLATOR(Timing_engraver); @@ -19,7 +35,21 @@ Timing_engraver::do_post_move_processing( ) { bar_req_l_ = 0; Timing_translator::do_post_move_processing (); + + SCM nonauto = get_property ("barNonAuto"); + SCM which = now_mom () ? SCM_UNDEFINED : ly_str02scm ("|"); + if (which == SCM_UNDEFINED && !to_boolean (nonauto)) + { + SCM always = get_property ("barAlways"); + if (!measure_position () + || (to_boolean (always))) + { + which=get_property ("defaultBarType" ); + } + } + + daddy_trans_l_->set_property ("whichBar", which); } bool @@ -27,7 +57,7 @@ Timing_engraver::do_try_music (Music*m) { if (Bar_req * b= dynamic_cast (m)) { - if (bar_req_l_ && !bar_req_l_->equal_b (b)) // huh? + if (bar_req_l_ && !bar_req_l_->equal_b (b)) return false; bar_req_l_ = b; @@ -37,32 +67,10 @@ Timing_engraver::do_try_music (Music*m) return Timing_translator::do_try_music (m); } -/* - TODO make properties of this. - */ -String -Timing_engraver::which_bar () +void +Timing_engraver::do_process_music () { - if (!bar_req_l_) - { - if (!now_mom ()) - return "|"; - - SCM nonauto = get_property ("barNonAuto"); - if (!to_boolean (nonauto)) - { - SCM always = get_property ("barAlways"); - if (!measure_position () - || (to_boolean (always))) - { - SCM def=get_property ("defaultBarType" ); - return (gh_string_p (def))? ly_scm2string (def) : ""; - } - } - return ""; - } - else - { - return bar_req_l_->type_str_; - } + if (bar_req_l_) + daddy_trans_l_->set_property ("whichBar", bar_req_l_->get_mus_property ("type")); } + diff --git a/ly/engraver.ly b/ly/engraver.ly index 3671d3c46c..8b6a2f63eb 100644 --- a/ly/engraver.ly +++ b/ly/engraver.ly @@ -16,6 +16,7 @@ StaffContext=\translator { \consists "Repeat_engraver"; + \consists "Separating_line_group_engraver"; @@ -424,7 +425,9 @@ ScoreContext = \translator { % staffspace (distances) % basicBarProperties = #`( + (interfaces . (bar-interface staff-bar-interface)) (break-align-symbol . Staff_bar) + (glyph . "|") (barsize-procedure . ,Bar::get_staff_bar_size) (molecule-callback . ,Bar::brew_molecule) (visibility-lambda . ,all-visible) @@ -437,14 +440,14 @@ ScoreContext = \translator { (thin-kern . 3.0) (hair-thickness . 1.6) (thick-thickness . 6.0) - - (interfaces . (bar-interface staff-bar-interface)) + (name . "barline") ) basicBarNumberProperties = #`( (molecule-callback . ,Text_item::brew_molecule) (breakable . #t) (visibility-lambda . ,begin-of-line-visible) + (name . "barnumber") ) basicBeamProperties = #`( @@ -455,6 +458,7 @@ ScoreContext = \translator { (default-neutral-direction . 1) (interfaces . (beam-interface)) (damping . 1) + (name . "beam") ) basicBreakAlignProperties = #`( @@ -462,54 +466,64 @@ ScoreContext = \translator { (interfaces . (break-align-interface)) (stacking-dir . 1) (axes 0) + (name . "break alignment") ) basicBreakAlignGroupProperties = #`( (interfaces . (axis-group-interface)) (axes . (0)) + (name . "break alignment group") ) basicBreathingSignProperties = #`( + (interfaces . (breathing-sign-interface)) (break-align-symbol . Breathing_sign) (breakable . #t ) (molecule-callback . ,Breathing_sign::brew_molecule) (visibility-lambda . ,begin-of-line-invisible) - (interfaces . (breathing-sign-interface)) + (name . "breathing sign") ) basicClefItemProperties = #`( + (interfaces . (clef-interface)) (molecule-callback . ,Score_element::brew_molecule) (before-line-breaking-callback . ,Clef::before_line_breaking) (breakable . #t) (break-align-symbol . Clef_item) (visibility-lambda . ,begin-of-line-visible) - (interfaces . (clef-interface)) + (name . "clef") ) basicChordNameProperties = #`( (molecule-callback . ,Chord_name::brew_molecule) (interfaces . (chord-name-interface)) - (after-line-breaking-callback . ,Chord_name::after_line_breaking) + (after-line-breaking-callback . ,Chord_name::after_line_breaking) + (name . "chord name") ) basicCollisionProperties = #`( (axes 0 1) (interfaces . (collision-interface)) + (name . "note collision") ) basicCrescendoProperties = #`( (molecule-callback . ,Crescendo::brew_molecule) (interfaces . (crescendo-interface dynamic-interface)) + (name . "crescendo") ) basicDotColumnProperties = #`( (interfaces . (dot-column-interface axis-group-interface )) (axes 0 ) + (name . "dot column") ) basicDotsProperties = #`( + (interfaces . (dot-interface)) (molecule-callback . ,Dots::brew_molecule) (dot-count . 1) - (interfaces . (dot-interface)) + (name . "augmentation dot") ) - basicDynamicTextProperties = # `( + basicDynamicTextProperties = #`( (style . "dynamic") (interfaces . (dynamic-interface)) (molecule-callback . ,Text_item::brew_molecule) (script-priority . 100) (self-alignment-Y . 0) + (name . "dynamic text") ) basicDynamicLineSpannerProperties = #`( @@ -517,25 +531,31 @@ ScoreContext = \translator { (axes . ( 1)) (padding . 3) (minimum-space . 6) + (name . "dynamic alignment") ) + leftEdgeBasicProperties = #`( (break-align-symbol . Left_edge_item) (breakable . #t) + (name . "left edge") ) basicGraceAlignItemProperties = #`( (axes . (0)) (interfaces . (axis-group-interface align-interface)) (before-line-breaking-callback . ,Grace_align_item::before_line_breaking) + (name . "grace alignment") ) basicHaraKiriVerticalGroupspannerProperties = #`( (interfaces . (hara-kiri-interface)) (axes 1) + (name . "hara kiri") ) basicHyphenSpannerProperties = #`( (thickness . 1.0) (height . 0.4) (minimum-length . 0.5) (molecule-callback . ,Hyphen_spanner::brew_molecule) + (name . "hyphen") ) basicInstrumentNameProperties = #`( @@ -543,6 +563,7 @@ ScoreContext = \translator { (molecule-callback . ,Text_item::brew_molecule) (break-align-symbol . Instrument_name) (visibility-lambda . ,begin-of-line-visible) + (name . "instrument name") ) basicKeyProperties = #`( (molecule-callback . ,Key_item::brew_molecule) @@ -550,51 +571,61 @@ ScoreContext = \translator { (break-align-symbol . Key_item) (visibility-lambda . ,begin-of-line-visible) (breakable . #t) + (name . "key signature") ) basicLocalKeyProperties = #`( (molecule-callback . ,Local_key_item::brew_molecule) (left-padding . 0.2) (right-padding . 0.4) (interfaces . (accidentals-interface)) + (name . "accidentals") ) basicLineOfScoreProperties = #`( (axes . (0 1)) (interfaces . (axis-group-interface)) + (name . "godzilla") ) basicLyricExtenderProperties = #`( + (interfaces . (lyric-extender-interface)) (molecule-callback . ,Lyric_extender::brew_molecule) (right-trim-amount . 0.5) - (interfaces . (lyric-extender-interface)) + (name . "extender line") ) basicLyricTextProperties = #`( + (interfaces . (lyric-syllable-interface text-item-interface)) (molecule-callback . ,Text_item::brew_molecule) (self-alignment-X . 0) (non-rhythmic . #t) (word-space . 0.6) - (interfaces . (lyric-syllable-interface text-item-interface)) + (name . "lyric syllable") ) basicMarkProperties = #`( + (interfaces . (mark-interface)) (molecule-callback . ,Text_item::brew_molecule) (breakable . #t) - (interfaces . (mark-interface)) (visibility-lambda . ,end-of-line-invisible) (padding . 4.0) + (name . "rehearsal mark") ) basicMultiMeasureRestProperties = #`( (spacing-procedure . ,Multi_measure_rest::set_spacing_rods) (molecule-callback . ,Multi_measure_rest::brew_molecule) (staff-position . 0) + (name . "multi-measure rest") ) basicNoteColumnProperties = #`( - (axes 0 1) (interfaces . (axis-group-interface note-column-interface)) + (axes 0 1) + (name . "note column") ) basicNoteHeadProperties = #`( (interfaces . (note-head-interface rhythmic-head-interface)) (molecule-callback . ,Note_head::brew_molecule) + (name . "note head") ) basicNoteNameProperties = #`( (molecule-callback . ,Text_item::brew_molecule) + (name . "note name") ) basicOctavateEightProperties = #`( (self-alignment-X . 0) @@ -614,40 +645,48 @@ ScoreContext = \translator { (after-line-breaking-callback . ,Rest::after_line_breaking) (molecule-callback . ,Rest::brew_molecule) (minimum-beam-collision-distance . 1.5) + (name . "rest") ) basicRestCollisionProperties = #`( - (minimum-distance . 0.75) (interfaces . (rest-collision-interface)) + (minimum-distance . 0.75) + (name . "rest collision") ) - basicScriptProperties = #`( + basicScriptProperties = #`( (molecule-callback . ,Script::brew_molecule) (interfaces . (script-interface)) + (name . "script") ) basicScriptColumnProperties = #`( (before-line-breaking-callback . ,Script_column::before_line_breaking) + (name . "script column") ) basicSlurProperties = #`( + (interfaces . (slur-interface)) (molecule-callback . ,Slur::brew_molecule) (thickness . 1.2) - (spacing-procedure . ,Slur::set_spacing_rods) e + (spacing-procedure . ,Slur::set_spacing_rods) (minimum-length . 1.5) - (after-line-breaking-callback . ,Slur::after_line_breaking) + (after-line-breaking-callback . ,Slur::after_line_breaking) + (name . "slur") ) basicSpacingSpannerProperties =#`( (spacing-procedure . ,Spacing_spanner::set_springs) ;; assume that notes at least this long are present. (maximum-duration-for-spacing . ,(make-moment 1 8)) + (name . "spacing spanner") ) basicSpanBarProperties = #`( + (interfaces . (bar-interface span-bar-interface)) (break-align-symbol . Staff_bar) (barsize-procedure . ,Span_bar::get_bar_size) (molecule-callback . ,Bar::brew_molecule) (visibility-lambda . ,begin-of-line-invisible) (breakable . #t) + (glyph . "|") (before-line-breaking-callback . ,Span_bar::before_line_breaking) - ;; ugh duplication! ;; @@ -657,19 +696,21 @@ ScoreContext = \translator { (thin-kern . 3.0) (hair-thickness . 1.6) (thick-thickness . 6.0) - (interfaces . (bar-interface span-bar-interface)) + (name . "cross staff bar-line") ) basicStanzaNumberProperties = #`( (breakable . #t) (molecule-callback . ,Text_item::brew_molecule) (break-align-symbol . Clef_item) (visibility-lambda . ,begin-of-line-visible) + (name . "stanza number") ) staffSymbolBasicProperties = #`( + (interfaces . (staff-symbol-interface )) (molecule-callback . ,Staff_symbol::brew_molecule) (staff-space . 1.0) (line-count . 5 ) - (interfaces . (staff-symbol-interface )) + (name . "staff symbol") ) basicSystemStartDelimiterProperties = #`( (molecule-callback . ,System_start_delimiter::brew_molecule) @@ -682,30 +723,35 @@ ScoreContext = \translator { (arch-width . 1.5) (bracket-thick . 0.25) (bracket-width . 2.0) + (name . "system start bracket") ) basicTextScriptProperties = #`( (molecule-callback . ,Text_item::brew_molecule) (no-spacing-rods . #t) (interfaces . (text-script-interface text-item-interface)) - (padding . 3.0) + (padding . 3.0) + (name . "text script") ) basicTieProperties = #`( + (interfaces . (tie-interface)) (molecule-callback . ,Tie::brew_molecule) (spacing-procedure . ,Tie::set_spacing_rods) (thickness . 1.2) (minimum-length . 2.5) - (interfaces . (tie-interface)) + (name . "tie") ) basicTieColumnProperties = #`( (after-line-breaking-callback . ,Tie_column::after_line_breaking) (interfaces . (tie-column-interface)) + (name . "tie column") ) basicTimeSignatureProperties = #`( + (interfaces . (time-signature-interface)) (molecule-callback . ,Time_signature::brew_molecule) (break-align-symbol . Time_signature) (visibility-lambda . ,all-visible) (breakable . #t) - (interfaces . (time-signature-interface)) + (name . "time signature") ) basicTupletSpannerProperties = #`( (number-gap . 2.0) @@ -720,50 +766,60 @@ ScoreContext = \translator { (style . "italic") (no-spacing-rods . #t) (self-alignment-X . 0) + (name . "sostenuto pedal") ) basicStemTremoloProperties = #`( (molecule-callback . ,Stem_tremolo::brew_molecule) (beam-width . 2.0) ; staff-space (beam-thickness . 0.42) ; staff-space + (name . "stem tremolo") ) basicStemProperties = #`( + (interfaces . (stem-interface)) (before-line-breaking-callback . ,Stem::before_line_breaking) (molecule-callback . ,Stem::brew_molecule) ; if stem is on middle line, choose this direction. (default-neutral-direction . 1) - (interfaces . (stem-interface)) + (name . "stem") ) basicSeparationItemProperties = #`( (interfaces . (separation-item-interface)) + (name . "separation item") ) basicSeparatingGroupSpannerProperties = #`( (interfaces . (separation-spanner-interface)) (spacing-procedure . ,Separating_group_spanner::set_spacing_rods) + (name . "separation spanner") ) basicSustainPedalProperties = #`( + (interfaces . (sustain-pedal-interface)) (no-spacing-rods . #t) (molecule-callback . ,Sustain_pedal::brew_molecule) (self-alignment-X . 0) - (interfaces . (sustain-pedal-interface)) + (name . "sustain pedal") ) basicUnaChordaPdealProperties = #`( (molecule-callback . ,Text_item::brew_molecule) (style . "italic") (no-spacing-rods . #t) (self-alignment-X . 0) + (name . "una chorda pedal") ) basicVoltaSpannerProperties = #`( (molecule-callback . ,Volta_spanner::brew_molecule) - (interfaces . (volta-spanner-interface)) + (interfaces . (volta-spanner-interface side-position-interface)) + (direction . 1) (padding . 5) (minimum-space . 25) + (name . "volta brace") ) basicVerticalAxisGroupProperties = #`( (axes 1) (interfaces . (axis-group-interface)) + (name . "Y-axis group") ) };