keijiro/MidiAnimationTrack

Using multiple MIDI files slows editor down - any best practices?

metaphysician opened this issue · 1 comments

hi there - we're in a project that requires using a lot of MIDI files on the timeline, and we are encountering severe slowdowns in the Editor as tracks are configured. at the moment the way we are running the MIDI tracks is that each track is one track on a MIDI file. we have 12 tracks, so 12 MIDI files for each section, and i noticed that by the time i got to 6 MIDI tracks the Editor becomes very sluggish.

i believe there seems to be some kind of performance issue, and it may be related to using multiple MIDI files and/or multiple MIDI tracks. this is in Unity 2021.3.11 LTS. to reproduce the error/slowdown you should add multiple MIDI files with each one being at least 4 minutes duration, and use a single track from each one. after you drag over 1 track from each MIDI file the editor will start to respond slower and slower as it processes the files. i found that after four tracks were placed it began to respond slower.

so, first question - if we only used a single MIDI file with multiple tracks, and dragged over the tracks, would that be better? we'll likely test that soon, but if not, we need a way to fix these slowdowns if they are based on the track objects converted into Timeline clips.

any assistance appreciated!

hi there - just a quick update. we did try to import a MIDI file with multiple tracks and use the child track items in hopes that the slowdown perhaps was based on the MIDI file, but it seems directly related to the conversion/processing on a Klak MIDI Timeline track.

it seems it goes into a memory heap and adds more data every time a track object is processed, which will gradually slow down the editor since the memory isn't cleared or purged. so it's similar to having a situation where objects are created but not destroyed. not sure if this helps out, but that's what our team is experiencing.