Author Topic: BASS_MIDI_FontGetInfo calls become very slow in case o bigger SFZ files  (Read 324 times)

Falcosoft

  • Posts: 167
Hi Ian,
I have noticed that in case of bigger SFZ files (where overall sample size > ~500 MB) a single
BASS_MIDI_FontGetInfo() call can be slower than 30ms. I have never noticed this in case of bigger SF2 files even in the GB range. In case of a 1.5 GB SF2 file a single BASS_MIDI_FontGetInfo() call is usually less than 1ms. 
This can be a problem since in my Midi player an animation thread  (WinMM multimedia timer callback) uses this call to determine the actual used sample size etc. and prints this info together with channel/spectrum etc. animation.   
BTW, even if all samples all pre-loaded and so the font info does not change at all between calls each call still produces the same slow ~30ms result.

Here is a large enough guitar SFZ file for testing:
https://drive.google.com/uc?id=1uoV7icZV1_IjiOGKM7Wm5_K5UkF41Fm3&export=download

Thanks in advance.

Ian @ un4seen

  • Administrator
  • Posts: 25725
The issue there is that BASS_MIDI_FontGetInfo is checking for regions with the same samples (to avoid counting them more than once) in each call, which could take a bit of time if there are 1000s of regions. Here's an update that will precheck for duplicates only once:

   www.un4seen.com/stuff/bassmidi.zip

Let me know if you still see any issues with it.

Falcosoft

  • Posts: 167
The issue there is that BASS_MIDI_FontGetInfo is checking for regions with the same samples (to avoid counting them more than once) in each call, which could take a bit of time if there are 1000s of regions. Here's an update that will precheck for duplicates only once:

   www.un4seen.com/stuff/bassmidi.zip

Let me know if you still see any issues with it.

Thanks, it is working perfectly now.