From 9eb72e332d38f847196b7330f34221e052feac88 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Mon, 10 Mar 1997 19:01:32 +0100 Subject: [PATCH] partial: 0.0.40.jcn --- {m2m => mi2mu}/include/lily-stream.hh | 0 m2m/include/m2m.hh => mi2mu/include/mi2mu.hh | 3 +- {m2m => mi2mu}/include/midi-event.hh | 1 + {m2m => mi2mu}/include/midi-global.hh | 2 +- {m2m => mi2mu}/include/midi-score.hh | 0 {m2m => mi2mu}/include/midi-track.hh | 0 {m2m => mi2mu}/include/midi-voice.hh | 0 {m2m => mi2mu}/include/my-midi-lexer.hh | 0 {m2m => mi2mu}/include/my-midi-parser.hh | 5 +- {m2m => mi2mu}/include/track-column.hh | 0 {m2m => mi2mu}/lily-stream.cc | 51 +++++++++++----- m2m/midi-main.cc => mi2mu/main.cc | 21 ++----- {m2m => mi2mu}/midi-event.cc | 31 ++++++---- {m2m => mi2mu}/midi-score.cc | 19 ++++-- {m2m => mi2mu}/midi-track.cc | 61 ++++++++++++-------- {m2m => mi2mu}/midi-voice.cc | 2 +- {m2m => mi2mu}/my-midi-lexer.cc | 2 +- {m2m => mi2mu}/my-midi-parser.cc | 9 ++- m2m/midi-template.cc => mi2mu/template.cc | 4 +- {m2m => mi2mu}/track-column.cc | 2 +- mi2mu/version.cc | 18 ++++++ 21 files changed, 147 insertions(+), 84 deletions(-) rename {m2m => mi2mu}/include/lily-stream.hh (100%) rename m2m/include/m2m.hh => mi2mu/include/mi2mu.hh (94%) rename {m2m => mi2mu}/include/midi-event.hh (98%) rename {m2m => mi2mu}/include/midi-global.hh (94%) rename {m2m => mi2mu}/include/midi-score.hh (100%) rename {m2m => mi2mu}/include/midi-track.hh (100%) rename {m2m => mi2mu}/include/midi-voice.hh (100%) rename {m2m => mi2mu}/include/my-midi-lexer.hh (100%) rename {m2m => mi2mu}/include/my-midi-parser.hh (91%) rename {m2m => mi2mu}/include/track-column.hh (100%) rename {m2m => mi2mu}/lily-stream.cc (64%) rename m2m/midi-main.cc => mi2mu/main.cc (91%) rename {m2m => mi2mu}/midi-event.cc (83%) rename {m2m => mi2mu}/midi-score.cc (75%) rename {m2m => mi2mu}/midi-track.cc (77%) rename {m2m => mi2mu}/midi-voice.cc (98%) rename {m2m => mi2mu}/my-midi-lexer.cc (98%) rename {m2m => mi2mu}/my-midi-parser.cc (94%) rename m2m/midi-template.cc => mi2mu/template.cc (87%) rename {m2m => mi2mu}/track-column.cc (94%) create mode 100644 mi2mu/version.cc diff --git a/m2m/include/lily-stream.hh b/mi2mu/include/lily-stream.hh similarity index 100% rename from m2m/include/lily-stream.hh rename to mi2mu/include/lily-stream.hh diff --git a/m2m/include/m2m.hh b/mi2mu/include/mi2mu.hh similarity index 94% rename from m2m/include/m2m.hh rename to mi2mu/include/mi2mu.hh index fd404e4349..0210f523eb 100644 --- a/m2m/include/m2m.hh +++ b/mi2mu/include/mi2mu.hh @@ -1,5 +1,5 @@ // -// m2m.hh -- generic m2m include file +// mi2mu.hh -- generic mi2mu include file // // copyright 1997 Jan Nieuwenhuizen @@ -45,7 +45,6 @@ #include "lily-stream.hh" #include "midi-event.hh" -#include "midi-main.hh" #include "midi-score.hh" #include "midi-track.hh" #include "midi-voice.hh" diff --git a/m2m/include/midi-event.hh b/mi2mu/include/midi-event.hh similarity index 98% rename from m2m/include/midi-event.hh rename to mi2mu/include/midi-event.hh index faaf60e5cd..3f06353c4a 100644 --- a/m2m/include/midi-event.hh +++ b/mi2mu/include/midi-event.hh @@ -82,6 +82,7 @@ public: Duration i2_dur( int time_i, int division_1_i ); int clocks_1_i(); virtual String mudela_str( bool command_mode_bo ); + Moment bar_mom(); private: Real sync_f_; diff --git a/m2m/include/midi-global.hh b/mi2mu/include/midi-global.hh similarity index 94% rename from m2m/include/midi-global.hh rename to mi2mu/include/midi-global.hh index 4d499daf0a..29ba252a83 100644 --- a/m2m/include/midi-global.hh +++ b/mi2mu/include/midi-global.hh @@ -1,5 +1,5 @@ // -// midi-global.hh -- declare global (sic) stuff for m2m +// midi-global.hh -- declare global (sic) stuff for mi2mu // // copyright 1997 Jan Nieuwenhuizen diff --git a/m2m/include/midi-score.hh b/mi2mu/include/midi-score.hh similarity index 100% rename from m2m/include/midi-score.hh rename to mi2mu/include/midi-score.hh diff --git a/m2m/include/midi-track.hh b/mi2mu/include/midi-track.hh similarity index 100% rename from m2m/include/midi-track.hh rename to mi2mu/include/midi-track.hh diff --git a/m2m/include/midi-voice.hh b/mi2mu/include/midi-voice.hh similarity index 100% rename from m2m/include/midi-voice.hh rename to mi2mu/include/midi-voice.hh diff --git a/m2m/include/my-midi-lexer.hh b/mi2mu/include/my-midi-lexer.hh similarity index 100% rename from m2m/include/my-midi-lexer.hh rename to mi2mu/include/my-midi-lexer.hh diff --git a/m2m/include/my-midi-parser.hh b/mi2mu/include/my-midi-parser.hh similarity index 91% rename from m2m/include/my-midi-parser.hh rename to mi2mu/include/my-midi-parser.hh index 6faf128a89..66de991259 100644 --- a/m2m/include/my-midi-parser.hh +++ b/mi2mu/include/my-midi-parser.hh @@ -31,6 +31,7 @@ public: void set_tempo( int useconds_i ); void set_time( int num_i, int den_i, int clocks_i, int count_32_i ); + int bar_i_; int track_i_; String filename_str_; String copyright_str_; @@ -42,11 +43,11 @@ public: Midi_time* midi_time_p_; private: - Int64 now_i64_; // 31 bits yields tipically about 1000 bars + I64 now_i64_; // 31 bits yields tipically about 1000 bars static int const CHANNELS_i = 16; static int const PITCHES_i = 128; - Int64 running_i64_i64_a_[ CHANNELS_i ][ PITCHES_i ]; + I64 running_i64_i64_a_[ CHANNELS_i ][ PITCHES_i ]; Midi_score* midi_score_p_; int division_1_i_; diff --git a/m2m/include/track-column.hh b/mi2mu/include/track-column.hh similarity index 100% rename from m2m/include/track-column.hh rename to mi2mu/include/track-column.hh diff --git a/m2m/lily-stream.cc b/mi2mu/lily-stream.cc similarity index 64% rename from m2m/lily-stream.cc rename to mi2mu/lily-stream.cc index 71385ab5e7..244e36f43b 100644 --- a/m2m/lily-stream.cc +++ b/mi2mu/lily-stream.cc @@ -7,7 +7,7 @@ // should i be named Mudela_stream? -#include "m2m.hh" +#include "mi2mu.hh" Lily_stream::Lily_stream( String filename_str ) { @@ -16,7 +16,7 @@ Lily_stream::Lily_stream( String filename_str ) indent_i_ = 0; comment_mode_bo_ = false; column_i_ = 0; - wrap_column_i_ = 78; + wrap_column_i_ = 60; open(); header(); } @@ -31,24 +31,42 @@ Lily_stream::~Lily_stream() Lily_stream& Lily_stream::operator <<( String str ) { + static String nobreak_str = "\\`'_-.^<>*@"; while ( str.length_i() ) { - int max_i = wrap_column_i_ - column_i_; - String line = str.left_str( max_i ); + int max_i = wrap_column_i_ - column_i_ - 1; + int i = str.length_i() - 1 8 * indent_i_ ) { + newline(); + if ( comment_mode_bo_ && ( str[ 0 ] != '%' ) ) + str = '%' + str; + continue; + } + else { // cannot break neatly... + i = max_i; + } + } - str = str.mid_str( max_i + 1, INT_MAX ); + String line = str.left_str( i + 1 ); + str = str.mid_str( i + 1, INT_MAX ); *os_p_ << line; - check_comment( line ); + if ( nl_i != -1 ) + newline(); + else + check_comment( line ); column_i_ += line.length_i(); - if ( column_i_ >= wrap_column_i_ ) { + if ( str.length_i() || ( column_i_ >= wrap_column_i_ ) ) { //brr. if ( comment_mode_bo_ ) str = "%" + str; @@ -62,6 +80,7 @@ Lily_stream& Lily_stream::operator <<( Midi_event& midi_event_r ) { midi_event_r.output_mudela( *this, false ); + *os_p_ << flush; return *this; } @@ -99,7 +118,7 @@ Lily_stream::indent() void Lily_stream::newline() { - *os_p_ << "\n" << String( '\t', indent_i_ ); + *os_p_ << endl << String( '\t', indent_i_ ); column_i_ = indent_i_ * 8; comment_mode_bo_ = false; } diff --git a/m2m/midi-main.cc b/mi2mu/main.cc similarity index 91% rename from m2m/midi-main.cc rename to mi2mu/main.cc index 488afc0a10..4971f451b2 100644 --- a/m2m/midi-main.cc +++ b/mi2mu/main.cc @@ -1,12 +1,10 @@ // -// midi-main.cc -- implement silly main() entry point +// main.cc -- implement silly main() entry point // should have Root class. // // copyright 1997 Jan Nieuwenhuizen -#include "m2m.hh" -#include "fversion.hh" -#include "version.hh" +#include "mi2mu.hh" Source source; Source* source_l_g = &source; @@ -30,7 +28,7 @@ find_file( String str ) void message( String message_str, char const* context_ch_c_l ) { - String str = "m2m: "; + String str = "mi2mu: "; Source_file* sourcefile_l = source_l_g->sourcefile_l( context_ch_c_l ); if ( sourcefile_l ) { str += sourcefile_l->file_line_no_str(context_ch_c_l) + String(": "); @@ -41,7 +39,7 @@ message( String message_str, char const* context_ch_c_l ) str += sourcefile_l->error_str( context_ch_c_l ); } // if ( busy_parsing() ) -// cerr << endl; + cerr << endl; // until we have fine output manager... cerr << str << endl; } @@ -88,7 +86,7 @@ notice() { mtor << "\n" - "M2m, translate midi to mudela.\n" + "Mi2mu, translate midi to mudela.\n" "Copyright (C) 1997 by\n" " Han-Wen Nienhuys \n" // "Contributors\n" @@ -110,15 +108,6 @@ notice() "USA.\n"; } -// should simply have Root class... -String -version_str() -{ - return String ( "This is m2m " ) + VERSIONSTR - + "/FlowerLib " + FVERSIONSTR - + " of " + __DATE__ + " " + __TIME__; -} - int main( int argc_i, char* argv_sz_a[] ) { diff --git a/m2m/midi-event.cc b/mi2mu/midi-event.cc similarity index 83% rename from m2m/midi-event.cc rename to mi2mu/midi-event.cc index 8ec23f9f95..2317fdb695 100644 --- a/m2m/midi-event.cc +++ b/mi2mu/midi-event.cc @@ -3,7 +3,7 @@ // // copyright 1997 Jan Nieuwenhuizen -#include "m2m.hh" +#include "mi2mu.hh" Midi_event::Midi_event() { @@ -25,10 +25,10 @@ Midi_key::Midi_key( int accidentals_i, int minor_i ) { accidentals_i_ = accidentals_i; minor_i_ = minor_i; - if ( !minor_i_ ) - key_i_ = ( ( accidentals_i % 7 )[ "cgdaebf" ] - 'a' + 2 ) % 7; + if ( accidentals_i >= 0 ) + key_i_ = ( ( accidentals_i % 7 )[ "cgdaebf" ] - 'a' - 2 ) % 7; else - key_i_ = ( ( -accidentals_i % 7 )[ "fbeadg" ] - 'a' + 2 ) % 7; + key_i_ = ( ( -accidentals_i % 7 )[ "cfbeadg" ] - 'a' - 2 ) % 7; } String @@ -36,11 +36,12 @@ Midi_key::mudela_str( bool command_mode_bo ) { String str = "key\\"; if ( !minor_i_ ) - str += String( (char)( key_i_ - 2 + 'A' ) ); - else - str += String( (char)( key_i_ - 2 + 'a' ) ); + str += String( (char)( ( key_i_ + 2 ) % 7 + 'A' ) ); + else // heu, -2: should be - 1 1/2: A -> fis + str += String( (char)( ( key_i_ + 2 - 2 ) % 7 + 'a' ) ); if ( !command_mode_bo ) str = String( '\\' ) + str; + str = String( "%" ) + str + "\n"; // "\key\F" not supported yet... return str; } @@ -57,12 +58,12 @@ Midi_key::notename_str( int pitch_i ) 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 ]; - if ( accidentals_i_ < 0 ) { + if ( accidental_i && ( accidentals_i_ < 0 ) ) { accidental_i = - accidental_i; notename_i = ( notename_i + 1 ) % 7; } - String notename_str = (char)( ( ( notename_i + key_i_ - 2 ) % 7 ) + 'a' ); + String notename_str = (char)( ( ( notename_i + 2 ) % 7 ) + 'a' ); while ( accidental_i-- > 0 ) notename_str += "is"; accidental_i++; @@ -75,7 +76,7 @@ Midi_key::notename_str( int pitch_i ) String octave_str; octave_str += String( '\'', ( pitch_i - Midi_note::c0_pitch_i_c_ ) / 12 ); - octave_str += String( '`', ( Midi_note::c0_pitch_i_c_ - pitch_i ) / 12 ); + octave_str += String( '`', ( Midi_note::c0_pitch_i_c_ + 11 - pitch_i ) / 12 ); return octave_str + notename_str; } @@ -124,7 +125,9 @@ Midi_note::mom() Midi_tempo::Midi_tempo( int useconds_per_4_i ) { useconds_per_4_i_ = useconds_per_4_i; - seconds_per_1_f_ = (Real)useconds_per_4_i_ * 4 / 1e6; +// huh, is it not per 4? +// seconds_per_1_f_ = (Real)useconds_per_4_i_ * 4 / 1e6; + seconds_per_1_f_ = (Real)useconds_per_4_i_ * 8 / 1e6; } String @@ -172,6 +175,12 @@ Midi_time::Midi_time( int num_i, int den_i, int clocks_4_i, int count_32_i ) clocks_1_i_ = clocks_4_i * 4; } +Moment +Midi_time::bar_mom() +{ + return Moment( num_i_ ) * Duration_convert::dur2_mom( Duration( den_i_ ) ); +} + int Midi_time::clocks_1_i() { diff --git a/m2m/midi-score.cc b/mi2mu/midi-score.cc similarity index 75% rename from m2m/midi-score.cc rename to mi2mu/midi-score.cc index 541cb8f0f3..ce4e230a23 100644 --- a/m2m/midi-score.cc +++ b/mi2mu/midi-score.cc @@ -3,7 +3,7 @@ // // copyright 1997 Jan Nieuwenhuizen -#include "m2m.hh" +#include "mi2mu.hh" Midi_score::Midi_score( int format_i, int tracks_i, int tempo_i ) { @@ -27,18 +27,21 @@ Midi_score::output_mudela( String filename_str ) { mtor << "Lily output to " << filename_str << " ..." << endl; + int track_i = 0; Lily_stream lily_stream( filename_str ); - for ( PCursor midi_track_l_pcur( midi_track_p_list_.top() ); midi_track_l_pcur.ok(); midi_track_l_pcur++ ) { - midi_track_l_pcur->output_mudela( lily_stream ); + for ( PCursor i( midi_track_p_list_.top() ); i.ok(); i++ ) { + mtor << "track " << track_i++ << ": " << flush; + i->output_mudela( lily_stream ); lily_stream.newline(); + mtor << endl; } lily_stream << "score {"; lily_stream.newline(); - for ( PCursor midi_track_l_pcur( midi_track_p_list_.top() ); midi_track_l_pcur.ok(); midi_track_l_pcur++ ) { + for ( PCursor i( midi_track_p_list_.top() ); i.ok(); i++ ) { lily_stream << "\tstaff { melodic music { "; - lily_stream << midi_track_l_pcur->name_str(); + lily_stream << i->name_str(); lily_stream << " } }"; lily_stream.newline(); } @@ -66,7 +69,11 @@ Midi_score::output_mudela( String filename_str ) void Midi_score::process() { - for ( PCursor i( midi_track_p_list_.top() ); i.ok(); i++ ) + int track_i = 0; + for ( PCursor i( midi_track_p_list_.top() ); i.ok(); i++ ) { + mtor << "track " << track_i++ << ": " << flush; i->process(); + mtor << endl; + } } diff --git a/m2m/midi-track.cc b/mi2mu/midi-track.cc similarity index 77% rename from m2m/midi-track.cc rename to mi2mu/midi-track.cc index 6c18f7a150..f94720cf2a 100644 --- a/m2m/midi-track.cc +++ b/mi2mu/midi-track.cc @@ -3,7 +3,7 @@ // // copyright 1997 Jan Nieuwenhuizen -#include "m2m.hh" +#include "mi2mu.hh" Midi_track::Midi_track( int number_i, String copyright_str, String track_name_str, String instrument_str ) { @@ -21,8 +21,10 @@ void Midi_track::add_begin_at( PointerList& open_voices_r, Moment mom ) { for ( PCursor i( midi_voice_p_list_.top() ); i.ok(); i++ ) - if ( i->begin_mom() == mom ) + if ( i->begin_mom() == mom ) { + dtor << "open_voices (" << open_voices_r.size() << "): +1\n"; open_voices_r.bottom().add( *i ); + } } void @@ -53,9 +55,9 @@ Midi_track::end_mom() Midi_voice* Midi_track::get_free_midi_voice_l( Moment mom ) { - for ( PCursor midi_voice_l_pcur( midi_voice_p_list_.top() ); midi_voice_l_pcur.ok(); midi_voice_l_pcur++ ) - if ( midi_voice_l_pcur->end_mom() == mom ) - return *midi_voice_l_pcur; + for ( PCursor i( midi_voice_p_list_.top() ); i.ok(); i++ ) + if ( i->end_mom() == mom ) + return *i; Midi_voice* midi_voice_p = new Midi_voice( mom ); Midi_voice* midi_voice_l = midi_voice_p; @@ -88,13 +90,24 @@ Midi_track::next_end_mom( Moment now_mom ) void Midi_track::process() { - for ( PCursor tcol_l_pcur( tcol_p_list_.top() ); tcol_l_pcur.ok(); tcol_l_pcur++ ) - while ( tcol_l_pcur->midi_event_p_list_.size() ) + int bar_i = 1; + Moment bar_mom = midi_parser_l_g->midi_time_p_->bar_mom(); + + for ( PCursor i( tcol_p_list_.top() ); i.ok(); i++ ) { + int bars_i = (int)( i->mom() / bar_mom ); + if ( bars_i > bar_i ) + mtor << '[' << bar_i << flush; + while ( i->midi_event_p_list_.size() ) // shit, where has the T* PCursor::remove() gone?? // i don-t want to get and delete, // i want to (re)move! // is it renamed: get vs add/insert ?? (put/remove :-) - get_free_midi_voice_l( tcol_l_pcur->mom() )->add_event( tcol_l_pcur->midi_event_p_list_.top().remove_p() ); + get_free_midi_voice_l( i->mom() )->add_event( i->midi_event_p_list_.top().remove_p() ); + if ( bars_i > bar_i ) { + bar_i++; + mtor << ']' << flush; + } + } dtor << "ends: " << endl; int n = 0; @@ -114,10 +127,16 @@ Midi_track::output_mudela( Lily_stream& lily_stream_r ) lily_stream_r << "% instrument:" << instrument_str_; lily_stream_r.newline(); + int bar_i = 1; + Moment bar_mom = midi_parser_l_g->midi_time_p_->bar_mom(); + PointerList open_voices; Moment now_mom = 0.0; Moment then_mom = 0.0; while ( now_mom < end_mom() ) { + int bars_i = (int)( now_mom / bar_mom ); + if ( bars_i > bar_i ) + mtor << '[' << bar_i << flush; add_begin_at( open_voices, now_mom ); Moment begin_mom = next_begin_mom( now_mom ); @@ -139,6 +158,10 @@ Midi_track::output_mudela( Lily_stream& lily_stream_r ) now_mom = then_mom; remove_end_at( open_voices, now_mom ); + if ( bars_i > bar_i ) { + bar_i++; + mtor << ']' << flush; + } } lily_stream_r.tnedni(); lily_stream_r << "$} % " << name_str_; @@ -149,31 +172,23 @@ void Midi_track::remove_end_at( PointerList& open_voices_r, Moment mom ) { for ( PCursor i( open_voices_r.top() ); i.ok(); i++ ) - if ( i->end_mom() == mom ) { + if ( i->end_mom() <= mom ) { + dtor << "open_voices (" << open_voices_r.size() << "): -1\n"; i.remove_p(); // remove? // no delete; only a copy if ( !i.ok() ) break; } -// i.del(); // remove? // no delete; only a copy -// plist is breendet -// duh, del and get will do a ++, but will fail if they render list empty -// if ( i->end_mom() == mom ) { -// if ( i->size() > 1 ) -// i.del(); -// else -// i.junk(); // what-s in a name? (sic) -// } } Track_column* Midi_track::tcol_l( Moment mom ) { - for ( PCursor tcol_l_pcur( tcol_p_list_.top() ); tcol_l_pcur.ok(); tcol_l_pcur++ ) { - if ( tcol_l_pcur->mom() == mom ) - return *tcol_l_pcur; - if ( tcol_l_pcur->mom() > mom ) { + for ( PCursor i( tcol_p_list_.top() ); i.ok(); i++ ) { + if ( i->mom() == mom ) + return *i; + if ( i->mom() > mom ) { Track_column* tcol_p = new Track_column( mom ); - tcol_l_pcur.insert( tcol_p ); + i.insert( tcol_p ); return tcol_p; } } diff --git a/m2m/midi-voice.cc b/mi2mu/midi-voice.cc similarity index 98% rename from m2m/midi-voice.cc rename to mi2mu/midi-voice.cc index 0d5b4b446c..e963be2f1c 100644 --- a/m2m/midi-voice.cc +++ b/mi2mu/midi-voice.cc @@ -3,7 +3,7 @@ // // copyright 1997 Jan Nieuwenhuizen -#include "m2m.hh" +#include "mi2mu.hh" Midi_voice::Midi_voice( Moment begin_mom ) { diff --git a/m2m/my-midi-lexer.cc b/mi2mu/my-midi-lexer.cc similarity index 98% rename from m2m/my-midi-lexer.cc rename to mi2mu/my-midi-lexer.cc index 22ebe75372..843899567b 100644 --- a/m2m/my-midi-lexer.cc +++ b/mi2mu/my-midi-lexer.cc @@ -3,7 +3,7 @@ // // copyright 1997 Jan Nieuwenhuizen -#include "m2m.hh" +#include "mi2mu.hh" int yylex() diff --git a/m2m/my-midi-parser.cc b/mi2mu/my-midi-parser.cc similarity index 94% rename from m2m/my-midi-parser.cc rename to mi2mu/my-midi-parser.cc index ff0f44935e..e35369abfd 100644 --- a/m2m/my-midi-parser.cc +++ b/mi2mu/my-midi-parser.cc @@ -3,7 +3,7 @@ // // copyright 1997 Jan Nieuwenhuizen -#include "m2m.hh" +#include "mi2mu.hh" void yyerror(char const* sz_l ) @@ -26,6 +26,7 @@ My_midi_parser::My_midi_parser( String filename_str ) midi_tempo_p_ = 0; midi_time_p_ = 0; track_i_ = 0; + bar_i_ = 1; reset(); } @@ -50,6 +51,7 @@ My_midi_parser::reset() delete midi_time_p_; midi_time_p_ = new Midi_time( 4, 4, 384, 8 ); now_i64_ = 0; + bar_i_ = 1; copyright_str_ = ""; track_name_str_ = ""; @@ -67,6 +69,7 @@ My_midi_parser::add_score( Midi_score* midi_score_p ) assert( !midi_score_p_ ); midi_score_p_ = midi_score_p; track_i_ = 0; + bar_i_ = 1; } void @@ -102,7 +105,7 @@ My_midi_parser::note_begin( int channel_i, int pitch_i, int dyn_i ) Midi_event* My_midi_parser::note_end_midi_event_p( int channel_i, int pitch_i, int dyn_i ) { - Int64 start_i64 = running_i64_i64_a_[ channel_i ][ pitch_i ]; + I64 start_i64 = running_i64_i64_a_[ channel_i ][ pitch_i ]; // running_i64_i64_a_[ channel_i ][ pitch_i ] = -1; // assert( start_i64 != -1 ); // did we start? @@ -114,6 +117,7 @@ int My_midi_parser::output_mudela( String filename_str ) { assert( midi_score_p_ ); + mtor << "\nProcessing..." << endl; midi_score_p_->process(); return midi_score_p_->output_mudela( filename_str ); } @@ -121,6 +125,7 @@ My_midi_parser::output_mudela( String filename_str ) int My_midi_parser::parse() { + mtor << "\nParsing..." << flush; return ::yyparse(); } diff --git a/m2m/midi-template.cc b/mi2mu/template.cc similarity index 87% rename from m2m/midi-template.cc rename to mi2mu/template.cc index 1ffe8d2a1b..be7a2a2352 100644 --- a/m2m/midi-template.cc +++ b/mi2mu/template.cc @@ -1,5 +1,5 @@ // -// midi-template.cc -- implementemplate +// template.cc -- implementemplate // // copyright 1997 Jan Nieuwenhuizen @@ -13,7 +13,7 @@ L_instantiate(void *); class istream; class ostream; -#include "m2m.hh" +#include "mi2mu.hh" #include "plist.hh" #include "plist.tcc" diff --git a/m2m/track-column.cc b/mi2mu/track-column.cc similarity index 94% rename from m2m/track-column.cc rename to mi2mu/track-column.cc index 783206fb93..57b072b3b9 100644 --- a/m2m/track-column.cc +++ b/mi2mu/track-column.cc @@ -3,7 +3,7 @@ // // copyright 1997 Jan Nieuwenhuizen -#include "m2m.hh" +#include "mi2mu.hh" Track_column::Track_column( Moment mom ) { diff --git a/mi2mu/version.cc b/mi2mu/version.cc new file mode 100644 index 0000000000..cb58c6b5b2 --- /dev/null +++ b/mi2mu/version.cc @@ -0,0 +1,18 @@ +// +// version.cc -- implement inexpensive versioning +// +// copyright 1997 Jan Nieuwenhuizen + +#include "mi2mu.hh" +#include "fversion.hh" +#include "version.hh" + +// should simply have Root class... +String +version_str() +{ + return String ( "This is mi2mu " ) + VERSIONSTR + + "/FlowerLib " + FVERSIONSTR + + " of " + __DATE__ + " " + __TIME__; +} + -- 2.39.5