]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.65
authorfred <fred>
Sun, 24 Mar 2002 19:43:45 +0000 (19:43 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:43:45 +0000 (19:43 +0000)
flower/include/interval.hh
flower/include/interval.tcc
flower/interval.cc
lib/duration-convert.cc
mi2mu/.version
mi2mu/Makefile
mi2mu/TODO [new file with mode: 0644]
mi2mu/midi-event.cc
mi2mu/midi-lexer.l
mi2mu/midi-score.cc
mi2mu/template.cc

index ec39f0d7e26a9993c9c0895e1fc37f2735812b76..bf4e4cc0e74d56758eaa3653dbb59a3671a86297 100644 (file)
@@ -75,7 +75,7 @@ struct Interval_t {
     Interval_t<T> &operator *=(T r) {
        left *= r;
        right *= r;
-       if (r <0) {
+       if (r < T(0)) {
            T t = left;
            left = right;
            right = t;
index 49be7046085ba6bf555a1e184d19f8cf140c665a..ab2eb95ec3b72f53c0c172c89574b303fca92312 100644 (file)
@@ -98,7 +98,7 @@ Interval_t<T>::str() const
        return "[empty]";
     String s("[");
  
-    return s + left + "," + right +"]";
+    return s + String( left ) + String( "," ) + String( right ) + String( "]" );
 }
 
 template<class T>
index 1db78d8dbf06346d9f8ca37574604451a1401a78..12152d6227a9042f43071fa1217c775e9f547b6c 100644 (file)
@@ -15,5 +15,5 @@ Interval__instantiate(Real);
 Real
 Interval_t<Real>::infinity() 
 {
-    return HUGE;
+    return HUGE_VAL;
 }
index 1b738507af96665162d7cf170b457c6fe3d6bf83..4a46bf9e64b69caacb6abbd9141add9a9e26e828 100644 (file)
@@ -121,18 +121,23 @@ Duration_convert::mom2standardised_dur( Moment mom )
        for ( int i = 0; i < dur_array_s.size() - 1; i++ ) {
                Moment lower_mom = dur2_mom( dur_array_s[ i ] );
                if ( mom <= lower_mom ) {
-                       // all arbitrary, but 1/4 will get rid of the noise...
-//                     if ( i || ( mom / lower_mom > Moment( 3, 4 ) ) )
-//kinda ok             if ( i || ( mom / lower_mom > Moment( 2, 4 ) ) )
-                       if ( i || ( mom / lower_mom > Moment( 2, 6 ) ) )
+                       // all arbitrary, but 3/4 will get rid of the noise...
+                       // kinda ok
+                       if ( i || ( mom / lower_mom > Moment( 3, 4 ) ) )
                                return dur_array_s[ i ];
                        else
                                return Duration( 0 );
                }
                Moment upper_mom = dur2_mom( dur_array_s[ i + 1 ] );
+#if 0  // % deviation of upper/lower from mom, perhaps it's better to use
                if ( ( mom < upper_mom )
                         && ( ( mom - lower_mom ) / mom
                                < ( upper_mom - mom ) / mom ) )
+#else // % deviation of mom from lower/upper?
+               if ( ( mom < upper_mom )
+                        && ( ( mom - lower_mom ) / lower_mom
+                               < ( upper_mom - mom ) / upper_mom ) )
+#endif
                        return dur_array_s[ i ];
        }
 //     return dur_array_s[ dur_array_s.length_i() ];
index 4e05deeab57cc7fb14d236354a7e42e7d1e73b3a..0bd28567f076f9b64ec55a3b85eb67c726428c3a 100644 (file)
@@ -1,6 +1,6 @@
 MAJOR_VERSION = 0
 MINOR_VERSION = 0
-PATCH_LEVEL = 16
+PATCH_LEVEL = 17
 # use to send patches, always empty for released version:
 MY_PATCH_LEVEL = 
 #
index 1afa1ac1f82649a9186100f9cf8886b21670c37b..abb87bb77562cc7148730a6fff76c237eabbe3ae 100644 (file)
@@ -40,8 +40,7 @@ VERSION_DEPENDENCY = $(mi2mu-version)
 
 # list of distribution files:
 #
-DISTFILES = Makefile .version $(ALL_SOURCES)
-
+EXTRA_DISTFILES = .version TODO
 #
 
 # list of custom libraries:
diff --git a/mi2mu/TODO b/mi2mu/TODO
new file mode 100644 (file)
index 0000000..5fb343a
--- /dev/null
@@ -0,0 +1,160 @@
+# mi2mu/TODO
+
+Most of the items are marked in the code as well, with full explanation. 
+grep for TODO and ugh/ugr
+
+
+IMPORTANT
+
+       * important? lily is important, go work on lily!
+
+       * faq about mi2mu midi t1. ?
+
+PROJECTS
+
+       * write something interesting in mi2mu manual page
+
+       * check/use type 0 / 1 / 2 of midi file
+
+       * create Indentable_stream (see Tex_stream) as base for Lily_stream
+
+       * use dynamic info
+
+       * use aftertouch info (to guess slurs/ties, scripts (staccato?))
+
+       * lyric events
+
+       * parse all midi events
+
+       * handle time based midi files
+
+       * use dstream feature from lily
+
+       * midi esp.: use I32 iso int where 32 bits are needed (or assumed...)
+
+       * read unsigned words as U16 (not as I16)
+
+       * check use of integral and unsigned in lexer
+       
+       * get rid of ugly statics in Duration_convert
+
+       * change option double-dots to max-dots
+
+       * set Key, Meter, ... command line options
+
+BUGS
+
+       * mi2mu nonexist.midi ?
+
+       * output of 0 duration c'0
+
+       * no output on certain midis
+
+       * silly progress indicator upon mudela output
+
+       * check for illegal track names, e.g. "Piano________ = \melodic"
+
+       * array memleaks(?): use Link_array / create Pointer_array? 
+
+       * fix "#undef MEVENT_LIST" source tree: Array<Midi_event*> 
+
+       * split notes that cross bar limit
+
+FUTURE
+
+       * guess plets (i.e.: only use plet-duration *2/3 if there's a 
+         whole plet)
+
+       * merge midi-events with lily's midi-items?
+
+       * guess beams
+
+       * guess / follow tempo changes
+
+       * check out NIFF / analogies?
+
+       * steal good ideas of other gpl midi parsers
+
+       * lily: add mudela info into midi as specials
+         mi2mu: use special info
+
+# mi2mu/TODO
+
+Most of the items are marked in the code as well, with full explanation. 
+grep for TODO and ugh/ugr
+
+
+IMPORTANT
+
+       * important? lily is important, go work on lily!
+
+       * faq about mi2mu midi t1. ?
+
+PROJECTS
+
+       * write something interesting in mi2mu manual page
+
+       * check/use type 0 / 1 / 2 of midi file
+
+       * create Indentable_stream (see Tex_stream) as base for Lily_stream
+
+       * use dynamic info
+
+       * use aftertouch info (to guess slurs/ties, scripts (staccato?))
+
+       * lyric events
+
+       * parse all midi events
+
+       * handle time based midi files
+
+       * use dstream feature from lily
+
+       * midi esp.: use I32 iso int where 32 bits are needed (or assumed...)
+
+       * read unsigned words as U16 (not as I16)
+
+       * check use of integral and unsigned in lexer
+       
+       * get rid of ugly statics in Duration_convert
+
+       * change option double-dots to max-dots
+
+       * set Key, Meter, ... command line options
+
+BUGS
+
+       * mi2mu nonexist.midi ?
+
+       * output of 0 duration c'0
+
+       * no output on certain midis
+
+       * silly progress indicator upon mudela output
+
+       * check for illegal track names, e.g. "Piano________ = \melodic"
+
+       * array memleaks(?): use Link_array / create Pointer_array? 
+
+       * fix "#undef MEVENT_LIST" source tree: Array<Midi_event*> 
+
+       * split notes that cross bar limit
+
+FUTURE
+
+       * guess plets (i.e.: only use plet-duration *2/3 if there's a 
+         whole plet)
+
+       * merge midi-events with lily's midi-items?
+
+       * guess beams
+
+       * guess / follow tempo changes
+
+       * check out NIFF / analogies?
+
+       * steal good ideas of other gpl midi parsers
+
+       * lily: add mudela info into midi as specials
+         mi2mu: use special info
+
index 028730acacca7410aebd58cd3259a25e9fc5b0f0..e98149d597d96989dd2d424f0f368906549f6341 100644 (file)
@@ -39,8 +39,6 @@ Midi_key::mudela_str( bool command_mode_bo )
                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;
 }
@@ -84,7 +82,7 @@ Midi_key::notename_str( int pitch_i )
  this switch can be used to write simple plets like 
      c4*2/3 
  as  
-     \plet{ 2/3 } c4 \plet{ 1/1 }
+     \plet 2/3; c4 \plet 1/1;
  */
 bool const Midi_note::simple_plet_b_s = true;
 
@@ -99,17 +97,20 @@ String
 Midi_note::mudela_str( bool command_mode_bo )
 {
 //     assert( !command_mode_bo );
+       if ( !dur_.type_i_ )
+               return "";
+
        if ( simple_plet_b_s )
                return name_str_ + Duration_convert::dur2_str( dur_ );
 
        //ugh
        String str;
        if ( dur_.plet_b() )
-               str += String( "\\plet{ " )
+               str += String( "\\plet " )
                        + String_convert::i2dec_str( dur_.plet_.iso_i_, 0, 0 )
                        + "/"
                        + String_convert::i2dec_str( dur_.plet_.type_i_, 0, 0 )
-                       + " } ";
+                       + "; ";
 
        str += name_str_;
 
@@ -118,7 +119,7 @@ Midi_note::mudela_str( bool command_mode_bo )
        str += Duration_convert::dur2_str( dur );
 
        if ( dur_.plet_b() )
-               str += String( " \\plet{ 1/1 }" );
+               str += String( " \\plet 1/1;" );
                
        return str;
 }
@@ -213,11 +214,9 @@ Midi_time::num_i()
 String
 Midi_time::mudela_str( bool command_mode_bo )
 {
-       String str = "\\meter{ "
+       String str = "\\meter "
                + String( num_i_ ) + "/" + String( 1 << den_i_ ) 
-               + " }";
-//     if ( !command_mode_bo )
-//         str =  String( '\\' ) + str;
+               + ";";
        return str;
 }
 
index 1bc41ded0ab0ab92390251fea1342c9f4666261e..a1cb3262a6eb97e495b2fafdff66a61be4505220 100644 (file)
@@ -1,6 +1,15 @@
 %{//-*-Fundamental-*-
 // midi-lexer.l
 
+/* 
+  yes, i know that midi is not really a (n evolving?) language,
+  and that using lex/yacc to parse midi is overkill, as well as
+  a grand example of misuse and asking for performance loss.
+
+  it is, however, quite robust, simple, and very easy to extend
+  incrementally.
+ */
+
 /*
   backup rules
 
index 28cb7dae557d1c401ed3f4f14d2577519550eca7..1803cafc4c97503f650fad270cff4a53575957b1 100644 (file)
@@ -43,6 +43,9 @@ Midi_score::output_mudela( String filename_str )
        lily_stream << "\\score{";
        lily_stream.indent();
                for ( PCursor<Midi_track*> i( midi_track_p_list_.top() ); i.ok(); i++ ) {
+                       if ( ( midi_track_p_list_.size() != 1 ) 
+                               && ( i == midi_track_p_list_.top() ) )
+                               continue;
                        lily_stream << "\\staff{ melodicregs ";
                        lily_stream << i->name_str();
                        lily_stream << " }";
index 24edd32cc4c7206078b35cb3270d2778ca9cc1e2..e7f367a8a1aad5750b60f84acab5a4059b863e21 100644 (file)
@@ -20,6 +20,6 @@ class ostream;
 //IPL_instantiate(Midi_event);
 IPL_instantiate(Midi_track);
 // PL_instantiate(Midi_voice);
-// IPL_instantiate(Midi_voice);
+IPL_instantiate(Midi_voice);
 //IPL_instantiate(Track_column);