2003-08-26 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ * configure.in: bump GCC requirements to 3.x
+
+ * lily/include/audio-item.hh (class Audio_tie): rename
+ note_l_drul_ to note_drul_
+
+ * lily/tie-performer.cc (class Tie_performer): patch for new ties.
+
* lily/parser.yy (relative_music): whoops. All \relative were off
by ... a lot .... Ahem.
@item
@uref{http://gcc.gnu.org/,
The GNU c++ compiler} (version 3.1 or newer).
-EGCS 1.1 may work, but is no longer supported.
+EGCS and 2.x are known to cause crashes.
@item @uref{http://www.python.org,Python} (version 2.1 or newer).
@item The flex precompiled in NetBSD-1.4.2 is broken.
Upgrade to flex-2.5.4a.
+@ignore
+@c is this current?
@item The configuration of Gcc (egcs-2.91.60 19981201 (egcs-1.1.1
release)) does not include @file{/usr/pkg} paths. Configure it using:
@example
CFLAGS='-I /usr/pkg/include' LDFLAGS='-L/usr/pkg/lib' ./configure
@end example
+@end ignore
@end itemize
STEPMAKE_PYTHON(REQUIRED,2.1)
STEPMAKE_GCC(REQUIRED, 2.8)
STEPMAKE_CXX(REQUIRED)
-STEPMAKE_GXX(REQUIRED, 2.95)
+STEPMAKE_GXX(REQUIRED, 3.0)
STEPMAKE_CXXTEMPLATE
STEPMAKE_LIB(REQUIRED)
# Do not use bison 1.50 and 1.75.
\translator {
\ThreadContext
\consists "Tie_engraver"
- \consists "New_tie_engraver"
}
\translator { \VoiceContext
\remove "Tie_engraver"
- \remove "New_tie_engraver"
}
}}
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header {
-#(ly:set-option 'old-relative)
+
\header {
texidoc = "@cindex Ancient Accidentals
Accidentals are available in different ancient styles. This
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header {
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header {
texidoc = "@cindex Bar Lines
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header{
texidoc="@cindex Bar Number Show All
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
% keep for now, although merging into beam-auto-override is a possibility.
\header {
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header {
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header{
texidoc = "@cindex Beaming Presets
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header{
texidoc="@cindex Beam Position Control
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header{
texidoc="@cindex Beam Count
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header {
texidoc = "@cindex Beam Dir Functions
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header{
texidoc="@cindex Beam Isknee
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header{
texidoc="@cindex Beam Neutral Direction
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
% possible rename to invis-notes.ly
% check if other documents call this "blank notes", though. I think
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header {
texidoc = "@cindex Boxed Molecule
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header {
texidoc = "@cindex Capital Letters
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header {
texidoc = "@cindex Chord Octavation
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header{
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header{
texidoc="@cindex Crescendi
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
% possible rename to slurs-?
% TODO: find out what drarn means, and if there's an overlap with drarn.ly
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header{texidoc="@cindex Drarn
You can attach slurs and ties to noteheads.
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header {
texidoc = "@cindex Dynamic Absolute Volume
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
% probably should be merged into refman.
\header{
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header {
texidoc = "@cindex Embedded Postscript
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
% TODO: does this work? It doesn't do anything with 1.7.20
\header {texidoc="@cindex Embedded scm
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header{ texidoc="@cindex Embedded Tex
You can embed Tex commands in your score. "}
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header { texidoc = "@cindex Scheme Move Notehead
You can move objects around with scheme. This example shows how to
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header { texidoc = "
\clef treble
a4. b8 c4 fis |
-V gis~ gis8 fis16^\trill (e) b8 c
+ gis~ gis8 fis16^\trill (e) b8 c
<{ a d}\\ { es,4}>|
}
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
% MERGE with title.ly -gp
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
% candidate for regression. -gp
\header {
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
% possible rename to scheme- or something like that. -gp
\header { texidoc = "@cindex Scheme Move Text
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
% possible rename to bar-lines-foo. -gp
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header { texidoc="@cindex Octave Doubling
Octave doubling parts of music. "
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
% TODO: this example has a ton of text for very little output.
% Is it all needed? -gp
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header { texidoc = "@cindex Part Combine Staff
You can combine parts on two staffs, as well as two voices. "
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header{ texidoc="@cindex Part Combine
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
% check with invisible-notes or blank-notes. possible rename. -gp
\header{ texidoc = "@cindex Partial Blank
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header{ texidoc = "@cindex Pedal
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header{ texidoc="@cindex Phrasing Slur Height
Make PhrasingSlur higher, to avoid colission from other slurs. "
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header { texidoc = "@cindex Repeat Manual
You can manually control repeat signs and numbers to produce
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
% candidate for regression. -gp
\header { texidoc = "@cindex Rest Dot Positions
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header {
texidoc = "@cindex Rests
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
% possible rename to scheme-something.
\header { texidoc="@cindex Scheme Reverse Music
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header { texidoc = "@cindex Script Priority
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header { texidoc = "@cindex Stacked Text Articulation
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
% possible rename. -gp
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header{
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
% TODO bit too wordy; edit a bit to cut stuff. -gp
\header { texidoc ="@cindex Slur Beautiful
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header { texidoc = "@cindex Slur Minimum Length
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header { texidoc="@cindex Slur Ugly
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header {
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header { texidoc = "@cindex Spanner after break
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header { texidoc="@cindex Staff Lines
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
% possible rename to ancient- something.
\header {
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header{ texidoc = "@cindex Stem Length
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header {texidoc = "@cindex Tablature hammer
You can fake a hammer in tablature with slurs. "
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
% TODO: check about other ottava functions.
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header { texidoc = "@cindex Textscript
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header { texidoc = "@cindex Tie Sparse
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header { texidoc= "@cindex Time Signature Double
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
% TODO: This file could be old. Ask about it later. -gp
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
% possible rename to bar-something.
-#(ly:set-option 'old-relative)
+
\version "1.9.1"
\header{ texidoc = "@cindex Transposition
{
elem_ = s;
origin_trans_ =0;
- req_ = r;
+ event_ = r;
}
Audio_element_info::Audio_element_info ()
{
elem_ = 0;
- req_ = 0;
+ event_ = 0;
origin_trans_ =0;
}
Audio_tie::Audio_tie ()
{
- note_l_drul_[RIGHT] = 0;
- note_l_drul_[LEFT] = 0;
+ note_drul_[RIGHT] = 0;
+ note_drul_[LEFT] = 0;
}
void
Audio_tie::set_note (Direction d, Audio_note* note)
{
- assert (!note_l_drul_[d]);
- note_l_drul_[d] = note;
+ assert (!note_drul_[d]);
+ note_drul_[d] = note;
//set_bound (d, head);
// add_dependency (head);
*/
struct Audio_element_info {
Audio_element * elem_;
- Music *req_;
+ Music *event_;
Translator * origin_trans_;
Link_array<Translator> origin_transes (Translator*) const;
public:
Audio_tie ();
void set_note (Direction, Audio_note*);
- Drul_array<Audio_note*> note_l_drul_;
+ Drul_array<Audio_note*> note_drul_;
};
class Audio_time_signature : public Audio_item
{
Grob * h = i.grob_;
now_heads_.push (h);
- for (int i=heads_to_tie_.size (); i--;)
+ for (int i = heads_to_tie_.size (); i--;)
{
Grob *th = heads_to_tie_[i];
int staff_pos = gh_scm2int (h->get_grob_property ("staff-position"));
void
Tie_engraver::stop_translation_timestep ()
{
-
if (ties_.size ())
{
heads_to_tie_.clear ();
#include "performer.hh"
struct CNote_melodic_tuple {
- Music *req_ ;
+ Music *event_ ;
Audio_note *note_;
Moment end_;
CNote_melodic_tuple ();
TRANSLATOR_DECLARATIONS(Tie_performer);
private:
bool done_;
- PQueue<CNote_melodic_tuple> past_notes_pq_;
- Music *req_;
+
Array<CNote_melodic_tuple> now_notes_;
- Array<CNote_melodic_tuple> stopped_notes_;
+ Array<CNote_melodic_tuple> tied_notes_;
+
+ Music *event_;
+ Music * prev_event_;
+
Link_array<Audio_tie> ties_;
protected:
Tie_performer::Tie_performer ()
{
- req_ = 0;
+ event_ = 0;
done_ = false;
}
void
Tie_performer::initialize ()
{
- req_ = 0;
+ event_ = 0;
}
bool
Tie_performer::try_music (Music *m)
{
- if (!req_)
+ if (!event_)
{
- req_ = m;
+ event_ = m;
return true;
}
return false;
{
if (Audio_note *nh = dynamic_cast<Audio_note *> (i.elem_))
{
- Music *m = i.req_;
+ Music *m = i.event_;
if (m->is_mus_type ("note-event"))
now_notes_.push (CNote_melodic_tuple (nh, m, now_mom ()+ m->get_length ()));
}
void
Tie_performer::create_audio_elements ()
{
- if (req_ && ! done_)
- {
- Moment now = now_mom ();
- Link_array<Audio_note> nharr;
-
- stopped_notes_.clear ();
- while (past_notes_pq_.size ()
- && past_notes_pq_.front ().end_ == now)
- stopped_notes_.push (past_notes_pq_.get ());
- done_ = true;
- return;
- }
-
- if (req_)
+ /*
+ This is a nested loop. Not optimal, but good enough.
+ */
+ if (tied_notes_.size ())
{
- now_notes_.sort (CNote_melodic_tuple::pitch_compare);
- stopped_notes_.sort (CNote_melodic_tuple::pitch_compare);
- int i=0;
- int j=0;
- int tie_count=0;
- while (i < now_notes_.size () && j < stopped_notes_.size ())
+ Moment now = now_mom();
+ for (int i = tied_notes_.size (); i--; )
{
- int comp
- = Pitch::compare (*unsmob_pitch (now_notes_[i].req_->get_mus_property ("pitch")),
- *unsmob_pitch (stopped_notes_[j].req_->get_mus_property ("pitch")));
+ if (tied_notes_[i].end_ != now)
+ continue;
- if (comp)
+ for (int j = now_notes_.size(); j--;)
{
- (comp < 0) ? i ++ : j++;
- continue;
- }
- else
- {
- tie_count ++;
+ int comp
+ = Pitch::compare (*unsmob_pitch (tied_notes_[i].event_->get_mus_property ("pitch")),
+ *unsmob_pitch (now_notes_[j].event_->get_mus_property ("pitch")));
- /* don't go around recreating ties that were already
- made. Not infallible. Due to reordering in sort (),
- we will make the wrong ties when notenotes are
- added. */
- if (tie_count > ties_.size ())
+ if (comp == 0)
{
+
Audio_tie * p = new Audio_tie;
- p->set_note (LEFT, stopped_notes_[j].note_);
- p->set_note (RIGHT, now_notes_[i].note_);
+ p->set_note (LEFT, tied_notes_[i].note_);
+ p->set_note (RIGHT, now_notes_[j].note_);
ties_.push (p);
- announce_element (Audio_element_info (p, req_));
+ announce_element (Audio_element_info (p, event_));
+
+ tied_notes_.del (i);
}
- i++;
- j++;
-
}
}
-
- if (!ties_.size ())
- {
- req_->origin ()->warning (_ ("No ties were created!"));
- }
}
}
void
Tie_performer::stop_translation_timestep ()
{
- for (int i=0; i < now_notes_.size (); i++)
+ if (prev_event_ && tied_notes_.size () && !ties_.size ())
{
- past_notes_pq_.insert (now_notes_[i]);
+ prev_event_->origin ()->warning (_ ("No ties were performed."));
}
- now_notes_.clear ();
+ else
+ prev_event_ = 0;
+
+ if (event_)
+ {
+ tied_notes_ = now_notes_ ;
+ prev_event_ = event_;
+ }
+ else
+ {
+ tied_notes_.clear ();
+ }
+
+ event_ = 0;
+ now_notes_ .clear ();
for (int i=0; i< ties_.size (); i++)
- {
- //play_element (ties_[i]);
- ties_[i]->note_l_drul_[RIGHT]->tie_to (ties_[i]->note_l_drul_[LEFT]);
- }
+ {
+ ties_[i]->note_drul_[RIGHT]->tie_to (ties_[i]->note_drul_[LEFT]);
+ }
+
ties_.clear ();
}
void
Tie_performer::start_translation_timestep ()
{
- req_ =0;
+ event_ =0;
done_ = false;
Moment now = now_mom ();
- while (past_notes_pq_.size () && past_notes_pq_.front ().end_ < now)
- past_notes_pq_.delmin ();
+ for (int i= tied_notes_.size ();
+ i -- ;)
+ {
+ if (tied_notes_[i].end_ < now)
+ tied_notes_.del (i);
+ else
+ break ;
+ }
}
CNote_melodic_tuple::CNote_melodic_tuple ()
{
note_ =0;
- req_ =0;
+ event_ =0;
end_ = 0;
}
CNote_melodic_tuple::CNote_melodic_tuple (Audio_note *h, Music*m, Moment mom)
{
note_ = h;
- req_ = m;
+ event_ = m;
end_ = mom;
}
CNote_melodic_tuple::pitch_compare (CNote_melodic_tuple const&h1,
CNote_melodic_tuple const &h2)
{
- SCM p1 = h1.req_->get_mus_property ("pitch");
- SCM p2 = h2.req_->get_mus_property ("pitch");
+ SCM p1 = h1.event_->get_mus_property ("pitch");
+ SCM p2 = h2.event_->get_mus_property ("pitch");
return Pitch::compare (*unsmob_pitch (p1),
*unsmob_pitch (p2));
}
% why here ?
\consists "Output_property_engraver"
-
}
\name Voice
\consists "Dynamic_performer"
\consists "Span_dynamic_performer"
+ \consists "Tie_performer"
\consists "Piano_pedal_performer"
\accepts "Thread"
}
\type "Performer_group_performer"
\name Thread
\consists "Note_performer"
- \consists "Tie_performer"
}
FiguredBassContext = \translator {
cmd = "latex '\\nonstopmode \input %s'" % fname
# Ugh. (La)TeX writes progress and error messages on stdout
# Redirect to stderr
- cmd += ' 1>/dev/stderr'
+ cmd = '(( %s >&2 ) >&- )' % cmd
status = ly.system (cmd, ignore_error = 1)
signal = 0xf & status
exit_status = status >> 8
cmd = r"latex '\nonstopmode \input %s'" % file
# Ugh. (La)TeX writes progress and error messages on stdout
# Redirect to stderr
- cmd += ' 1>/dev/stderr'
+ cmd = '(( %s >&2 ) >&- )' % cmd
+
ly.system (cmd)
ly.system ("dvips -E -o %s.eps %s" % (file, file))
map (to_eps, eps)