]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 0.1.19.jcn2: mi2mu pats
authorJan Nieuwenhuizen <janneke@gnu.org>
Wed, 8 Oct 1997 06:28:28 +0000 (08:28 +0200)
committerJan Nieuwenhuizen <janneke@gnu.org>
Wed, 8 Oct 1997 06:28:28 +0000 (08:28 +0200)
pl 19.jcn2
- bf's mi2mu:
  * Midi_track_parser::note_end_all
  * staff output uses key, meter, tempo read
  * command line read minor key
  * minor key notenames

NEWS
VERSION
make/lelievijver.lsm
mi2mu/VERSION
mi2mu/include/mudela-staff.hh
mi2mu/main.cc
mi2mu/midi-track-parser.cc
mi2mu/mudela-item.cc
mi2mu/mudela-score.cc
mi2mu/mudela-staff.cc
mi2mu/mudela-voice.cc

diff --git a/NEWS b/NEWS
index 9000396c58a440bd7e5a328c147911627beeb3d8..8e1a22a644be6919f17cfa27edbf5c7581575a77 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,10 @@
+pl 19.jcn2
+       - bf's mi2mu:
+         * Midi_track_parser::note_end_all
+         * staff output uses key, meter, tempo read
+         * command line read minor key
+         * minor key notenames
+
 pl 19.jcn1
        - small changes to sharp, fermata
        - small changes to lilypond.lsm+doc, lelievijver.lsm
diff --git a/VERSION b/VERSION
index 38132745e7b63717f004cffe62b9e3c96f118804..04ce9ca7fc5ad1cc1accfaa82a24591dbf1a61ff 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,6 +1,6 @@
 TOPLEVEL_MAJOR_VERSION = 0
 TOPLEVEL_MINOR_VERSION = 1
-TOPLEVEL_PATCH_LEVEL = 19.jcn1
+TOPLEVEL_PATCH_LEVEL = 19.jcn2
 TOPLEVEL_MY_PATCH_LEVEL = 
 
 # use the above to send patches, always empty for released version:
index a28792b4ca0b2f85ae5dc70576b44d39e220d2ca..b4d5b465bea0b997c5f195e22ad9065372afd9a8 100644 (file)
@@ -1,7 +1,7 @@
 Begin3
 Titel: LilyPond
-Versie: 0.1.19.jcn1
-Inschrijf datum: 06OCT97
+Versie: 0.1.19.jcn2
+Inschrijf datum: 07OCT97
 Beschrijving: LilyPond is de muziek typesetter van het GNU Project.  
                Het programma genereert muziek in zichtbare of 
                hoorbare vorm uit uit een muzikale definitie file: 
@@ -16,8 +16,8 @@ Auteur: hanwen@stack.nl (Han-Wen Nienhuys)
        jan@digicash.com (Jan Nieuwenhuizen)
 Onderhouden door: hanwen@stack.nl (Han-Wen Nienhuys)
 Voornaamste plek: sunsite.unc.edu /pub/Linux/apps
-       395k lilypond-0.1.19.jcn1.tar.gz 
+       395k lilypond-0.1.19.jcn2.tar.gz 
 Oorspronkelijke plek: pcnov095.win.tue.nl /pub/lilypond/
-       395k lilypond-0.1.19.jcn1.tar.gz 
+       395k lilypond-0.1.19.jcn2.tar.gz 
 Copi"eer politie: GPL
 End
index bbbdde49e2748096232ea62ec58d745a685bc3ff..4ecc91f7f8ccb2fef843c27ee8eddce26e270151 100644 (file)
@@ -1,6 +1,6 @@
 MAJOR_VERSION = 0
 MINOR_VERSION = 0
-PATCH_LEVEL = 20
+PATCH_LEVEL = 21
 # use to send patches, always empty for released version:
 MY_PATCH_LEVEL = 
 #
