<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_midi_data(self):
 """Collect and return the raw, binary MIDI data from the tracks."""

        tracks = [t.get_midi_data() for t in self.tracks if t.track_data != '']
        return self.header() + ''.join(tracks)