Write a mingus.Composition to a MIDI file.
(file, composition, bpm=120, repeat=0, verbose=False)
| 136 | |
| 137 | |
| 138 | def write_Composition(file, composition, bpm=120, repeat=0, verbose=False): |
| 139 | """Write a mingus.Composition to a MIDI file.""" |
| 140 | m = MidiFile() |
| 141 | t = [] |
| 142 | for x in range(len(composition.tracks)): |
| 143 | t += [MidiTrack(bpm)] |
| 144 | m.tracks = t |
| 145 | while repeat >= 0: |
| 146 | for i in range(len(composition.tracks)): |
| 147 | m.tracks[i].play_Track(composition.tracks[i]) |
| 148 | repeat -= 1 |
| 149 | return m.write_file(file, verbose) |
| 150 | |
| 151 | |
| 152 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected