Interval_t<T> &operator *=(T r) {
left *= r;
right *= r;
- if (r <0) {
+ if (r < T(0)) {
T t = left;
left = right;
right = t;
return "[empty]";
String s("[");
- return s + left + "," + right +"]";
+ return s + String( left ) + String( "," ) + String( right ) + String( "]" );
}
template<class T>
Real
Interval_t<Real>::infinity()
{
- return HUGE;
+ return HUGE_VAL;
}
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() ];
MAJOR_VERSION = 0
MINOR_VERSION = 0
-PATCH_LEVEL = 16
+PATCH_LEVEL = 17
# use to send patches, always empty for released version:
MY_PATCH_LEVEL =
#
# list of distribution files:
#
-DISTFILES = Makefile .version $(ALL_SOURCES)
-
+EXTRA_DISTFILES = .version TODO
#
# list of custom libraries:
--- /dev/null
+# 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
+
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;
}
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;
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_;
str += Duration_convert::dur2_str( dur );
if ( dur_.plet_b() )
- str += String( " \\plet{ 1/1 }" );
+ str += String( " \\plet 1/1;" );
return str;
}
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;
}
%{//-*-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
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 << " }";
//IPL_instantiate(Midi_event);
IPL_instantiate(Midi_track);
// PL_instantiate(Midi_voice);
-// IPL_instantiate(Midi_voice);
+IPL_instantiate(Midi_voice);
//IPL_instantiate(Track_column);