drywetmidi: Playback produces unexpected results in Unity
I’ve integrated DWM into my Unity project (2019.1.0f2) for MIDI file playback and parsing. I’ve called playback.Start()
and the MIDI file will not play. I have tried several MIDI files and nothing will play.
// Use the first available OutputDevice (Microsoft GS Wavetable Synth)
var outputDevice = OutputDevice.GetAll().ToArray()[0];
// The MIDI file is copied to this location earlier
var playback = MidiFile.Read(Application.dataPath + @"/Scripts/in.mid").GetPlayback(outputDevice);
Later, in a coroutine (so the MIDI file starts playing at a specific time):
playback.Start();
Playback doesn’t want to start, even on the main thread.
Also, playback.Play()
works, but it freezes the thread which I don’t want, and it also drops a lot of notes, even on really simple MIDI files.
No exceptions are thrown.
What am I missing? And is there some fix to the dropped notes?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 43 (26 by maintainers)
@Teafuu Right now there are no workarounds.
BUT I’m going to implement kind of ticking mode for playback/clock to choose between:
I’ll implement this API as soon as possible.
Problem with using winmm timers in Unity/Mono. Unity team is working on a solution. Waiting for news from them.