From aaf7cd07dd2904f4c9278fba174c523a93041998 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Tue, 27 Feb 2001 14:29:35 +0100 Subject: [PATCH] patch::: 1.3.132.jcn2 1.3.132.jcn2 ============ * Attempt at fixing input/bugs/tie-break-accidental.ly, but no luck. See comments in Local_key_engraver. * Removed some cruft from lily/include/. * Bugfix: tied notes in chords sometimes got stuck in MIDI output (thanks Mats). * Added some example bug files, taken from Coriolan; esp. see input/bugs/tie-break-accidental.ly, I've seen so much discussion on this, would have thought we had this right by now. --- CHANGES | 15 +++++ VERSION | 2 +- input/bugs/tie-break-accidental.ly | 14 ++++ lily/include/bar-req-collector-engraver.hh | 26 ------- lily/include/hara-kiri-engraver.hh | 15 ----- lily/include/hara-kiri-line-group-engraver.hh | 38 ----------- lily/include/main.hh | 1 + .../include/separating-line-group-engraver.hh | 13 ---- lily/include/span-score-bar-engraver.hh | 54 --------------- lily/include/swallow-engraver.hh | 26 ------- lily/include/tie-engraver.hh | 13 ---- lily/include/tuplet-engraver.hh | 12 ---- lily/local-key-engraver.cc | 44 ++++++++++-- lily/main.cc | 7 ++ lily/midi-item.cc | 15 +---- lily/midi-stream.cc | 7 +- lily/midi-walker.cc | 43 ++++++++---- lily/separating-line-group-engraver.cc | 2 +- lily/swallow-engraver.cc | 16 ++++- lily/tie-engraver.cc | 1 - mutopia/Coriolan/header.ly | 67 +++++++++++++++++-- 21 files changed, 187 insertions(+), 244 deletions(-) create mode 100644 input/bugs/tie-break-accidental.ly diff --git a/CHANGES b/CHANGES index ccc8cca90f..6e0a021df9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,18 @@ +1.3.132.jcn2 +============ + +* Attempt at fixing input/bugs/tie-break-accidental.ly, but no luck. +See comments in Local_key_engraver. + +* Removed some cruft from lily/include/. + +* Bugfix: tied notes in chords sometimes got stuck in MIDI output +(thanks Mats). + +* Added some example bug files, taken from Coriolan; esp. see +input/bugs/tie-break-accidental.ly, I've seen so much discussion on +this, would have thought we had this right by now. + 1.3.132.jcn1 ============ diff --git a/VERSION b/VERSION index 17bc5677b1..eafe9e8a39 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 PATCH_LEVEL=132 -MY_PATCH_LEVEL=jcn1 +MY_PATCH_LEVEL=jcn2 # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/input/bugs/tie-break-accidental.ly b/input/bugs/tie-break-accidental.ly new file mode 100644 index 0000000000..0b2c0e8ede --- /dev/null +++ b/input/bugs/tie-break-accidental.ly @@ -0,0 +1,14 @@ +\header { +texidoc = "First and second bes (tied across line break) +should get an accidental, but others should not"; +} + +\score { + \notes { + bes1 ~ | \break + bes2 ~ bes4 ~ bes4 ~ | bes1 + } + \paper { + linewidth = 40*\staffspace; + } +} diff --git a/lily/include/bar-req-collector-engraver.hh b/lily/include/bar-req-collector-engraver.hh index af401e7946..e69de29bb2 100644 --- a/lily/include/bar-req-collector-engraver.hh +++ b/lily/include/bar-req-collector-engraver.hh @@ -1,26 +0,0 @@ -/* - bar-req-collect-engraver.hh -- declare - - source file of the GNU LilyPond music typesetter - - (c) 1999--2001 Han-Wen Nienhuys - - */ - -#ifndef BAR_REQ_COLLECT_ENGRAVER_HH -#define BAR_REQ_COLLECT_ENGRAVER_HH - -#include "engraver.hh" -class Bar_req_collect_engraver : public Engraver -{ - Bar_req* bar_req_l_; -public: - VIRTUAL_COPY_CONS(Translator); - void start_translation_timestep (); - bool try_music (Music *); -}; - - - -#endif /* Bar_Req_COLLECT_ENGRAVER_HH */ - diff --git a/lily/include/hara-kiri-engraver.hh b/lily/include/hara-kiri-engraver.hh index c1eb5d444f..e69de29bb2 100644 --- a/lily/include/hara-kiri-engraver.hh +++ b/lily/include/hara-kiri-engraver.hh @@ -1,15 +0,0 @@ -/* - hara-kiri-engraver.hh -- declare Hara_kiri_engraver - - source file of the GNU LilyPond music typesetter - - (c) 1999--2001 Han-Wen Nienhuys - - */ - -#ifndef HARA_KIRI_ENGRAVER_HH -#define HARA_KIRI_ENGRAVER_HH - -#include "axis-group-engraver.hh" - -#endif /* HARA_KIRI_ENGRAVER_HH */ diff --git a/lily/include/hara-kiri-line-group-engraver.hh b/lily/include/hara-kiri-line-group-engraver.hh index 18c3fb8394..e69de29bb2 100644 --- a/lily/include/hara-kiri-line-group-engraver.hh +++ b/lily/include/hara-kiri-line-group-engraver.hh @@ -1,38 +0,0 @@ -/* - hara-kiri-line-group-engraver.hh -- declare Hara_kiri_line_group_engraver - - source file of the GNU LilyPond music typesetter - - (c) 1998--2001 Jan Nieuwenhuizen -*/ - - -#ifndef HARA_KIRI_LINE_GROUP_GRAV_HH -#define HARA_KIRI_LINE_GROUP_GRAV_HH - -#include "line-group-group-engraver.hh" - -/** - Just as Line_group_engraver, Find interesting items for - Hara_kiri_line_group_engraver. - - - - @see - Hara_kiri_vertical_group_spanner - - - */ -class Hara_kiri_line_group_engraver : public Line_group_engraver_group -{ -public: - VIRTUAL_COPY_CONS (Translator); - -protected: - virtual void create_line_spanner (); - void typeset_grob (Grob*); -}; - - -#endif // HARA_KIRI_LINE_GROUP_GRAV_HH - diff --git a/lily/include/main.hh b/lily/include/main.hh index e495ade889..5405857a4b 100644 --- a/lily/include/main.hh +++ b/lily/include/main.hh @@ -25,6 +25,7 @@ extern void set_inclusion_names (Array); extern bool dependency_global_b; extern String dependency_prefix_global; extern Array dump_header_fieldnames_global; +extern bool midi_debug_global_b; extern bool no_paper_global_b; extern bool no_timestamps_global_b; extern String output_format_global; diff --git a/lily/include/separating-line-group-engraver.hh b/lily/include/separating-line-group-engraver.hh index 5a5f7302cf..e69de29bb2 100644 --- a/lily/include/separating-line-group-engraver.hh +++ b/lily/include/separating-line-group-engraver.hh @@ -1,13 +0,0 @@ -/* - separating-line-group-engraver.hh -- declare Separating_line_group_engraver - - source file of the GNU LilyPond music typesetter - - (c) 1998--2001 Han-Wen Nienhuys - - */ - -#ifndef SEPARATING_LINE_GROUP_GRAV_HH -#define SEPARATING_LINE_GROUP_GRAV_HH -#endif /* SEPARATING_LINE_GROUP_GRAV_HH */ - diff --git a/lily/include/span-score-bar-engraver.hh b/lily/include/span-score-bar-engraver.hh index b36c83fa69..e69de29bb2 100644 --- a/lily/include/span-score-bar-engraver.hh +++ b/lily/include/span-score-bar-engraver.hh @@ -1,54 +0,0 @@ -/* - span-score-bar-engraver.hh -- declare Span_score_bar_engraver - - source file of the GNU LilyPond music typesetter - - (c) 1997--2001 Han-Wen Nienhuys -*/ - - -#ifndef SPAN_SCORE_BAR_GRAV_HH -#define SPAN_SCORE_BAR_GRAV_HH - -#include "base-span-bar-engraver.hh" - -/** - - Make the bars that Span the entire score line (system). A - Span_bar_engraver which generates a special bar. - - */ - -class Span_score_bar_engraver : public Base_span_bar_engraver -{ -public: - VIRTUAL_COPY_CONS (Translator); - Span_score_bar_engraver (); - virtual Span_bar* get_span_bar_p () const; -}; - -/** - Make a piano brace. (No, this doesn't manufacture ``Please don't - shoot the piano player.'' signs) - */ -class Piano_bar_engraver : public Span_score_bar_engraver -{ -public: - VIRTUAL_COPY_CONS (Translator); - - virtual Span_bar * get_span_bar_p () const; -}; - -/** - Make Choir brackets. - */ -class Staff_group_bar_engraver : public Span_score_bar_engraver -{ -public: - VIRTUAL_COPY_CONS (Translator); - - virtual Span_bar * get_span_bar_p () const; - virtual void acknowledge_grob (Grob_info); -}; - -#endif // SPAN_SCORE_BAR_GRAV_HH diff --git a/lily/include/swallow-engraver.hh b/lily/include/swallow-engraver.hh index 49bc28bc95..e69de29bb2 100644 --- a/lily/include/swallow-engraver.hh +++ b/lily/include/swallow-engraver.hh @@ -1,26 +0,0 @@ -/* - swallow-engraver.hh -- declare Swallow_engraver - - source file of the GNU LilyPond music typesetter - - (c) 1997--2001 Han-Wen Nienhuys -*/ - - -#ifndef SWALLOW_GRAV_HH -#define SWALLOW_GRAV_HH - -#include "engraver.hh" - -/** - This engraver swallows everything given to it silently. The purpose of - this is to prevent spurious "request junked" warnings. - */ -class Swallow_engraver : public Engraver { -protected: - bool try_music (Music*) ; -public: - VIRTUAL_COPY_CONS(Translator); - -}; -#endif // SWALLOW_GRAV_HH diff --git a/lily/include/tie-engraver.hh b/lily/include/tie-engraver.hh index 089be415ba..e69de29bb2 100644 --- a/lily/include/tie-engraver.hh +++ b/lily/include/tie-engraver.hh @@ -1,13 +0,0 @@ -/* - ctie-engraver.hh -- declare Tie_engraver - - source file of the GNU LilyPond music typesetter - - (c) 1998--2001 Han-Wen Nienhuys - - */ - -#ifndef CTIE_ENGRAVER_HH -#define CTIE_ENGRAVER_HH -#endif /* CTIE_ENGRAVER_HH */ - diff --git a/lily/include/tuplet-engraver.hh b/lily/include/tuplet-engraver.hh index 7505980fec..e69de29bb2 100644 --- a/lily/include/tuplet-engraver.hh +++ b/lily/include/tuplet-engraver.hh @@ -1,12 +0,0 @@ -/* - auto-plet-engraver.hh -- declare Auto_plet_engraver - - source file of the GNU LilyPond music typesetter - - (c) 1998--2001 Han-Wen Nienhuys - - */ - -#ifndef AUTO_PLET_ENGRAVER_HH -#define AUTO_PLET_ENGRAVER_HH - diff --git a/lily/local-key-engraver.cc b/lily/local-key-engraver.cc index 0337c55b6f..e473c5a5ab 100644 --- a/lily/local-key-engraver.cc +++ b/lily/local-key-engraver.cc @@ -51,7 +51,7 @@ public: Link_array mel_l_arr_; Link_array support_l_arr_; Link_array forced_l_arr_; - Link_array tied_l_arr_; + Link_array tie_l_arr_; Local_key_engraver(); Item * grace_align_l_; @@ -98,9 +98,40 @@ Local_key_engraver::create_grobs () bool different = !gh_equal_p(prev_acc , gh_int2scm(a)); int p = gh_number_p(prev_acc) ? gh_scm2int(prev_acc) : 0; - bool tie_changes = tied_l_arr_.find_l (support_l) && different; - if ((to_boolean (note_l->get_mus_property ("force-accidental")) - || different) && !tie_changes) + /* + Find if we're + a. at right end of a tie -> tie_changes := different + b. at right end of broken tie -> tie_broken + + Ugh: we're never case b., even when tie should be broken, + are we maybe called *before* line breaking? + */ + bool tie_broken = false; + bool tie_changes = false; + for (int i=0; i < tie_l_arr_.size (); i++) + if (support_l == Tie::head (tie_l_arr_[i], RIGHT)) + { + tie_changes = different; + Spanner *sp = dynamic_cast (tie_l_arr_[i]); + if (!Tie::head (tie_l_arr_[i], LEFT) + || (sp && sp->broken_into_l_arr_.size () + && !Tie::head (sp->broken_into_l_arr_[0], LEFT))) + tie_broken = true; + break; + } + + /* + Some comment here. + When do we want ties: + + 1. when property force-accidental is set, and not tie_changes + 2. when different and not tie-changes + 3. always after a line break -> why doesn't this work? + */ + if (((to_boolean (note_l->get_mus_property ("force-accidental")) + || different) + && !tie_changes) + || tie_broken) { if (!key_item_p_) { @@ -138,6 +169,7 @@ Local_key_engraver::create_grobs () /* Remember an alteration that is different both from that of the tied note and of the key signature. + */ localsig = scm_assoc_set_x (localsig, gh_cons (gh_int2scm (o), gh_int2scm (n)), @@ -206,7 +238,7 @@ Local_key_engraver::stop_translation_timestep() grace_align_l_ = 0; mel_l_arr_.clear(); arpeggios_.clear (); - tied_l_arr_.clear(); + tie_l_arr_.clear (); support_l_arr_.clear(); forced_l_arr_.clear(); } @@ -236,7 +268,7 @@ Local_key_engraver::acknowledge_grob (Grob_info info) } else if (Tie::has_interface (info.elem_l_)) { - tied_l_arr_.push (Tie::head (info.elem_l_, RIGHT)); + tie_l_arr_.push (info.elem_l_); } else if (Arpeggio::has_interface (info.elem_l_)) { diff --git a/lily/main.cc b/lily/main.cc index 8713c7d741..868dbbd077 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -50,6 +50,9 @@ Array dump_header_fieldnames_global; /* Name of initialisation file. */ String init_name_global; +/* Write midi as formatted ascii stream? */ +bool midi_debug_global_b; + /* Do not calculate and write paper output? */ bool no_paper_global_b = false; @@ -116,6 +119,7 @@ static Long_option_init options_static[] = { {0, "version", 'v', _i ("print version number")}, {0, "verbose", 'V', _i("verbose")}, {0, "warranty", 'w', _i ("show warranty and copyright")}, + {0, "midi-debug", 'X', _i ("write midi ouput in formatted ascii")}, {0,0,0,0} }; @@ -456,6 +460,9 @@ main (int argc, char **argv) case 'T': no_timestamps_global_b = true; break; + case 'X': + midi_debug_global_b = true; + break; default: assert (false); break; diff --git a/lily/midi-item.cc b/lily/midi-item.cc index a44155c073..64aa262a26 100644 --- a/lily/midi-item.cc +++ b/lily/midi-item.cc @@ -7,6 +7,7 @@ */ #include "debug.hh" +#include "main.hh" #include "misc.hh" #include "string.hh" #include "string-convert.hh" @@ -594,26 +595,16 @@ Midi_track::add (Moment delta_time_mom, Midi_item* midi_p) event_p_list_.append (new Killing_cons (e, 0)); } -extern bool verbose_global_b; - String Midi_track::data_str () const { String str = Midi_chunk::data_str (); -#if 0 - if (flower_dstream && !flower_dstream->silent_b ("Midistrings")) -#else - if (verbose_global_b) -#endif + if (midi_debug_global_b) str += "\n"; for (Cons *i=event_p_list_.head_; i; i = i->next_) { str += i->car_->str (); -#if 0 - if (flower_dstream && !flower_dstream->silent_b ("Midistrings")) -#else - if (verbose_global_b) -#endif + if (midi_debug_global_b) str += "\n"; } return str; diff --git a/lily/midi-stream.cc b/lily/midi-stream.cc index cdaf316cf8..813694b29e 100644 --- a/lily/midi-stream.cc +++ b/lily/midi-stream.cc @@ -34,16 +34,11 @@ Midi_stream::operator << (String str) return *this; } -extern bool verbose_global_b; Midi_stream& Midi_stream::operator << (Midi_item const& midi_c_r) { String str = midi_c_r.str (); -#if 0 - if (flower_dstream && !flower_dstream->silent_b ("Midistrings")) -#else - if (verbose_global_b) -#endif + if (midi_debug_global_b) { str = String_convert::bin2hex_str (str) + "\n"; // ugh, should have separate debugging output with Midi*::print routines diff --git a/lily/midi-walker.cc b/lily/midi-walker.cc index b99b611c69..986a58ebdb 100644 --- a/lily/midi-walker.cc +++ b/lily/midi-walker.cc @@ -48,26 +48,43 @@ Midi_walker::do_start_note (Midi_note* note_p) { Audio_item* ptr = (*item_l_arr_l_)[index_]; Moment stop_mom = note_p->length_mom () + ptr->audio_column_l_->at_mom (); + + bool play_start = true; for (int i=0; i < stop_note_queue.size(); i++) { + /* if this pith already in queue */ if (stop_note_queue[i].val->pitch_i() == note_p->pitch_i ()) { if (stop_note_queue[i].key < stop_mom) - stop_note_queue[i].ignore_b_ = true; - else { - // skip the stopnote - delete note_p; - return; + { + /* let stopnote in queue be ignored, + new stop note wins */ + stop_note_queue[i].ignore_b_ = true; + /* don't replay start note, */ + play_start = false; + break; + } + else + { + /* skip this stopnote, + don't play the start note */ + delete note_p; + note_p = 0; + break; } } } - Midi_note_event e; - e.val = new Midi_note_off (note_p); - e.key = stop_mom; - stop_note_queue.insert (e); - - output_event (ptr->audio_column_l_->at_mom (), note_p); + if (note_p) + { + Midi_note_event e; + e.val = new Midi_note_off (note_p); + e.key = stop_mom; + stop_note_queue.insert (e); + + if (play_start) + output_event (ptr->audio_column_l_->at_mom (), note_p); + } } /** @@ -111,8 +128,8 @@ Midi_walker::process() /* THIS IS A MEMORY LEAK. FIXME. - */ - //Midi_item* p = ptr->midi_item_p (); + where's the leak? Everything goet to Midi_track, in a killing_cons. + */ if (Midi_item* midi_p = Midi_item::midi_p (audio_p)) { midi_p->channel_i_ = track_l_->number_i_; diff --git a/lily/separating-line-group-engraver.cc b/lily/separating-line-group-engraver.cc index 0e726c1d4f..cb3f54040e 100644 --- a/lily/separating-line-group-engraver.cc +++ b/lily/separating-line-group-engraver.cc @@ -1,5 +1,5 @@ /* - separating-line-group-engraver.cc -- implement Separating_line_group_engraver +' separating-line-group-engraver.cc -- implement Separating_line_group_engraver source file of the GNU LilyPond music typesetter diff --git a/lily/swallow-engraver.cc b/lily/swallow-engraver.cc index 26719c8477..3823f2c1f5 100644 --- a/lily/swallow-engraver.cc +++ b/lily/swallow-engraver.cc @@ -5,12 +5,22 @@ (c) 1997--2001 Han-Wen Nienhuys */ -#include "swallow-engraver.hh" +#include "engraver.hh" +/** + This engraver swallows everything given to it silently. The purpose of + this is to prevent spurious "request junked" warnings. + */ +class Swallow_engraver : public Engraver +{ +public: + VIRTUAL_COPY_CONS (Translator); +protected: + bool try_music (Music*) ; +}; -ADD_THIS_TRANSLATOR(Swallow_engraver); - +ADD_THIS_TRANSLATOR (Swallow_engraver); bool Swallow_engraver::try_music (Music*) diff --git a/lily/tie-engraver.cc b/lily/tie-engraver.cc index 75139c817d..2d65a00d02 100644 --- a/lily/tie-engraver.cc +++ b/lily/tie-engraver.cc @@ -7,7 +7,6 @@ */ -#include "tie-engraver.hh" #include "command-request.hh" #include "rhythmic-head.hh" #include "musical-request.hh" diff --git a/mutopia/Coriolan/header.ly b/mutopia/Coriolan/header.ly index 1bab08c797..004a4de362 100644 --- a/mutopia/Coriolan/header.ly +++ b/mutopia/Coriolan/header.ly @@ -15,10 +15,69 @@ mutopiaopus = "O62"; mutopiainstrument = \instrument; date = "1807"; + + %{ + + From Ouverture Coriolan is no Urtext edition available, although + there are Urtext editions of Beethoven's symphonys. The Eulenburg + edition is commonly regarded as the Coriolan Urtext. + + Edition Eulenburg is the ``first after many years'' that tries to + stay as close to the original text as possible. During the 1900s, + it was customary for editors not to respect the original text and + make any changes they thought necessary. Unger made corrections for + a few ``small and obvious'' inaccuracies. This is the only score + edition to abbreviate (LilyPond source notation) + + [es16 es g g] [b b c c] + + using the notation + + [es8:16 g: b: c:] + + however, editions of individual parts by Breitkopf and Haertel use + this common practice abbreviation too. + + Edition Beethoven's Werke by Breitkopf and Haertel comes without any + commentary, copyright mark or date. There are no significant + differences with ed. Unger. The copy was very old and worn, but is + probably younger than ed. Unger. + + Edition Beethoven Werke by G. Henle was a new study based upon the + three main sources, the score autograph, the published parts + Stimmen-Drucke N.Simrock Bonn (most probably from 1807) and + Industriekontor Vienna (1807). They reinforce the assumptions made + by Unger that both published parts were first prints, noting that + both must have worked from a different copy of the autograph (and + not from the autograph itself), and that Simrock's is a bit closer + to the original autograph. This edition is supposed to deviate from + the autograph only in using `modernised notation' for the following + cases (LilyPond source notation). + + i. Use dots instead of ties for sustaining of notes when there's no + measure break: + + c4 ~ c8 -> c4. + + ii. Don't repeat accidentals within the same measure: - source = "i. Ed. Dr. Max Unger 1936 from and following score autograph and - original published parts, ie, Stimmen-Drucke N.Simrock Bonn (most probably - from 1807) and Industriekontor Vienna (1807).\\\\ + \key es \major; b4 c b! c | -> \key es \major; b4 c b c + + iii. Start slurring from first tied note, not from second: + + c4 ~ c8 ( d ) e -> c4 ( ~ c8 d ) e + + From these deviations, the third is the only one unique to this + edition, but these are easy to spot and mostly parenthesed; the + other two deviations are standard modern day music notation practice + and thus common to all editions. + + %} + + source = "i. Ed. Eulenburg, edited by dr. Max Unger 1936 from and + following score autograph and original published parts, ie, + Stimmen-Drucke N.Simrock Bonn (most probably from 1807) and + Industriekontor Vienna (1807).\\\\ ii. Beethoven's Werke -- Ouverturen fuer Orchester; Breitkopf u. Haertel, Leipzig (not dated, but very old and worn).\\\\ iii. Beethoven Werke II,1 -- Ouverturen und Wellingtons Sieg; G. Henle @@ -31,7 +90,7 @@ copyright = "Public Domain"; maintainer = "Jan Nieuwenhuizen"; maintainer_email = "janneke@gnu.org"; - lastupdated = "2001/Jan/31"; + lastupdated = "2001/Feb/27"; mutopiapublicdomain = "\\parbox{\hsize}{\\thefooter\\quad\\small \\\\This music is part of the Mutopia project, \\texttt{http://www.mutopiaproject.org/}\\\\It has been typeset -- 2.39.2