def main(dest_client, file_name, display=False): seq = alsamidi.Seq() seq.read(file_name) events = alsamidi.merge(seq.tracks) seq.info() print(len(events), 'events') alsaseq.client('aseqplay', 0, 1, 1) alsaseq.connectto(0, dest_client, 0) for channel in range(16): alsaseq.output(alsamidi.pgmchangeevent(channel, 0)) alsaseq.start() for event in events: if display: print(event) alsaseq.output(event) alsaseq.syncoutput()
def test_track(self): from alsamidi import merge event = (0, 0, 0, 0, 0) self.assertEqual([event], merge([[event]]))
def test_no_tracks(self): from alsamidi import merge self.assertEqual([], merge([]))