Frage

I'm trying to use the python (2.7) package mingus (0.4.2.3, latest in pypi) to parse a musicxml doc and turn that into midi output. I've hit a snag running midi_file_out.py from source:

if __name__ == '__main__':
from mingus.containers.NoteContainer import NoteContainer
from mingus.containers.Bar import Bar
from mingus.containers.Track import Track
from mingus.containers.Instrument import MidiInstrument
b = Bar()
b2 = Bar('Ab', (3, 4))
n = NoteContainer(['A', 'C', 'E'])
t = Track()
b + n
b + []
b + n
b + n
b2 + n
b2 + n
b2 + []
t + b
t + b
m = MidiInstrument()
m.instrument_nr = 13
t.instrument = m
t.name = 'Track Name Test'
write_NoteContainer('test.mid', n)
write_Bar('test2.mid', b)
write_Bar('test3.mid', b, 200)
write_Bar('test4.mid', b2, 200, 2)
write_Track('test5.mid', t, 120)

The five .mid files are generated but when I go to play them back, only test5.mid produces any sound. The other four have durations and playback occurs but no sound is produced. OS is Ubuntu 12.0.4.1. Thoughts on getting playback to work for all the files? Am I missing some other package?

War es hilfreich?

Lösung

Seems that the issue is with my media player and not the code itself. The files play perfectly fine using timidity. I was using totem and it seems it is missing some plugins/instruments for midi playback.

Solution from askubuntu.com

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top