---- ../lilypond-1.4.8.jcn1/CHANGES Mon Oct 1 13:45:09 2001
+--- ../lilypond-1.4.8.jcn2/CHANGES Mon Nov 12 15:35:25 2001
+++ b/CHANGES Wed Nov 14 09:11:12 2001
+@@ -1,5 +1,7 @@
+-1.4.8.jcn2
+1.4.8.jcn3
+ ==========
+
+* Dropped-in fixed c++ midi2ly from 1.5.
+
+ * Backported lilypond-login.sh fixes.
+ --- ../lilypond-1.4.8.jcn1/CHANGES Mon Oct 1 13:45:09 2001
++ b/CHANGES Mon Nov 12 15:35:25 2001
@@ -1,7 +1,11 @@
-1.4.8.jcn1
MAJOR_VERSION=1
MINOR_VERSION=4
PATCH_LEVEL=8
-MY_PATCH_LEVEL=jcn2
+MY_PATCH_LEVEL=jcn3
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
# released version.
*/
#include <assert.h>
#include "duration-convert.hh"
-#include "duration-iter.hh"
#include "warn.hh"
// statics Duration_convert
}
str += to_str ('.', dur.dots_i_);
if (dur.plet_b ())
- str += String ("*") + to_str (dur.plet_.iso_i_)
- + String ("/") + to_str (dur.plet_.type_i_);
+ {
+ str += String ("*") + to_str (dur.plet_.iso_i_);
+ if (dur.plet_.type_i_ != 1)
+ str += String ("/") + to_str (dur.plet_.type_i_);
+ }
return str;
}
return mom2standardised_dur (mom);
}
+
Duration
Duration_convert::mom2standardised_dur (Rational mom)
{
- // if (!dur_array_s.length_i ())
- if (!dur_array_s.size ())
- set_array ();
- assert (dur_array_s.size ());
- for (int i = 0; i < dur_array_s.size () - 1; i++)
+ Duration dur;
+
+ if (mom == Rational (0))
+ return dur;
+
+ int d = no_smaller_than_i_s ? no_smaller_than_i_s : 7;
+ int i = type2_i (d);
+ int n = (mom / Rational (1, i));
+
+ int tuplet = 1;
+ if (!no_tuplets_b_s)
{
- Rational lower_mom = dur2_mom (dur_array_s[ i ]);
- if (mom <= lower_mom)
+ // ugh: 8
+ int m = n;
+ int tup = 1;
+ while (tup < 8 &&
+ mom != Rational (m, i * tup))
{
- // all arbitrary, but 3/4 will get rid of the noise...
- // kinda ok
- if (i || (mom / lower_mom > Rational (3, 4)))
- return dur_array_s[ i ];
- else
- {
- Duration d;
- d.durlog_i_ = -100;
- return d;
- }
+ tup += 2;
+ m = (mom / Rational (1, i * tup));
}
- Rational upper_mom = dur2_mom (dur_array_s[ i + 1 ]);
- if ((mom < upper_mom)
- && ((mom - lower_mom) / lower_mom
- < (upper_mom - mom) / upper_mom))
- return dur_array_s[ i ];
- }
- return dur_array_s[ dur_array_s.size () - 1 ];
-}
-
-void
-Duration_convert::set_array ()
-{
- dur_array_s.clear ();
- Duration_iterator i;
- while (i.ok ())
- dur_array_s.push (i.forward_dur ());
+ if (tuplet < 8)
+ {
+ n = m;
+ tuplet = tup;
+ }
+ }
+
+ if (!n)
+ return dur;
+
+ if (mom - Rational (n, i)
+ > Rational (1, i * 2 * tuplet))
+ n++;
+
+ while (!(n & 1))
+ {
+ n >>= 1;
+ d--;
+ }
+
+ dur.durlog_i_ = d;
+ dur.plet_.iso_i_ = n;
+ dur.plet_.type_i_ = tuplet;
+ return dur;
}
-
Rational
Duration_convert::plet_factor_mom (Duration dur)
{
+++ /dev/null
-/*
- duration-convert.cc -- implement Duration_convert
-
- source file of the LilyPond music typesetter
-
- (c) 1997--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
- Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-#include <assert.h>
-#include "duration-convert.hh"
-#include "warn.hh"
-#include "duration-iter.hh"
-
-Duration_iterator::Duration_iterator ()
-{
- cursor_dur_.durlog_i_ = 7;
- if (Duration_convert::no_smaller_than_i_s)
- cursor_dur_.durlog_i_ = Duration_convert::no_smaller_than_i_s;
-}
-
-Duration
-Duration_iterator::operator ++(int)
-{
- return forward_dur ();
-}
-
-Duration
-Duration_iterator::dur ()
-{
- return cursor_dur_;
-}
-
-Duration
-Duration_iterator::forward_dur ()
-{
- /* should do smart table? guessing:
- duration wholes
- 16 0.0625
- 32.. 0.0703
- 8:2/3 0.0833
- 16. 0.0938
- 8 0.1250
- 16.. 0.1406
- 4:2/3 0.1667
- 8. 0.1875
-
- */
- assert (ok ());
-
- Duration dur = this->dur ();
-
- if (!cursor_dur_.dots_i_ && !cursor_dur_.plet_b ())
- {
- cursor_dur_.durlog_i_ += 1;
- cursor_dur_.dots_i_ = 2;
- }
- else if (cursor_dur_.dots_i_ == 2)
- {
- assert (!cursor_dur_.plet_b ());
- cursor_dur_.dots_i_ = 0;
- cursor_dur_.durlog_i_ -=2;
- cursor_dur_.set_plet (2, 3);
- }
- else if (cursor_dur_.plet_b ()
- && (cursor_dur_.plet_.iso_i_ == 2)
- && (cursor_dur_.plet_.type_i_ == 3))
- {
- assert (!cursor_dur_.dots_i_);
- cursor_dur_.set_plet (1, 1);
- cursor_dur_.durlog_i_ += 1;
- cursor_dur_.dots_i_ = 1;
- }
- else if (cursor_dur_.dots_i_ == 1)
- {
- assert (!cursor_dur_.plet_b ());
- cursor_dur_.dots_i_ = 0;
- cursor_dur_.durlog_i_ -= 1;
- }
-
- if (Duration_convert::no_tuplets_b_s
- && cursor_dur_.plet_b () && ok ())
- forward_dur ();
- if (Duration_convert::no_double_dots_b_s
- && (cursor_dur_.dots_i_ == 2) && ok ())
- forward_dur ();
- if (Duration_convert::no_smaller_than_i_s
- && (cursor_dur_.durlog_i_ > Duration_convert::no_smaller_than_i_s) && ok ())
- forward_dur ();
- if (Duration_convert::no_smaller_than_i_s
- && cursor_dur_.dots_i_
- && (cursor_dur_.durlog_i_ >= Duration_convert::no_smaller_than_i_s)
- && ok ())
- forward_dur ();
- if (Duration_convert::no_smaller_than_i_s
- && (cursor_dur_.dots_i_ == 2)
- && (cursor_dur_.durlog_i_ >= Duration_convert::no_smaller_than_i_s / 2)
- && ok ())
- forward_dur ();
-
- return dur;
-}
-
-bool
-Duration_iterator::ok ()
-{
- return cursor_dur_.length_mom () <= Rational (4);
-}
#include "rational.hh"
#include "duration.hh"
#include "duration-convert.hh"
-#include "duration-iter.hh"
// statics Duration
int Duration::division_1_i_s = 384 * 4;
void
Duration::compress (Rational m)
{
- plet_.iso_i_ *= m.num_i ();
- plet_.type_i_ *= m.den_i ();
+ plet_.iso_i_ *= m.num ();
+ plet_.type_i_ *= m.den ();
}
Rational
+++ /dev/null
-/*
- duration-iter.hh -- declare Duration_iterator
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1998--2001 Han-Wen Nienhuys <hanwen@cs.ruu.nl>
-
- */
-
-#ifndef DURATION_ITER_HH
-#define DURATION_ITER_HH
-
-/// (iter_dur)
-struct Duration_iterator {
-
- /// start at shortest: 128:2/3
- Duration_iterator ();
-
- /// return forward_dur ();
- Duration operator ++(int);
-
- /// return current dur
- Duration dur ();
-
- /// return dur (), step to next
- Duration forward_dur ();
-
- /// durations left?
- bool ok ();
-
-private:
-
- Duration cursor_dur_;
-};
-
-
-
-#endif /* DURATION_ITER_HH */
-
//
// lilypond-column.hh -- declare Lilypond_column
//
-// copyright 1997 Jan Nieuwenhuizen <janneke@gnu.org>
+// (c) 1997--2001 Jan Nieuwenhuizen <janneke@gnu.org>
#ifndef LILYPOND_COLUMN_HH
#define LILYPOND_COLUMN_HH
//
// lilypond-item.hh -- declare lilypond_item
//
-// copyright 1997 Jan Nieuwenhuizen <janneke@gnu.org>
+// (c) 1997--2001 Jan Nieuwenhuizen <janneke@gnu.org>
#ifndef LILYPOND_ITEM_HH
#define LILYPOND_ITEM_HH
//
// lilypond-score.hh -- declare Lilypond_score
//
-// copyright 1997 Jan Nieuwenhuizen <janneke@gnu.org>
+// (c) 1997--2001 Jan Nieuwenhuizen <janneke@gnu.org>
#ifndef LILYPOND_SCORE_HH
#define LILYPOND_SCORE_HH
//
// lilypond-staff.hh -- declare lilypond_staff
//
-// copyright 1997 Jan Nieuwenhuizen <janneke@gnu.org>
+// (c) 1997--2001 Jan Nieuwenhuizen <janneke@gnu.org>
#ifndef LILYPOND_STAFF_HH
#define LILYPOND_STAFF_HH
//
// lilypond-stream.hh -- part of LilyPond
//
-// copyright 1997 Jan Nieuwenhuizen <janneke@gnu.org>
+// (c) 1997--2001 Jan Nieuwenhuizen <janneke@gnu.org>
// should i be named Lilypond_stream?
//
// lilypond-voice.hh -- declare Lilypond_voice
//
-// copyright 1997 Jan Nieuwenhuizen <janneke@gnu.org>
+// (c) 1997--2001 Jan Nieuwenhuizen <janneke@gnu.org>
#ifndef LILYPOND_VOICE_HH
#define LILYPOND_VOICE_HH
#include "midi2ly-proto.hh"
+//#include "flower-proto.hh"
+#include "parray.hh"
#include "cons.hh"
/// (lilypond_voice)
{
public:
Lilypond_voice (Lilypond_staff* lilypond_staff_l);
- void add_item (Lilypond_item* lilypond_item_l);
+ void add_items (Link_array<Lilypond_item>& items);
void output (Lilypond_stream& lilypond_stream_r);
String get_clef () const;
- Lilypond_item * last_item_l_;
- Lilypond_note * last_note_l_;
+
private:
Lilypond_staff* lilypond_staff_l_;
- Cons_list<Lilypond_item> lilypond_item_l_list_;
-
+ Link_array < Cons_list<Lilypond_item> > threads_;
+ Rational mom_;
};
#endif // LILYPOND_VOICE_HH
/*
- midi-score-parser.hh -- declare
+ midi-score-parser.hh -- declare Midi_score_parser
source file of the GNU LilyPond music typesetter
//
// midi2ly-global.hh -- declare global stuff for midi2ly
//
-// copyright 1997 Jan Nieuwenhuizen <janneke@gnu.org>
+// (c) 1997--2001 Jan Nieuwenhuizen <janneke@gnu.org>
#ifndef MIDI2LY_GLOBAL_HH
#define MIDI2LY_GLOBAL_HH
//
// lilypond-column.cc -- implement Lilypond_column
//
-// copyright 1997 Jan Nieuwenhuizen <janneke@gnu.org>
+// (c) 1997--2001 Jan Nieuwenhuizen <janneke@gnu.org>
#include "lilypond-column.hh"
//
// lilypond-item.cc -- implement Lilypond_item
//
-// copyright 1997 Jan Nieuwenhuizen <janneke@gnu.org>
+// (c) 1997--2001 Jan Nieuwenhuizen <janneke@gnu.org>
#include <string.h>
#include <assert.h>
String str;
//ugh
- if (dur.plet_b ())
- str += String ("\\times ")
- + String_convert::i2dec_str (dur.plet_.iso_i_, 0, 0)
- + "/"
- + String_convert::i2dec_str (dur.plet_.type_i_, 0, 0)
- + " { ";
+ if (dur.plet_b () && dur.plet_.type_i_ != 1)
+ {
+ {
+ str += String ("\\times ")
+ + String_convert::i2dec_str (dur.plet_.iso_i_, 0, 0)
+ + "/"
+ + String_convert::i2dec_str (dur.plet_.type_i_, 0, 0)
+ + " { ";
+ }
+ }
-
str += name_str;
Duration tmp = dur;
str += Duration_convert::dur2_str (tmp);
if (dur.plet_b ())
- str += String (" }");
-
+ {
+ if (dur.plet_.type_i_ != 1)
+ str += String (" }");
+ else
+ str += String ("*") + to_str (dur.plet_.iso_i_);
+ }
+
/*
note of zero duration is nonsense,
but let's output anyway for convenient debugging
String
Lilypond_skip::str ()
{
- if (!mom_)
- return String ("");
-
- Duration dur = duration ();
- if (dur.durlog_i_<-10)
- return "";
-
- String str = "\\skip ";
- str += Duration_convert::dur2_str (dur);
+ String str;
+ Rational m = mom_;
+ if ((int)m >= 1)
+ {
+ int n = m;
+ str += "\\skip 1";
+ if (n > 1)
+ {
+ str += "*";
+ str += to_str (n);
+ }
+ str += " ";
+ m -= n;
+ }
+ if (m > Rational (0))
+ {
+
+ Duration dur = Duration_convert::mom2_dur (m);
+ str += "\\skip ";
+ str += Duration_convert::dur2_str (dur);
+ str += " ";
+ }
return str;
}
//
// lilypond-score.cc -- implement Lilypond_score
//
-// copyright 1997 Jan Nieuwenhuizen <janneke@gnu.org>
+// (c) 1997--2001 Jan Nieuwenhuizen <janneke@gnu.org>
#include <assert.h>
#include "rational.hh"
int current_bar_i = 0;
Rational bar_mom = lilypond_time_signature_l_->bar_mom ();
- int n = 5 >? Duration_convert::no_smaller_than_i_s;
+ int n = 7 >? Duration_convert::no_smaller_than_i_s;
n = Duration_convert::type2_i (n);
Rational s = Rational (1, n);
for (int i = 0; i < column_l_array_.size (); i++)
//
// lilypond-staff.cc -- implement Lilypond_staff
//
-// copyright 1997 Jan Nieuwenhuizen <janneke@gnu.org>
+// (c) 1997--2001 Jan Nieuwenhuizen <janneke@gnu.org>
#include <assert.h>
#include <ctype.h>
Lilypond_voice* voice_p = new Lilypond_voice (this);
lilypond_voice_p_list_.append (new Killing_cons<Lilypond_voice> (voice_p, 0));
- // Rational mom = items.top ()->at_mom ();
Rational mom = 0;
- for (Cons<Lilypond_item>** pp = &items.head_; *pp;)
+ Link_array<Lilypond_item> now_items;
+ for (Cons<Lilypond_item>** i = &items.head_; *i;)
{
- Cons<Lilypond_item>* i = *pp;
- if (i->car_->at_mom () > mom)
- {
- if (no_rests_b_g && voice_p->last_note_l_)
- {
- voice_p->last_note_l_->end_column_l_ = i->car_->lilypond_column_l_;
- }
- else
- {
- /* uh, what about quantisation? This should probably
- use mom2standardised_dur ()
- arg, urg: skip should get duration from start/end columns!
- */
-
- Rational r = i->car_->at_mom () - mom;
- // ugh, need score
- Lilypond_column* start = lilypond_score_l_g->find_column_l (mom);
- voice_p->add_item (new Lilypond_skip (start, r));
- }
-
- mom = i->car_->at_mom ();
- continue; // unnecessary
- }
+ while (*i && (*i)->car_->at_mom () < mom)
+ i = &(*i)->next_;
+ Lilypond_note* last_note = 0;
Link_array<Lilypond_item> now_items;
- for (Cons<Lilypond_item> *cp = i; cp && cp->car_->at_mom () == mom; cp = cp->next_)
- now_items.push (i->car_);
-
-#if 0
- /*
- Why don't we use <note>, if voice has:
-
- <note> <key-change>
-
- we'd get last_item == key_change -> last_note == 0;
- */
- Lilypond_note * last_note = dynamic_cast<Lilypond_note*> (voice_p->last_item_l_);
-#else
- /*
- Not sure, is this better?
- */
- Lilypond_note * last_note = voice_p->last_note_l_;
-#endif
-
- Link_array<Lilypond_item> candidates;
-
- for (int i=0; last_note && i < now_items.size (); i++)
- {
- Lilypond_note * now_note = dynamic_cast<Lilypond_note*> (now_items[i]);
- if (now_note && last_note->channel_i_ != now_note->channel_i_)
- candidates.push (now_note);
- }
-
- if (candidates.size())
- {
- now_items = candidates;
- }
-
- Lilypond_item * which = 0;
- if (now_items.size () > 1)
+ if (*i)
+ mom = (*i)->car_->at_mom ();
+ while (*i && (*i)->car_->at_mom () == mom)
{
- int mindiff = 100000; // ugh
- for (int i=0; last_note && i < now_items.size (); i++)
- {
- Lilypond_note *nt = dynamic_cast<Lilypond_note*> (now_items[i]);
- if (!nt)
- continue;
- int diff = abs (last_note->pitch_i_ - nt->pitch_i_ );
- if(diff < mindiff)
- {
- mindiff = diff;
- which = now_items [i];
- }
- }
-
- if (which && mindiff > 18) // more than 1.5 octaves apart. Don't put in same voice.
- {
- which =0;
- }
- }
- else if (now_items.size () == 1)
- which = now_items[0];
-
- if (which)
- {
- while ((*pp)->car_ != which)
- pp = &(*pp)->next_;
-
- mom += (*pp)->car_->duration_mom ();
- Cons<Lilypond_item>* c = items.remove_cons (pp);
- voice_p->add_item (c->car_);
+ Lilypond_note* note = dynamic_cast<Lilypond_note*> ((*i)->car_);
+ if (note && last_note
+ /* ugh, should sort out (whether to) channel before */
+ && (note->channel_i_ != last_note->channel_i_
+ || (note->duration_mom ()
+ != last_note->duration_mom ())))
+ break;
+ Cons<Lilypond_item>* c = items.remove_cons (i);
+ now_items.push (c->car_);
+ if (note)
+ last_note = note;
delete c;
}
- else
- {
- pp = &(*pp)->next_;
- continue;
- }
+
+ if (now_items.size ())
+ mom = now_items.top ()->at_mom ();
+ if (last_note)
+ mom += last_note->duration_mom ();
+
+ voice_p->add_items (now_items);
}
}
lilypond_stream_r << voicename << " = \\notes ";
- trackbody += "\\" + voicename + "\n";
-
+ trackbody += "\\context Voice = " + voicename + " \\" + voicename + "\n";
lilypond_stream_r << '\n';
i->car_->output (lilypond_stream_r);
c++;
+ lilypond_stream_r << '\n';
}
+ lilypond_stream_r << '\n';
lilypond_stream_r << _ ("% MIDI copyright:") << copyright_str_ << '\n';
lilypond_stream_r << _ ("% MIDI instrument:") << instrument_str_ << '\n';
lilypond_stream_r << id_str () << " = ";
- lilypond_stream_r << "<\n " << trackbody << " >\n";
+ lilypond_stream_r << "<\n" << trackbody << ">\n";
lilypond_stream_r << " % " << name_str () << '\n';
}
}
-#if 0 // not used for now
-void
-Lilypond_staff::output_lilypond_rest (Lilypond_stream& lilypond_stream_r, Rational begin_mom, Rational end_mom)
-{
- Rational bar_mom = lilypond_time_signature_l_->bar_mom ();
- Rational now_mom = begin_mom;
-
- int begin_bar_i = (int) (now_mom / bar_mom) + 1;
- int end_bar_i = (int) (end_mom / bar_mom) + 1;
-
- if (end_bar_i == begin_bar_i)
- {
- output_lilypond_rest_remain (lilypond_stream_r, end_mom - begin_mom);
- return;
- }
-
- // multiple bars involved
- int bar_i = (int) (now_mom / bar_mom) + 1;
-
- //fill current bar
- Rational begin_bar_mom = Rational (begin_bar_i - 1) * bar_mom;
- if (now_mom > begin_bar_mom)
- {
- int next_bar_i = (int) (now_mom / bar_mom) + 2;
- Rational next_bar_mom = Rational (next_bar_i - 1) * bar_mom;
- assert (next_bar_mom <= end_mom);
-
- Rational remain_mom = next_bar_mom - now_mom;
- if (remain_mom > Rational (0))
- {
- output_lilypond_rest_remain (lilypond_stream_r, remain_mom);
- now_mom += remain_mom;
- }
-
- bar_i = check_end_bar_i (now_mom, bar_i);
- }
-
- // fill whole bars
- int count_i = end_bar_i - bar_i;
- for (int i = 0; i < count_i; i++)
- {
- int begin_bar_i = check_begin_bar_i (now_mom, bar_i);
- if (begin_bar_i)
- output_lilypond_begin_bar (lilypond_stream_r, now_mom, begin_bar_i);
- lilypond_stream_r << "r1 ";
- // *lilypond_stream_r.os_p_ << flush;
- if (begin_bar_i)
- LOGOUT (NORMAL_ver) << begin_bar_i << flush;
- bar_i = check_end_bar_i (now_mom, bar_i);
- now_mom += bar_mom;
- }
-
- // use "int i" here, and gcc 2.7.2 hits internal compiler error
- int ii = check_begin_bar_i (now_mom, bar_i);
- if (ii)
- output_lilypond_begin_bar (lilypond_stream_r, now_mom, ii);
-
- // bar_i = check_end_bar_i (now_mom, bar_i);
-
- Rational remain_mom = end_mom - Rational (end_bar_i - 1) * bar_mom;
- if (remain_mom > Rational (0))
- {
- output_lilypond_rest_remain (lilypond_stream_r, remain_mom);
- now_mom += remain_mom;
- }
- assert (now_mom == end_mom);
-}
-
-void
-Lilypond_staff::output_lilypond_rest_remain (Lilypond_stream& lilypond_stream_r, Rational mom)
-{
- if (Duration_convert::no_quantify_b_s)
- {
- Duration dur = Duration_convert::mom2_dur (mom);
- lilypond_stream_r << "r" << dur.str () << " ";
- // assert (mom == dur.mom ());
- assert (mom == dur.length ());
- return;
- }
-
- Duration dur = Duration_convert::mom2standardised_dur (mom);
- if (dur.type_i_>-10)
- lilypond_stream_r << "r" << dur.str () << " ";
-}
-#endif
-
-
void
Lilypond_staff::process ()
{
/*
- group items into voices
- */
+ group items into voices
+ */
assert (lilypond_score_l_g);
lilypond_key_l_ = lilypond_score_l_g->lilypond_key_l_;
//
// lilypond-voice.cc -- implement Lilypond_voice
//
-// copyright 1997 Jan Nieuwenhuizen <janneke@gnu.org>
+// (c) 1997--2001 Jan Nieuwenhuizen <janneke@gnu.org>
#include "string-convert.hh"
#include "midi2ly-global.hh"
Lilypond_voice::Lilypond_voice (Lilypond_staff* lilypond_staff_l)
{
lilypond_staff_l_ = lilypond_staff_l;
- last_item_l_ =0;
- last_note_l_ =0;
+ threads_.push (new Cons_list<Lilypond_item>);
+ mom_ = 0;
}
-
+
void
-Lilypond_voice::add_item (Lilypond_item* lilypond_item_l)
+Lilypond_voice::add_items (Link_array<Lilypond_item>& items)
{
- last_item_l_ = lilypond_item_l;
- if (Lilypond_note* n = dynamic_cast<Lilypond_note*> (lilypond_item_l))
+ int thread = 0;
+ for (int i = 0; i < items.size (); i++)
{
- last_note_l_ = n;
+ Lilypond_item* item = items[i];
+
+ int to_thread;
+ if (Lilypond_note* n = dynamic_cast<Lilypond_note*> (item))
+ to_thread = thread++;
+ else
+ to_thread = 0;
+
+ if (to_thread >= threads_.size ())
+ threads_.push (new Cons_list<Lilypond_item>);
+
+ if (to_thread == 0 && item->at_mom () > mom_)
+ {
+ /* urg: skip should use refer to end-colum, not separate moment */
+ Rational r = item->at_mom () - mom_;
+ Lilypond_column* start = lilypond_score_l_g->find_column_l (mom_);
+ threads_[to_thread]->append (new Cons<Lilypond_item> (new Lilypond_skip (start, r), 0));
+ mom_ = item->at_mom ();
+ }
+
+ threads_[to_thread]->append (new Cons<Lilypond_item> (item, 0));
+ if (to_thread == 0)
+ mom_ += item->duration_mom ();
}
- lilypond_item_l_list_.append (new Cons<Lilypond_item> (lilypond_item_l, 0));
}
/**
{
Lilypond_note * n =0;
- for (Cons<Lilypond_item> *cp = lilypond_item_l_list_.head_; !n && cp; cp = cp->next_)
+ for (Cons<Lilypond_item> *cp = threads_[0]->head_; !n && cp; cp = cp->next_)
{
n = dynamic_cast<Lilypond_note*> (cp->car_);
}
Lilypond_voice::output (Lilypond_stream& lilypond_stream_r)
{
lilypond_stream_r << "{ ";
- if (lilypond_item_l_list_.size_i () > FAIRLY_LONG_VOICE_i)
+ if (threads_[0]->size_i () > FAIRLY_LONG_VOICE_i)
lilypond_stream_r << '\n';
int current_bar_i = 0;
Rational bar_mom = lilypond_staff_l_->lilypond_time_signature_l_->bar_mom ();
- for (Cons<Lilypond_item>* i = lilypond_item_l_list_.head_; i; i = i->next_)
+ Link_array <Cons<Lilypond_item> > heads;
+ for (int i = 1; i < threads_.size (); i++)
+ heads.push (threads_[i]->head_);
+ for (Cons<Lilypond_item>* i = threads_[0]->head_; i; i = i->next_)
{
Rational at_mom = i->car_->lilypond_column_l_->at_mom ();
int bar_i = (int) (at_mom / bar_mom) + 1;
current_bar_i = bar_i;
}
- lilypond_stream_r << *i->car_;
+ if (dynamic_cast<Lilypond_note*> (i->car_)
+ && heads.size ()
+ && heads[0]
+ && heads[0]->car_->at_mom () == at_mom)
+ {
+ lilypond_stream_r << '<';
+
+ lilypond_stream_r << *i->car_;
+
+ for (int h = 0;
+ h < heads.size ()
+ && heads[h]
+ && heads[h]->car_->at_mom () == at_mom;
+ h++)
+ {
+ lilypond_stream_r << *heads[h]->car_;
+ heads[h] = heads[h]->next_;
+ }
+ lilypond_stream_r << '>';
+ }
+ else
+ lilypond_stream_r << *i->car_;
+
if (Lilypond_key* k = dynamic_cast<Lilypond_key*> (i->car_))
lilypond_staff_l_->lilypond_key_l_ = lilypond_score_l_g->lilypond_key_l_ = k;
}
- if (lilypond_item_l_list_.size_i () > FAIRLY_LONG_VOICE_i)
+ if (threads_[0]->size_i () > FAIRLY_LONG_VOICE_i)
lilypond_stream_r << '\n';
lilypond_stream_r << "} ";
//
// main.cc -- implement main () entry point
//
-// copyright 1997 Jan Nieuwenhuizen <janneke@gnu.org>
+// (c) 1997--2001 Jan Nieuwenhuizen <janneke@gnu.org>
#include <stdlib.h>
#include <iostream.h>
cout << '\n';
cout << Long_option_init::table_str (long_option_init_a) << endl;
- cout << _f ("Report bugs to %s", "bug-lilypond@gnu.org") << endl;
+ cout << _f ("Report bugs to %s", "bug-gnu-music@gnu.org") << endl;
}
void
int minor_i = (int)(bool)next_byte ();
Lilypond_key* p = new Lilypond_key (accidentals_i, minor_i);
item_p = p;
-#if 0
- info_l_->score_l_->lilypond_key_l_ = p;
- lilypond_staff_p_->lilypond_key_l_ = p;
-#endif
}
// SSME [\0x7f][\x03]
else if ((byte == 0x7f) && (next == 0x03))
//
// version.cc -- implement inexpensive versioning
//
-// copyright 1997 Jan Nieuwenhuizen <janneke@gnu.org>
+// (c) 1997--2001 Jan Nieuwenhuizen <janneke@gnu.org>
#include <stdio.h>
#include "config.h"