The old version of the edited SoundFont stays in memory.

Please let our ADS show!

This sites offers only FREE software and it's supported by a few advertisement boxes (no intrusive popups).
Please:

  • disable your AdBlocker by adding CoolSoft website to whitelist
  • give the proper cookie consent
  • enable JavaScript for this website

This seconds wait is to let you update your browser configuration...

Ok, I've done the required changes... now show me your content!
!!! Please enable JavaScript !!!
Posts: 30
Joined: April 19, 2017 - 08:14
The old version of the edited SoundFont stays in memory.

I close a SoundFont in the list with a minus key when VMS is open. (Preload off)
I edit this Soundfont and open it with the plus key. (I close Preload again)
Then I'm just testing the patch I've edited in this SoundFont (with a midi file)
But what I hear is not the new version of Soundfont, but the older version.

What comes to mind in this case is that Soundfont is somewhat in memory or cache.

The only way to overcome this situation is to turn off midi software and turn off VMS. (We can not close VMS before leaving the software)
And reopen the software. (VMS automatically opens in this case)
Now that I have not changed anything, I hear the changed version of SoundFont when I play the test file again via the software.

I hope I can express exactly what I mean.

Posts: 1972
Joined: March 25, 2012 - 01:19
Re: The old version of the edited SoundFont stays in memory.

Which version of VMS are you using, 1.x or 2.x?

Version 1.x does not feature a live-reload of configuration, so you need to close all running instances by closing their MIDI client softwares or force them to release the virtual device (you can chack if VMS is closed by looking at its systray icon).
Version 2.x, otherwise, immediately applies soundfont and configuration changes even while playing.

Posts: 30
Joined: April 19, 2017 - 08:14
Re: The old version of the edited SoundFont stays in memory.

I apologize for not specifying:
I'm talking about the latest stable release: 2.01

This situation has been strange to me.
Maybe the problem does not need to be on VMS.
I wonder if the OS (win 7 32bit) could keep Soundfont's shadow copy somewhere and use it. (Until I turn off VMS) This is just a guess, since I do not know how the system works internally.

But I choose SoundFont from the opening window. I see clearly the change date and time. Maybe Windows is cheating on me. I do not know.
The second way to overcome the problem is "Poor Man's versioning system": If I recorded each change with "Save as" with another name (eg piano_v200706261325.sf2) then this is a new file, so the problem I mentioned earlier does not appear.

Think of it as an information, not as a complaint.
If I can find a way to overcome the problem, I will continue to work that way.
But of course I inform you too. Maybe this information works somewhere.

Posts: 1972
Joined: March 25, 2012 - 01:19
Re: The old version of the edited SoundFont stays in memory.

Well, VMS does not load SF2 files by itself but asks BASS.dll (the libs used for MIDI synth) to do so.
I don't know if BASS has some kind of caching of the file bu I suppose not, expecially if you turn off the preloading.

Windows has some kind of caching on a file if this is loaded as "memory mapped file", but this cache is (or at least it should be) invalidated when the cached file changes.

One thing to try is to open SysInternals (now Microsoft) Process Explorer (https://technet.microsoft.com/sysinternals), select VirtualMIDISynth.exe process and look its file handles (in the bottom part of the window).
You should see that it has an handle to your *.sf2 file; now unload it with "-" and check if the handle disappears (it does on my side), then reload it again after changing it and it should reappear with a different handle ID.
If it has the same handleID, well, we have something to work on...

Posts: 1972
Joined: March 25, 2012 - 01:19
Re: The old version of the edited SoundFont stays in memory.

Another workaround could be, if your editor supports it, using the SFZ format instead of SF2.

In SFZ all samples are contained in a folder where each sample is a separate file; an index file (plain text file) is used to find the right file to play when needed, instead of pack all of them together in a single SF2 file.

Posts: 30
Joined: April 19, 2017 - 08:14
Re: The old version of the edited SoundFont stays in memory.

Yes, You are right.

in Process Explerer.

I do not see any unload when I press the "-" key. and Apply. (Preload unticked) : File: "G:\sf2\1kHztest.sf2" Hande: 0X600
When I call SoundFont again with the "+" key, the handle does not change. (fixed on 0x600 in my case)  I pick the pencil icon, and removing the preload tick and press the Apply key. .

No matter how many times I do this, nothing changes.

Something in the Thumbnail Cache is unload and load. But SoundFont and its handle remain stable.

If I load another SoundFont that I'm working on, and load, unload and load it again, its handle also remains constant. (fixed on 0x440 in my case) File: "G:\sf2\zPiano-v1_3.sf2" Hande: 0X440

Win7 32 bit. 3GB Ram. +3GB Paging File (virtual Memory [on Disk])

My other doubts (speculations):
1. Preload does not work? (It comes ticked by default, and every time you need to select the pencil icon, remove Tick and Appy it.)
2. Or is the BASS dll not taking this unload command into account? (may be ignored this command for some reason).
3. Windows gives the message "I did the operation" to VMS (or BASS), but does not really change anything?

I dont know :)

Posts: 50
Joined: April 25, 2016 - 12:19
Re: The old version of the edited SoundFont stays in memory.

I had a similar problem in the past with the previous edit of a soundfont staying in memory. I think it has to do with the Windows Superfetch service which learns what you use and keeps it in RAM for quick access.

It only messes things up for me when the filesize of the soundfont changes, tries to load in what was done previously, and wrong instrument sounds would occur.

The workaround for me was to remove the soundfont from VMS (and the now incorrect soundfont filesize), and close VMS. Reopen and select the soundfont again and it should load correctly.

http://kiwi6.com/artists/GEN_MIDI