Skip to content

MidiFileGenerator writes wrong number of tracks #1

@GoogleCodeExporter

Description

@GoogleCodeExporter
In the music folder, example1.py only has 8 tracks, but the midi file generated 
has a header that says it has 16.  Most midi players will play the midi file 
anyway, but it is technically wrong.

The following one line change fixes the issue.

    def getHeaderChunk(self):
        return 'MThd\x00\x00\x00\x06\x00\x01%s%s' % (
#                               struct.pack('>h', self.number_of_track_chunks),
                               struct.pack('>h', len(self.tracks)),
                               struct.pack('>h', self.ticks_per_beat))

Original issue reported on code.google.com by shao...@gmail.com on 27 May 2013 at 1:15

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions