From: Jan Nieuwenhuizen Date: Wed, 8 Oct 1997 06:28:28 +0000 (+0200) Subject: patch::: 0.1.19.jcn2: mi2mu pats X-Git-Tag: release/0.1.21~3 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=c943eb1a572e9703e5975149f38481a4228cfe08;p=lilypond.git patch::: 0.1.19.jcn2: mi2mu pats 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 --- diff --git a/NEWS b/NEWS index 9000396c58..8e1a22a644 100644 --- 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 38132745e7..04ce9ca7fc 100644 --- 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: diff --git a/make/lelievijver.lsm b/make/lelievijver.lsm index a28792b4ca..b4d5b465be 100644 --- a/make/lelievijver.lsm +++ b/make/lelievijver.lsm @@ -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 diff --git a/mi2mu/VERSION b/mi2mu/VERSION index bbbdde49e2..4ecc91f7f8 100644 --- a/mi2mu/VERSION +++ b/mi2mu/VERSION @@ -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 = # diff --git a/mi2mu/include/mudela-staff.hh b/mi2mu/include/mudela-staff.hh index 06fc8b25c7..6acb91b56a 100644 --- a/mi2mu/include/mudela-staff.hh +++ b/mi2mu/include/mudela-staff.hh @@ -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& 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: diff --git a/mi2mu/main.cc b/mi2mu/main.cc index 8626213568..fd9bcdc0c7 100644 --- a/mi2mu/main.cc +++ b/mi2mu/main.cc @@ -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(); diff --git a/mi2mu/midi-track-parser.cc b/mi2mu/midi-track-parser.cc index dd62e91e5f..d38e57e97d 100644 --- a/mi2mu/midi-track-parser.cc +++ b/mi2mu/midi-track-parser.cc @@ -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 i (open_note_l_list_.top ()); i.ok (); i++) + for (PCursor 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 i (open_note_l_list_.top ()); i.ok (); i++) + for (PCursor 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)) diff --git a/mi2mu/mudela-item.cc b/mi2mu/mudela-item.cc index cc7bacdfa5..4e3e3f0b43 100644 --- a/mi2mu/mudela-item.cc +++ b/mi2mu/mudela-item.cc @@ -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; diff --git a/mi2mu/mudela-score.cc b/mi2mu/mudela-score.cc index d0138d757e..0e8beb1750 100644 --- a/mi2mu/mudela-score.cc +++ b/mi2mu/mudela-score.cc @@ -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"; diff --git a/mi2mu/mudela-staff.cc b/mi2mu/mudela-staff.cc index b8535618b9..a3e966ca6e 100644 --- a/mi2mu/mudela-staff.cc +++ b/mi2mu/mudela-staff.cc @@ -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 items; for (PCursor 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); -} - diff --git a/mi2mu/mudela-voice.cc b/mi2mu/mudela-voice.cc index a22844b86b..6f91c8ff25 100644 --- a/mi2mu/mudela-voice.cc +++ b/mi2mu/mudela-voice.cc @@ -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 i (mudela_item_l_list_); i.ok(); i++) {