From a reverse-engineered file specification I have done.
The file has a set of instruments, and a mapping between logical and GM numbers.
I use these GM numbers to map into the editor's bank slots.
Some files don't have these GM assignments (like fmmidi, but entries in other banks also);
I do a hack to map the instrument in another way which may not necessarily match GM. It's OK for melodic but for percussion not so much (which has usually many blank slots), but still permits getting access to instruments.
From a reverse-engineered file specification I have done.
The file has a set of instruments, and a mapping between logical and GM numbers. I use these GM numbers to map into the editor's bank slots. Some files don't have these GM assignments (like fmmidi, but entries in other banks also); I do a hack to map the instrument in another way which may not necessarily match GM. It's OK for melodic but for percussion not so much (which has usually many blank slots), but still permits getting access to instruments.