def header(self):
        """Return a header for type 1 MIDI file."""
        tracks = a2b_hex('%04x' % len([t for t in self.tracks if
            t.track_data != '']))
        return 'MThd\x00\x00\x00\x06\x00\x01' + tracks + self.time_division
def header ( self ) : tracks = a2b_hex ( '%04x' % len ( [ t for t in self . tracks if t . track_data != '' ] ) ) return 'MThd\x00\x00\x00\x06\x00\x01' + tracks + self . time_division
Return a header for type 1 MIDI file.