+ audio_ = a;
+}
+
+String
+Midi_piano_pedal::to_string () const
+{
+ Byte status_byte = (char) (0xB0 + channel_);
+ String str = ::to_string ((char)status_byte);
+
+ if (audio_->type_string_ == "Sostenuto")
+ str += ::to_string ((char)0x42);
+ else if (audio_->type_string_ == "Sustain")
+ str += ::to_string ((char)0x40);
+ else if (audio_->type_string_ == "UnaCorda")
+ str += ::to_string ((char)0x43);
+
+ int pedal = ((1 - audio_->dir_) / 2) * 0x7f;
+ str += ::to_string ((char)pedal);
+ return str;
+}
+
+Midi_tempo::Midi_tempo (Audio_tempo* a)
+{
+ audio_ = a;
+}
+
+String
+Midi_tempo::to_string () const
+{
+ int useconds_per_4_i = 60 * (int)1e6 / audio_->per_minute_4_;
+ String str = "ff5103";
+ str += String_convert::int2hex (useconds_per_4_i, 6, '0');
+ return String_convert::hex2bin (str);
+}
+
+Midi_text::Midi_text (Audio_text* a)
+{
+ audio_ = a;
+}
+
+String
+Midi_text::to_string () const
+{
+ String str = "ff" + String_convert::int2hex (audio_->type_, 2, '0');
+ str = String_convert::hex2bin (str);
+ str += i2varint_string (audio_->text_string_.length ());
+ str += audio_->text_string_;
+ return str;
+}
+
+Midi_track::Midi_track ()
+ : Midi_chunk ()
+{
+ // 4D 54 72 6B MTrk
+ // 00 00 00 3B chunk length (59)
+ // 00 FF 58 04 04 02 18 08 time signature
+ // 00 FF 51 03 07 A1 20 tempo