VSTSynthFont hangs when playing instruments for the first time

mike
Posts: 31
Joined: Thu Mar 19, 2015 10:14 pm

VSTSynthFont hangs when playing instruments for the first time

Post by mike »

Hi Kenneth,

so I'm using VSTSynthFont lately to play with my MIDI keyboard in VSTHost. VSTHost ist quite cool in combination with VSTSynthFont because I can just play any Soundfont I like (and there is lots of them available).
However, I do often run into the issue that VSTSynthFont will lock up VSTHost when I switch to an instrument for the first time and play a few notes (I guess VSTSynthFont is loading the instrument from my harddrive). This is quite annoying because VSTHost will lock up for a couple of seconds when using a 1GB+ Soundfont and will introduce a couple of seconds latency (until I restart it :( ).
Would it be possible to make VSTSynthFont read the samples from harddrive in the background (so VSTHost won't hang up) and just use the old instrument (or drop the notes) until the new one is fully loaded?

Best regards,
mike

PS: I am aware of live MIDI input in SynthFont but I personally don't like it because it generally has too high latency (big buffer sizes) or it starts to stutter (small buffer sizes).
used to be "likeaguest"
Admin
Site Admin
Posts: 671
Joined: Tue Mar 17, 2015 9:22 am

Re: VSTSynthFont hangs when playing instruments for the first time

Post by Admin »

Hi Mike,
I will look into it. It sounds like a possible reason for the host (any host) to get locked up for a short while, especially if the SoundFont is large. I could include an option to have the VST load the complete SoundFont into memory at startup, of course. Like in SyFonOne. I'll think about.
Admin
Site Admin
Posts: 671
Joined: Tue Mar 17, 2015 9:22 am

Re: VSTSynthFont hangs when playing instruments for the first time

Post by Admin »

Mike, looking into the issue now. One question: have you ever tested my midi port (=your keyboard's port) player, SyFonOne? It has basically the same synth engine as the VST instrument but as it runs in its own thread there's very little risk that your keyboard jams. Just set it up to hook to your keyboard directly.

Additionally: SyFonOne can use multiple CPU cores while VSTSynthFont uses only one.
mike
Posts: 31
Joined: Thu Mar 19, 2015 10:14 pm

Re: VSTSynthFont hangs when playing instruments for the first time

Post by mike »

I tried SyFonOne and it seems to be fine in terms of file buffering. However, I get the same issues as with SynthFont live input. I've played around with buffer sizes and the latency values and I either get very choppy sound or the latency isn't very good (it's not terrible but I do notice the difference when playing on the keyboard).

In VSTHost I can generally go down to 256 samples (44.1k) of buffer size and it won't get choppy. So at least with the current state of SyFonOne I'd prefer to stick with VSTHost to get lower latency.
used to be "likeaguest"
Admin
Site Admin
Posts: 671
Joined: Tue Mar 17, 2015 9:22 am

Re: VSTSynthFont hangs when playing instruments for the first time

Post by Admin »

Thanks Mike, when I get the time I will figure out why SyFonOne "misbehaves" with small buffer sizes like 256 samples (with ASIO, of course - I use ASIO4ALL). Shouldn't be any reasons for it, really.

Here is my first test version of a new VSTSynthFont:
https://www.dropbox.com/s/rybmltwk9cfmj ... A.rar?dl=0

This version offers two things: you can choose to load the whole SoundFont into memory (like in SyFonOne). This is pertinent only to the default SoundFont. Thus, if you have an arrangement which uses other SoundFonts, you will not gain anything. Go to Options and page Files & Numbers to switch this feature OFF - it is ON by default.

This version also creates a new preset called for by a midi program change message in the background so not to stall the host in any way. However, notes arriving immediately after a midi program change message are kept in memory until the new preset has been created (they will not be played using the previous preset as you suggested). In my tests using as medium-large SoundFont (<2GB) the time needed to create a new preset is in fact only a few hundred milliseconds - or less if you have the SoundFont in memory. (This time depends also on the size of the particular preset, of course.)

More to follow.

What do you think?
mike
Posts: 31
Joined: Thu Mar 19, 2015 10:14 pm

Re: VSTSynthFont hangs when playing instruments for the first time

Post by mike »

This version doesn't seem to work correctly. I can't load it in VSTHost nor in SynthFont.
Both programs just will ignore loading it without error message. I mean, VSTHost generally won't output any information if loading failed but I thought SynthFont would at least say something.
used to be "likeaguest"
Admin
Site Admin
Posts: 671
Joined: Tue Mar 17, 2015 9:22 am

Re: VSTSynthFont hangs when playing instruments for the first time

Post by Admin »

Maybe you are running out of memory. This version loads the whole SoundFont into memory by default. I tested it on my PC in SynthFont2, REAPER and VStHost. All three managed to load this version of VSTSoundFont without problems and there's plenty of free memory left. However, SynthFont1 doesn't load it and issues an error message (not shown to the user) claiming "out of memory". The error message is not really true, as there ARE lots of free RAM. There's another, related, reason behind it. Try this: in your VSTSynthFont.ini file (C:\Users\<YOU>\AppData\Roaming\SynthFont) in section [Options] set
Preload SF2=0
Admin
Site Admin
Posts: 671
Joined: Tue Mar 17, 2015 9:22 am

Re: VSTSynthFont hangs when playing instruments for the first time

Post by Admin »

Might be another issue as well. Cakewalk will not load the file either. Back to the drawing board.
Admin
Site Admin
Posts: 671
Joined: Tue Mar 17, 2015 9:22 am

Re: VSTSynthFont hangs when playing instruments for the first time

Post by Admin »

Yepp. There was one (at least one) bug that made Cakewalk crash. This version fixes that one:
https://www.dropbox.com/s/m7vnyd5h3bijo ... B.rar?dl=0

However, SynthFont1 still complains about out of memory when trying to load the whole SoundFont. It is probably a case of the 2GB virtual memory range available for SynthFont1. A smaller SoundFont loads. SynthFont2 has a memory limit of 4 GB.
mike
Posts: 31
Joined: Thu Mar 19, 2015 10:14 pm

Re: VSTSynthFont hangs when playing instruments for the first time

Post by mike »

Can you link VSTSynthFont statically?
I've just threw the binary into a disassembler and found out it requires "borlndmm.dll" (part of the compiler suite?) which is not installed on my system.
So that's probably why it's still not working for me in any application.
used to be "likeaguest"
Post Reply