index 06fc8b25c7a25914635cd98b09c55bf5dc7b932f..6acb91b56a234fefe6a401de8184d0890b025f9d 100644 (file)
@@ -15,7 +15,6 @@
 class Mudela_staff {
 public:
     Mudela_staff (int number_i, String copyright_str, String track_name_str, String instrument_str);
-    ~Mudela_staff();
 
     void add_item (Mudela_item* mudela_item_p);
     void eat_voice (Link_list<Mudela_item*>& items);
@@ -23,14 +22,13 @@ public:
     String name_str();
     void output (Mudela_stream& mudela_stream_r);
     void process();
-    void set_meter (int num_i, int den_i, int clocks_i, int count_32_i);
-    void set_tempo (int useconds_i);
 
     String copyright_str_;
     String instrument_str_;
     String name_str_;
-    Mudela_meter* mudela_meter_p_;
-    Mudela_tempo* mudela_tempo_p_;
+    Mudela_key* mudela_key_l_;
+    Mudela_meter* mudela_meter_l_;
+    Mudela_tempo* mudela_tempo_l_;
     int number_i_;
 
 private:
index 8626213568eb953ffa413f83e9e99248d8e90a31..fd9bcdc0c79f8c8656d4fd2155928166ff0ac572 100644 (file)
@@ -135,7 +135,7 @@ main (int argc_i, char* argv_sz_a[])
            int i = str.index_i (':');
            i = (i >=0 ? i : str.length_i ());
            key.accidentals_i_ = String_convert::dec2_i (str.left_str (i));
-           key.minor_i_ = (int)(bool)String_convert::dec2_i (str.mid_str (i,1));
+           key.minor_i_ = (int)(bool)String_convert::dec2_i (str.mid_str (i + 1,1));
            break;
          }
        case 'n':
@@ -198,8 +198,8 @@ main (int argc_i, char* argv_sz_a[])
        if (!score_p)
          return 1;
 
-       if (!score_p->mudela_key_l_)
-         score_p->mudela_key_l_ = &key;
+       // if given on command line: override
+       score_p->mudela_key_l_ = &key;
        mudela_score_l_g = score_p;
        score_p->process();
 
