Author Topic: Help BASS_VST  (Read 47 times)

Salvo

  • Posts: 162
Help BASS_VST
« on: 30 Sep '24 - 16:49 »
I would like to ask a question before I probe it.
If I have this code:

    MemChan2.LoadFromFile(PChar('c:\file1.mp3'));
    ch := BASS_StreamCreateFile(True, MemChan2.memory, 0, MemChan2.size, BASS_STREAM_DECODE or BASS_STREAM_PRESCAN);
    ch := BASS_FX_TempoCreate(ch, BASS_FX_FREESOURCE);
    ch_dps := BASS_VST_ChannelSetDSP(ch, PChar('plugin.dll), BASS_UNICODE, 0);
..........
    MemChan2.LoadFromFile(PChar('c:\file2.mp3'));
    ch := BASS_StreamCreateFile(True, MemChan2.memory, 0, MemChan2.size, BASS_STREAM_DECODE or BASS_STREAM_PRESCAN);
    ch := BASS_FX_TempoCreate(ch, BASS_FX_FREESOURCE);
    ch_dps := BASS_VST_ChannelSetDSP(ch, PChar('plugin.dll), BASS_UNICODE, 0); >>>>>>AGAIN I HAVE TO RECHARGE

After I have listened to the file I want to upload another mp3 and always submit it to the various plugins, I have to put the same code back and then RELOAD the "plugin.dll" library again ???????
Since I have several very heavy plugins that I reload the libraries of the various plugins every time, it takes 20 seconds to run the second mp3 file, which is an eternity.
But I can load the various plugins ONLY ONCE and then run all the mp3 files without loading the plugin libraries ????



Ian @ un4seen

  • Administrator
  • Posts: 26079
Re: Help BASS_VST
« Reply #1 on: 1 Oct '24 - 14:18 »
How much time gap is there between freeing a stream and creating a new one? By default, BASS_VST delays unloading unused VST plugins by 10 seconds, so if you call BASS_VST_ChannelSetDSP again within that time then the VST shouldn't need to be reloaded. If you want to keep the VST loaded through any gap length, then one thing you could try is creating a "dummy" stream (BASS_StreamCreate with STREAMPROC_DUMMY) and setting the same VST on that.