Playback produces unexpected results in Unity
See original GitHub issueI’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?
Issue Analytics
- State:
- Created 4 years ago
- Comments:43 (26 by maintainers)
Top Results From Across the Web
Unity freezes on second play after objects disposing
I have the issue with playback on Unity: Playback produces unexpected results in Unity. User who reported the issue created a simple Unity ......
Read more >Common problems | DryWetMIDI
Playback doesn't produce sound or events logs. Make sure an instance of Playback ... Playback produces unexpected results in Unity · Visualization of...
Read more >10 Common Unity Mistakes
Before you use Unity's straightforward and intuitive tool for multi-platform development, acquaint yourself with and avoid these common Unity mistakes.
Read more >Troubleshooting - Unity's Package Manager
Failed to resolve packages: The file [<project-path>/Packages/manifest.json] is not valid JSON: Unexpected token '}' at 44:1 }.
Read more >Known issues and limitations | Recorder | 4.0.1
Known issue: When you build a project that includes Recorder tracks in Timeline, Unity throws an error in the Console. Recorder tracks are...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@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.