code: def header(self):
          
          chunk_size = a2b_hex('%08x' % (len(self.track_data)
                                + len(self.end_of_track())))
          return TRACK_HEADER + chunk_size
docs: Return the bytes for the header of track.
  
          The header contains the length of the track_data, so you'll have to
          call this function when you're done adding data (when you're not
          using get_midi_data).