- return String ("<duration: ") + ::to_string (seconds_) + ">";
-}
-
-Midi_event::Midi_event (Moment delta_mom, Midi_item* midi)
-{
- delta_mom_ = delta_mom;
- midi_ = midi;
-}
-
-/*
- ugh. midi output badly broken since grace note hackage.
- */
-String
-Midi_event::to_string () const
-{
- Rational rat_dt = (delta_mom_.main_part_ * Rational (384) +
- delta_mom_.grace_part_ * Rational (100))*Rational (4);
- int delta_i = int (rat_dt);
-
- String delta_string = Midi_item::i2varint_string (delta_i);
- String midi_string = midi_->to_string ();
- assert (midi_string.length ());
- return delta_string + midi_string;
-}
-
-
-Midi_header::Midi_header (int format_i, int tracks_i, int clocks_per_4_i)
-{
- String str;
-
- String format_string = String_convert::int2hex (format_i, 4, '0');
- str += String_convert::hex2bin (format_string);
-
- String tracks_string = String_convert::int2hex (tracks_i, 4, '0');
- str += String_convert::hex2bin (tracks_string);
-
- String tempo_string = String_convert::int2hex (clocks_per_4_i, 4, '0');
- str += String_convert::hex2bin (tempo_string);
-
- set ("MThd", str, "");