2002-11-02 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ * 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.
\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-]
}
}
}
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 */ "");
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",
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) ;
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 */ "",
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");
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<Grob> now_heads_;
Link_array<Grob> stopped_heads_;
Link_array<Grob> ties_;
Tie_engraver::Tie_engraver ()
{
- req_ = 0;
+ event_ = 0;
tie_column_ = 0;
}
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;
}
void
Tie_engraver::process_acknowledged_grobs ()
{
- if (req_)
+ if (event_)
{
now_heads_.sort (&head_pitch_compare);
/*
Tie::set_head (p,RIGHT, dynamic_cast<Item*> (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))
{
Tie::set_head (p, RIGHT, dynamic_cast<Item*> (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_)
void
Tie_engraver::stop_translation_timestep ()
{
- req_ = 0;
-
+ event_ = 0;
now_heads_.clear ();
/*
it at the top.
*/
stopped_heads_.reverse();
+
+ event_ = 0;
}
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 ());
;; 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"))
\consists "Phrasing_slur_engraver"
\consists "Slur_engraver"
\consists "Tie_engraver"
+ \consists "New_tie_engraver"
\consists "Porrectus_engraver"
\consists "Tuplet_engraver"
\consists "A2_engraver"
(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.")