API to learn names of current mapping of Bank/Program to names

Posts: 1
Joined: December 19, 2016 - 22:38
API to learn names of current mapping of Bank/Program to names

Does anyone know if VirtualMIDISynth.dll, bass.dll, or bassmidi.dll expose API so that a host app can learn which programs/instruments are loaded into each bank/program?
If not, does it expose API so that a host app can learn which SoundFont files are currently loaded, so we could come up with the mapping ourselves?

Thanks!
Tom

Posts: 1120
Joined: March 25, 2012 - 01:19
Re: API to learn names of current mapping of Bank/Program to names

The info you need (and VMS2 shows into soundfonts list item details) can be read with bassmidi.dll:
http://www.un4seen.com/doc/#bassmidi/BASS_MIDI_FontGetInfo.html

Accessing these info through VMS is not so easy because:

  • VMS1 is a usermode DLL, loaded into MIDI client process space by winmm.dll (Windows MIDI interface) so you can't easily access bassmidi.dll functions directly because you haven't loaded it directly.
  • suppose you can get BASS_MIDI_FontGetInfo address through GetProcAddress() call: this is valid only if your user selected VMS as output device and not, i.e., Microsoft Synth
  • you could load bassmidi.dll (and so bass.dll) by yourself, but this will work only with VMS2 where driver and synth (that loads BASS stuff) components are in two distinct processes; VMS2 won't load BASS into your process so you're free to do it and load any BASS version. VMS1 instead will load BASS (through winmm.dll) into your process space nd this will lead to DLL-hell VMS2 is going to avoid.

That said, I think that the beas way for you to get this info is to have a separate utility (.exe) that loads bassmidi.dll, parses the given *.sf2 file and returns the required info; your software could then run this utility and parse its output.

warning

Warning, JavaScript is disabled!

JavaScript is not available, maybe because you disabled it globally into your browser settings or you are using an addon like NoScript.

We do not have any dangerous JavaScript running here.
Please enable JavaScript; if you're using NoScript this image will help you adding CoolSoft to your whitelist.

Thanks for your comprehension and enjoy CoolSoft.