From: Han-Wen Nienhuys Date: Sat, 2 Nov 2002 14:15:19 +0000 (+0000) Subject: * lily/parser.yy (event_that_take_dir): allow postfix notation for ties. X-Git-Tag: release/1.7.6~6 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=f1f05196a6b5048718405a0810868c145bceef29;p=lilypond.git * lily/parser.yy (event_that_take_dir): allow postfix notation for ties. * lily/new-tie-engraver.cc (process_acknowledged_grobs): new engraver. process ties in postfix notation, i.e. c8-~ c * lilypond-mode.el (LilyPond-command-alist): run LaTeX by default. * input/regression/beam-postfix-notation.ly (texidoc): new file. * lily/parser.yy (event_that_take_dir): allows c8-[ for beams. --- diff --git a/ChangeLog b/ChangeLog index 92a3a0f9d3..f06a45c602 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2002-11-02 Han-Wen Nienhuys + * lily/parser.yy (event_that_take_dir): allow postfix notation for ties. + + * lily/new-tie-engraver.cc (process_acknowledged_grobs): new + engraver. process ties in postfix notation, i.e. c8-~ c + + * lilypond-mode.el (LilyPond-command-alist): run LaTeX by default. + * input/regression/beam-postfix-notation.ly (texidoc): new file. * lily/parser.yy (event_that_take_dir): allows c8-[ for beams. diff --git a/input/regression/beam-postfix-notation.ly b/input/regression/beam-postfix-notation.ly index 9d220c4dda..79aec2c28e 100644 --- a/input/regression/beam-postfix-notation.ly +++ b/input/regression/beam-postfix-notation.ly @@ -1,14 +1,14 @@ \header { -texidoc = "Beams may be entered in postfix notation, separating the +texidoc = "Beams and ties may be entered in postfix notation, separating the notes and the brackets with a dash." } \score { - \notes + \notes\relative c'' { - c8-[ c-] + c8-[-~ c-] } } diff --git a/lily/a2-engraver.cc b/lily/a2-engraver.cc index 2897e39f95..c1b5e47036 100644 --- a/lily/a2-engraver.cc +++ b/lily/a2-engraver.cc @@ -200,19 +200,17 @@ A2_engraver::stop_translation_timestep () } ENTER_DESCRIPTION(A2_engraver, -/* descr */ "Part combine engraver for orchestral scores. \ - \ -The markings @emph{a2}, @emph{Solo} and @emph{Solo II}, are \ -created by this engraver. It also acts upon instructions of the part \ -combiner. Another thing that the this engraver, is forcing of stem, \ -slur and tie directions, always when both threads are not identical; \ -up for the musicexpr called @code{one}, down for the musicexpr called \ -@code{two}. \ - -", +/* descr */ "Part combine engraver for orchestral scores. " +"The markings @emph{a2}, @emph{Solo} and @emph{Solo II}, are " +"created by this engraver. It also acts upon instructions of the part " +"combiner. Another thing that the this engraver, is forcing of stem, " +"slur and tie directions, always when both threads are not identical; " +"up for the musicexpr called @code{one}, down for the musicexpr called " +"@code{two}. " +, /* creats*/ "TextScript", /* accepts */ "", -/* acks */ "multi-measure-rest-interface -slur-interface stem-interface tie-interface note-head-interface dynamic-interface text-interface" +/* acks */ "multi-measure-rest-interface " +"slur-interface stem-interface tie-interface note-head-interface dynamic-interface text-interface" ,/* reads */ "combineParts noDirection soloADue soloText soloIIText aDueText split-interval unison solo unisilence unirhythm", /* write */ ""); diff --git a/lily/accidental-engraver.cc b/lily/accidental-engraver.cc index 75816c76ec..b2ff103ff3 100644 --- a/lily/accidental-engraver.cc +++ b/lily/accidental-engraver.cc @@ -479,10 +479,9 @@ Accidental_engraver::process_music () ENTER_DESCRIPTION (Accidental_engraver, -"Make accidentals. Catches note heads, ties and notices key-change -events. Due to interaction with ties (which don't come together -with note heads), this needs to be in a context higher than Tie_engraver.", - +"Make accidentals. Catches note heads, ties and notices key-change " +" events. Due to interaction with ties (which don't come together " +" with note heads), this needs to be in a context higher than Tie_engraver.", "Accidental", /* accepts */ "", "rhythmic-head-interface tie-interface arpeggio-interface", diff --git a/lily/include/tie.hh b/lily/include/tie.hh index 186da434a9..7b6a4bc52c 100644 --- a/lily/include/tie.hh +++ b/lily/include/tie.hh @@ -17,7 +17,7 @@ class Tie { public: - static void set_head (Grob*,Direction, Item*head); + static void set_head (Grob*,Direction, Grob*head); static void set_interface (Grob*); static bool has_interface (Grob*); static Grob * head (Grob*,Direction) ; diff --git a/lily/new-accidental-engraver.cc b/lily/new-accidental-engraver.cc index d8ae2948ae..0ad9430607 100644 --- a/lily/new-accidental-engraver.cc +++ b/lily/new-accidental-engraver.cc @@ -550,9 +550,9 @@ New_accidental_engraver::process_music () ENTER_DESCRIPTION (New_accidental_engraver, -"Make accidentals. Catches note heads, ties and notices key-change -events. Due to interaction with ties (which don't come together -with note heads), this needs to be in a context higher than Tie_engraver.", +"Make accidentals. Catches note heads, ties and notices key-change " +"events. Due to interaction with ties (which don't come together " +"with note heads), this needs to be in a context higher than Tie_engraver.", "Accidental", /* accepts */ "", diff --git a/lily/parser.yy b/lily/parser.yy index 5bcdd71b21..d124c5095d 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -1431,6 +1431,11 @@ event_that_take_dir: m->set_mus_property ("span-direction" , gh_int2scm (STOP)); $$ = m; } + | '~' { + Music * m = MY_MAKE_MUSIC ("NewTieEvent"); + m->set_spot (THIS->here_input()); + $$ = m; + } | script_abbreviation { SCM s = THIS->lexer_->lookup_identifier ("dash" + ly_scm2string ($1)); Music *a = MY_MAKE_MUSIC("ArticulationEvent"); diff --git a/lily/tie-engraver.cc b/lily/tie-engraver.cc index 9c71a483b8..eb9caa5791 100644 --- a/lily/tie-engraver.cc +++ b/lily/tie-engraver.cc @@ -25,15 +25,17 @@ just at this time, and note that start at this time. TODO: Remove the dependency on musical info. We should tie on the - basis of position and duration-log of the heads (not of the reqs). + basis of position and duration-log of the heads (not of the events). + New tie event happens at the time of the first note, the */ class Tie_engraver : public Engraver { Moment end_mom_; Moment next_end_mom_; - Music *req_; + Music *event_; + Link_array now_heads_; Link_array stopped_heads_; Link_array ties_; @@ -57,7 +59,7 @@ public: Tie_engraver::Tie_engraver () { - req_ = 0; + event_ = 0; tie_column_ = 0; } @@ -65,12 +67,19 @@ Tie_engraver::Tie_engraver () bool Tie_engraver::try_music (Music *mus) { - req_ = mus; - SCM m = get_property ("automaticMelismata"); - bool am = gh_boolean_p (m) &&gh_scm2bool (m); - if (am) + if(mus->is_mus_type( "tie-event")) { - set_melisma (true); + event_ = mus; + } + + if (event_) + { + SCM m = get_property ("automaticMelismata"); + bool am = gh_boolean_p (m) &&gh_scm2bool (m); + if (am) + { + set_melisma (true); + } } return true; } @@ -103,7 +112,7 @@ head_pitch_compare (Grob *const&a,Grob *const&b) void Tie_engraver::process_acknowledged_grobs () { - if (req_) + if (event_) { now_heads_.sort (&head_pitch_compare); /* @@ -153,7 +162,7 @@ Tie_engraver::process_acknowledged_grobs () Tie::set_head (p,RIGHT, dynamic_cast (unsmob_grob (ly_cdr (pair)))); ties_.push (p); - announce_grob(p, req_->self_scm()); + announce_grob(p, event_->self_scm()); } else for (SCM s = head_list; gh_pair_p (s); s = ly_cdr (s)) { @@ -164,7 +173,7 @@ Tie_engraver::process_acknowledged_grobs () Tie::set_head (p, RIGHT, dynamic_cast (unsmob_grob (ly_cdar (s)))); ties_.push (p); - announce_grob(p, req_->self_scm()); + announce_grob(p, event_->self_scm()); } if (ties_.size () > 1 && !tie_column_) @@ -182,8 +191,7 @@ Tie_engraver::process_acknowledged_grobs () void Tie_engraver::stop_translation_timestep () { - req_ = 0; - + event_ = 0; now_heads_.clear (); /* @@ -268,6 +276,8 @@ Tie_engraver::start_translation_timestep () it at the top. */ stopped_heads_.reverse(); + + event_ = 0; } diff --git a/lily/tie.cc b/lily/tie.cc index b59f8d21b5..46c42a819b 100644 --- a/lily/tie.cc +++ b/lily/tie.cc @@ -37,7 +37,7 @@ void -Tie::set_head (Grob*me,Direction d, Item * h) +Tie::set_head (Grob*me,Direction d, Grob * h) { assert (!head (me,d)); index_set_cell (me->get_grob_property ("heads"), d, h->self_scm ()); diff --git a/lilypond-mode.el b/lilypond-mode.el index 6c947e00e6..a18d05a9fd 100644 --- a/lilypond-mode.el +++ b/lilypond-mode.el @@ -168,7 +168,7 @@ in LilyPond-include-path." ;; This is the major configuration variable. (defcustom LilyPond-command-alist `( - ("LilyPond" . ("lilypond %s" . "TeX")) + ("LilyPond" . ("lilypond %s" . "LaTeX")) ("TeX" . ("tex '\\nonstopmode\\input %t'" . "View")) ("2Dvi" . ("ly2dvi %s" . "View")) diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index bfdf7047eb..da2571f6bc 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -162,6 +162,7 @@ VoiceContext = \translator { \consists "Phrasing_slur_engraver" \consists "Slur_engraver" \consists "Tie_engraver" + \consists "New_tie_engraver" \consists "Porrectus_engraver" \consists "Tuplet_engraver" \consists "A2_engraver" diff --git a/scm/music-types.scm b/scm/music-types.scm index b6098a54f7..5f4a5e9968 100644 --- a/scm/music-types.scm +++ b/scm/music-types.scm @@ -465,6 +465,12 @@ is an articulation (such as @code{-.}, @code{->}, @code{\\tenuto}, (internal-class-name . "Event") (types . (general-music tie-event event)) )) + (NewTieEvent + . ( + (description . "A tie. Entered as @var{note}-~.") + (internal-class-name . "Event") + (types . (general-music new-tie-event event)) + )) (TremoloEvent . ( (description . "Un measured tremolo.")