Crash on project load by out-of-bound selection

The Hookpad editor persists the currently active note / chord selection across project loads, which means if the n-th note of the existing project was selected, the editor will automatically select the n-th note of the new project after loading finishes, regardless of note lengths. This can crash Hookpad if n happens to be out-of-bounds in the new project. More specifically, if

  • the new project has N notes;
  • the M-th note of the existing project is selected, for some M > N;
  • only 0 or 1 note among the first N notes of the existing project is selected;

then Hookpad crashes. The same applies to chord selections. For example, given a tab with 3 chords like:


Opening this tab will crash if only the 4th chord of the current project is selected. There are other combinations that would also crash (5th, 3rd - 4th, 3rd - 5th, 1st + 4th).

There is no reason to keep the current selection by note / chord indices, so the fix is to simply reset the active selection before opening a new project. (Actually a lot of the editor state should be reset, but Hookpad currently doesn’t.)

@Ryan, not fixed in 2.15.0.

Thx, @HertzDevil. Fixed in 2.15.3

If the project was playing prior to loading a new project, the editor will continue playing at the current cursor position even though the scrubber no longer follows the play cursor.

@HertzDevil, fixed the playback issue in 2.15.5