index dd62e91e5fdf5e72c79b23084fbae7460c8b7909..d38e57e97df3f2b2d2cb4523cde8555b52ea75fe 100644 (file)
@@ -53,7 +53,7 @@ Midi_track_parser::note_end (Mudela_column* col_l, int channel_i, int pitch_i, i
 
   assert (col_l);
 
-  for (PCursor<Mudela_note*> i (open_note_l_list_.top ()); i.ok (); i++
+  for (PCursor<Mudela_note*> i (open_note_l_list_.top ()); i.ok (); ) 
     {
       if ((i->pitch_i_ == pitch_i) && (i->channel_i_ == channel_i)) 
        {
@@ -64,6 +64,8 @@ Midi_track_parser::note_end (Mudela_column* col_l, int channel_i, int pitch_i, i
          i.remove_p();
          return;
        }
+      else
+       i++;
     }
   warning (String ("junking note-end event: ")
           + " channel = " + String_convert::i2dec_str (channel_i, 0, ' ')
@@ -75,13 +77,10 @@ Midi_track_parser::note_end_all (Mudela_column* col_l)
 {
   // find 
   assert (col_l);
-  for (PCursor<Mudela_note*> i (open_note_l_list_.top ()); i.ok (); i++
+  for (PCursor<Mudela_note*> i (open_note_l_list_.top ()); i.ok (); ) 
     {
       i->end_column_l_ = col_l;
-      i.remove_p();
-      // ugh
-      if (!i.ok())
-       break;
+      i.remove_p ();
     }
 }
 
@@ -276,6 +275,7 @@ Midi_track_parser::parse_event (Mudela_column* col_l)
              Mudela_tempo* p = new Mudela_tempo ( useconds_per_4_u );
              item_p = p;
              info_l_->score_l_->mudela_tempo_l_ = p;
+             mudela_staff_p_->mudela_tempo_l_ = p;
            }
          // SMPTE_OFFSET       [\x54][\x05]
          else if ((byte == 0x54) && (next == 0x05))
@@ -299,6 +299,7 @@ Midi_track_parser::parse_event (Mudela_column* col_l)
              item_p = p;
              info_l_->score_l_->mudela_meter_l_ = p;
              info_l_->bar_mom_ = p->bar_mom ();
+             mudela_staff_p_->mudela_meter_l_ = p;
            }
          // KEY                [\x59][\x02]
          else if ((byte == 0x59) && (next == 0x02))
@@ -309,6 +310,7 @@ Midi_track_parser::parse_event (Mudela_column* col_l)
              Mudela_key* p = new Mudela_key (accidentals_i, minor_i);
              item_p = p;
              info_l_->score_l_->mudela_key_l_ = p;
+             mudela_staff_p_->mudela_key_l_ = p;
            }
          // SSME               [\0x7f][\x03]
          else if ((byte == 0x7f) && (next == 0x03))
index cc7bacdfa5ff3c711071e99e9488b20c5c405c81..4e3e3f0b43752ae896761727c2ebc0248ce89f0f 100644 (file)
@@ -72,7 +72,7 @@ Mudela_key::notename_str (int pitch_i)
   int notename_i = notename_i_a[  (minor_i_ * 5 + pitch_i) % 12 ];
   
   static int accidentals_i_a[ 12 ] = { 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0 };
-  int accidental_i = accidentals_i_a[ minor_i_ * 5 + pitch_i % 12 ];
+  int accidental_i = accidentals_i_a[ (minor_i_ * 5 + pitch_i) % 12 ];
   if (accidental_i &&  (accidentals_i_ < 0)) 
     {
        accidental_i = - accidental_i;
index d0138d757e5a2cc8b01e1a96bcb10c5023920703..0e8beb17503402d2f211cb0d8f34025cf0f0eb9b 100644 (file)
@@ -136,7 +136,7 @@ Mudela_score::output (String filename_str)
 
   mudela_stream << "\\midi{\n";
   // let's not use silly 0 track
-  mudela_staff_p_list_.bottom()->mudela_tempo_p_->output (mudela_stream);
+  mudela_staff_p_list_.bottom()->mudela_tempo_l_->output (mudela_stream);
   mudela_stream << "}\n";
 
   mudela_stream << "}\n";
index b8535618b911ecbfe637304a0ccf89e6a92dc2b5..a3e966ca6e64ebb3ea0a9cc25e95851ae3e541f8 100644 (file)
@@ -25,14 +25,9 @@ Mudela_staff::Mudela_staff (int number_i, String copyright_str, String track_nam
   copyright_str_ = copyright_str;
   instrument_str_ = instrument_str;
   name_str_ = track_name_str;
-  mudela_meter_p_ = new Mudela_meter (4, 2, 24, 8);
-  mudela_tempo_p_ = new Mudela_tempo (1000000);
-}
-
-Mudela_staff::~Mudela_staff()
-{
-  delete mudela_meter_p_;
-  delete mudela_tempo_p_;
+  mudela_key_l_ = 0;
+  mudela_meter_l_ = 0;
+  mudela_tempo_l_ = 0;
 }
 
 void
@@ -122,7 +117,7 @@ Mudela_staff::output (Mudela_stream& mudela_stream_r)
 void
 Mudela_staff::output_mudela_begin_bar (Mudela_stream& mudela_stream_r, Moment now_mom, int bar_i)
 {
-  Moment bar_mom = mudela_meter_p_->bar_mom();
+  Moment bar_mom = mudela_meter_l_->bar_mom();
   Moment into_bar_mom = now_mom - Moment (bar_i - 1) * bar_mom;
   if  (bar_i > 1) 
     {
@@ -140,7 +135,7 @@ Mudela_staff::output_mudela_begin_bar (Mudela_stream& mudela_stream_r, Moment no
 void 
 Mudela_staff::output_mudela_rest (Mudela_stream& mudela_stream_r, Moment begin_mom, Moment end_mom)
 {
-  Moment bar_mom = mudela_meter_p_->bar_mom();
+  Moment bar_mom = mudela_meter_l_->bar_mom();
   Moment now_mom = begin_mom;
 
   int begin_bar_i = (int) (now_mom / bar_mom) + 1; 
@@ -230,6 +225,11 @@ Mudela_staff::process()
      group items into voices
      */
 
+  assert (mudela_score_l_g);
+  mudela_key_l_ = mudela_score_l_g->mudela_key_l_;
+  mudela_meter_l_ = mudela_score_l_g->mudela_meter_l_;
+  mudela_tempo_l_ = mudela_score_l_g->mudela_tempo_l_;
+
   Link_list<Mudela_item*> items;
   for  (PCursor<Mudela_item*> i (mudela_item_p_list_); i.ok(); i++)
     items.bottom().add (*i);
@@ -238,17 +238,3 @@ Mudela_staff::process()
     eat_voice (items);
 }
 
-void
-Mudela_staff::set_tempo (int useconds_per_4_i)
-{
-  delete mudela_tempo_p_;
-  mudela_tempo_p_ = new Mudela_tempo (useconds_per_4_i);
-}
-
-void
-Mudela_staff::set_meter (int num_i, int den_i, int clocks_i, int count_32_i)
-{
-  delete mudela_meter_p_;
-  mudela_meter_p_ = new Mudela_meter (num_i, den_i, clocks_i, count_32_i);
-}
-
index a22844b86b73961dfe22f66f7618962be952119f..6f91c8ff256cc742a07ba1b142a0c2ae6fb32166 100644 (file)
@@ -48,7 +48,7 @@ Mudela_voice::output (Mudela_stream& mudela_stream_r)
        mudela_stream_r << "\n";
 
   int current_bar_i = 0;
-  Moment bar_mom = mudela_staff_l_->mudela_meter_p_->bar_mom();
+  Moment bar_mom = mudela_staff_l_->mudela_meter_l_->bar_mom();
 
   for  (PCursor<Mudela_item*> i (mudela_item_l_list_); i.ok(); i++) 
     {