Specific MIDI file causing session to load unusually slowly

I had an ardour session that was loading very slowly, so I created an entirely new session, exported the (3) midi tracks one by one, and loaded them into the new session.

Lo and behold, the new session loaded slowly too. If I create yet another session and import each midi file… (essentially debugging which file is causing the slowdown), I can narrow it down to the bass line midi file.

https://github.com/cyrusadkisson/thingamagig-nirvana-smells_like_teen_spirit-48/blob/master/interchange/thingamagig-nirvana-smells_like_teen_spirit-48/midifiles/bass%20copy-1.7-1.mid

Here is the console output while the hang/pause happens:

Scanning folders for bundled LV2s: /usr/lib/ardour5/LV2
Set cursor set to default
 ---- THIS IS WHERE THE PAUSE HAPPENS ---
using block size: 128
mlock 456818 bytes
using block size: 128
mlock 456818 bytes
using block size: 128
using block size: 128
using block size: 128
mlock 36370 bytes
using block size: 128
mlock 36370 bytes
fluidsynth: warning: No preset found on channel 2 [bank=0 prog=33]
fluidsynth: warning: No preset found on channel 9 [bank=128 prog=0]
fluidsynth: warning: No preset found on channel 9 [bank=0 p pro330]
fluidsynth: warning: No preset found on channel 9 [bank=0 p pro330]

Note, if I remove all the imported midi tracks, it still seems to hang, probably due to lack fo clean up.

Note: Even when I’m trying to import the bass midi file into the session, the import dialog window seems sluggish as if it’s having the same issue trying to preload the midi file.

What is it about this one simple bass mid file that could cause such a hiccup?

There are around 50k MIDI events in that file. 46021 pitch-bend events. That’s a lot.

Edit: the interesting part is that the note events are on channel 3, while pitch-bend events are for channel 8.
try: “show all automation” and perhaps clear the pitch-bends. It is much faster to do that outside of Ardour, no undo data etc. using e.g. https://github.com/markc/midicomp

 midicomp bass\ copy-1.7-1.mid  | grep -v "Pb ch=8" | midicomp -c newbass.mid
1 Like