Author Topic: BASS_VST 2.4.0.6 - available for download  (Read 102943 times)

bpetersen

  • Posts: 70
BASS_VST 2.4.0.6 - available for download
« on: 29 Apr '06 - 03:25 »
BASS_VST allows the usage of VST effect plugins in BASS 2.2 - 2.4.  BASS_VST was written to work with Silverjuke, where we've switched to BASS some day and needed VST support. Any usage is for your own risk - but you're welcome and I'm sure it will work :-)

Download: http://www.un4seen.com/filez/5/bass_vst24.zip

For some documentations, please refer to the readme and to the header files included in the package. I would be glad to see any feedback or questions here in this thread. Have fun!

Best regards,
Bjoern Petersen


Edit: BASS_VST is released under the LGPL license now, see below for details.
« Last Edit: 26 Feb '15 - 22:10 by bpetersen »

victor

  • Posts: 124
Re: BASS_VST - available for download
« Reply #1 on: 29 Apr '06 - 16:10 »
Hi,

any chance on getting a delphi header for it?

Viktor

Chris

  • Posts: 1808
Re: BASS_VST - available for download
« Reply #2 on: 29 Apr '06 - 17:21 »
Hi
Today I have not the Time (sorry) but tomorror I will build a Delphi Header for the dll
Greets Chris

victor

  • Posts: 124
Re: BASS_VST - available for download
« Reply #3 on: 29 Apr '06 - 17:37 »
thanks Chris,

Viktor


Du bist der Groesste. :-)

Chris

  • Posts: 1808
Re: BASS_VST - available for download
« Reply #4 on: 29 Apr '06 - 19:56 »
Hi
Here is a NOT tested Delphi Header
(I will hope that I have nothing forget)

Try it please and let me know if something of the header will not work..

http://www.cst-development.de/downloads/bass_vst.pas

Greets Chris

victor

  • Posts: 124
Re: BASS_VST - available for download
« Reply #5 on: 30 Apr '06 - 00:33 »
Thanks Chris,

it works now, after i made some minor changes.
I will email you the changed version.

Unfortunately the bass_vst.dll does not load all VST plug-ins i have and the Waves plug-ins are crashing my app.
Though the freeware Kjaerhus and gvst work ok.

What i am desperately missing is a way to bypass the plug-in without unloading it and more than that to assign the plugin to another channel without loosing the setted params. Have i overlooked something?

Viktor

victor

  • Posts: 124
Re: BASS_VST - available for download
« Reply #6 on: 30 Apr '06 - 01:24 »
one more thing Bjoern,

thanks for the good work!

Viktor

bpetersen

  • Posts: 70
Re: BASS_VST - available for download
« Reply #7 on: 30 Apr '06 - 05:06 »
Unfortunately the bass_vst.dll does not load all VST plug-ins i have[...]

Which plugins are not loaded? Note that BASS_VST only loads realtime VST-Effects with at least 1 in and 1 out. You can check BASS_ErrorGetCode() if BASS_VST_ChannelSetDSP() fails.

and the Waves plug-ins are crashing my app. Though the freeware Kjaerhus and gvst work ok.

Can you tell me a webpage where I can download these plugins for testing? Maybe I can find out the reason for this.

What i am desperately missing is a way to bypass the plug-in without unloading it and more than that to assign the plugin to another channel without loosing the setted params. Have i overlooked something? [...]

Bypassing is currently not possible. Maybe I should add sth. like BASS_VST_SetBypass() ... And assigning a loaded plugin to another channel would be complicated (although not impossible) as the channel may have a complete different frequency, format and so on. But you can transfer all parameters easily using a simple loop:

Code: [Select]
for( int p = BASS_VST_GetParamCount(newHandle)-1; p >= 0; p-- )
   BASS_VST_SetParam(newHandle, p, BASS_VST_GetParam(oldHandle, p));

Bjoern
« Last Edit: 30 Apr '06 - 18:14 by bpetersen »

victor

  • Posts: 124
Re: BASS_VST - available for download
« Reply #8 on: 30 Apr '06 - 14:13 »
here is the link www.waves.com

could you please, please, please ... add the function BASS_VST_SetBypass(). It is very important for me.

Assigning a VST to another channel is not that important and your suggestion transfering the params is the way to go.

Viktor

radio42

  • Posts: 4574
Re: BASS_VST - available for download
« Reply #9 on: 30 Apr '06 - 15:23 »
Hi Björn,

great stuff!!!!
I am from Hamburg too ;-) and doing the BASS.NET API wrapper.
So I am going to add your VST addon of course too.

One question though: All your char* (e.g. filename, inside BASS_VST_PARAM_INFO etc.) are C-strings I assume (so not UTF-8 or Unicode strings right?!)

Don't know, if that makes sense for VST, but some parameters should have a Unicode option.
E.g. the filename in the BASS_VST_ChannelSetDSP method.
Do you think it would be worth adding a BASS_UNICODE flag there?

For the BASS_VST_PARAM_INFO I am not sure, since this might be a Steinberg API issue, but could those names be Unicode as well? or are these char arrays always single-byte?

Many Greetz

bpetersen

  • Posts: 70
Re: BASS_VST - available for download
« Reply #10 on: 30 Apr '06 - 16:48 »
[...]could you please, please, please ... add the function BASS_VST_SetBypass().[...]

I will check why the "waves" plugins crash and then there will be an update these days (hours?).

Hi Björn,

great stuff!!!!

Thank you!

I am from Hamburg too ;-) [...]

Maybe we can have a beer together ;-)

[...]and doing the BASS.NET API wrapper. So I am going to add your VST addon of course too.

One question though: All your char* (e.g. filename, inside BASS_VST_PARAM_INFO etc.) are C-strings I assume (so not UTF-8 or Unicode strings right?!)

Don't know, if that makes sense for VST, but some parameters should have a Unicode option.
E.g. the filename in the BASS_VST_ChannelSetDSP method.
Do you think it would be worth adding a BASS_UNICODE flag there?

For the BASS_VST_PARAM_INFO I am not sure, since this might be a Steinberg API issue, but could those names be Unicode as well? or are these char arrays always single-byte? [...]

Steingberg's VST API does not support Unicode at all, so BASS_VST_PARAM_INFO, BASS_VST_INFO etc. can stay as they are. Also the (quite small) buffers for the returned strings are correct and are documented this way.

So the only place where Unicode makes sense is BASS_VST_ChannelSetDSP() for the filename which is just forwarded to LoadLibraryA() - I'm not sure, is LoadLibraryW() really needed? However, it would not be a problem to implement this, please tell me your opinion.

Best regards,
Bjoern

bpetersen

  • Posts: 70
New version 2.2.0.2 available
« Reply #11 on: 30 Apr '06 - 20:34 »
Hello,

the download link in the first post is now updated to point to the new version of BASS_VST, 2.2.0.2

I've added two new functions, BASS_VST_SetBypass() and BASS_VST_GetBypass(). Moreover, there is a new parameter for BASS_VST_ChannelSetDSP() which may take the flag BASS_UNICODE, please see bass_vst.h inside the package for details.

Some words to the problems with the plugins from http://www.waves.com:

I tried to download and to install a plugin - without success. Waves seem to have a very restrictive copy protection and needs some hardware keys (at least as I understand). They seem to force crashes when sth. is not "correct"; in my tries a simple LoadLibrary() - before doing anything else - crashes my app. Maybe they also check against host versions or sth. like that later. I've send an e-mail to the  Waves Audio Ltd. and asked for help - maybe they can provide me a DLL I can really use for testing.

In short: I'm willing to fix bugs, but for Waves it is impossible at the moment. If anyone has other plugins that make problems, please post them here.

BTW: For my tests, the following vendors/plugins work fine with BASS_VST:

Kjaerhus Audio Plugins
Sinusweb FreeverbToo, TripleComp
WWAYM NWEQ
SIR Impulse Response Processor
Voxengo Plugins
Magnus' Plugins
Anwidasoft L1V
AriesCode's AriesVerb
Camel audio's CamelPhatFree
Koen Tanghe's KTGranulator
Arguru Software's Stardust
Kelly Industries' Plugins
Braindoc's Plugins

I'm sure the list is not complete ...
« Last Edit: 30 Apr '06 - 21:00 by bpetersen »

victor

  • Posts: 124
Re: BASS_VST 2.2.0.2 - available for download
« Reply #12 on: 30 Apr '06 - 21:52 »
works great. :-)

Thanks a lot, Bjoern

jensrodi

  • Posts: 39
Re: BASS_VST 2.2.0.2 - available for download
« Reply #13 on: 2 May '06 - 00:58 »
Had to try this out in Delphi, very easy to use I must say :) Just a few points I discovered.

There seems to be an error in the header file. Shouldn't the line

Code: [Select]
BASS_VSTSCOPE BOOL BASS_VSTDEF(BASS_VST_EmbedEditor)(DWORD vstHandle, void* parentWindow);
be changed to:

Code: [Select]
BASS_VSTSCOPE BOOL BASS_VSTDEF(BASS_VST_EmbedEditor)(DWORD vstHandle, HWND parentWindow);
I can not get it to work if I pass a pointer to the handle (which doesn't make sense), but everything works with the embedded editors if I pass the handle directly.

To Chris: The Delphi header needs following updating to match BASS_VST 2.2.0.2 and above change:

Code: [Select]
function BASS_VST_ChannelSetDSP(Channel:DWORD;const DLLFile:PChar;Flags:DWORD;priority:Integer): DWORD;stdcall;external BASS_VSTDLL;
function BASS_VST_EmbedEditor(Channel:DWORD;ParentWindow:HWND): Bool;stdcall;external BASS_VSTDLL;
Also I suggest this change to the GetInfo function, makes it a lot more obvious how to call the function:

Code: [Select]
function BASS_VST_GetInfo(VSTHandle:DWORD;var Info:BASS_VST_INFO): Bool;stdcall;external BASS_VSTDLL;

bpetersen

  • Posts: 70
Re: BASS_VST 2.2.0.2 - available for download
« Reply #14 on: 2 May '06 - 04:43 »
[...]There seems to be an error in the header file. Shouldn't the line

Code: [Select]
BASS_VSTSCOPE BOOL BASS_VSTDEF(BASS_VST_EmbedEditor)(DWORD vstHandle, void* parentWindow);
be changed to [...]

No, the line is correct. I simply use void* instead of HWND to have the interface to be compatibly to an upcoming OS X version. In the documentation for BASS_VST_EmbedEditor() is written "... call this function with parentWindow set to the HWND of the parent window" which means the following:

Code: [Select]
HWND hWnd = CreateWindow(...);
BASS_VST_EmbedEditor(vstHandle, (void*)hWnd); // not: (void*)&hWnd

I can not get it to work if I pass a pointer to the handle (which doesn't make sense), but everything works with the embedded editors if I pass the handle directly.

You've found it out yourself ;-) However, for the Delphi, it may be more clearly to declare the function with a HWND handle which is casted in the header then (if possible - I don't know Delphi very well).

Best regards,
Bjoern
« Last Edit: 2 May '06 - 04:50 by bpetersen »

Chris

  • Posts: 1808
Re: New version 2.2.0.2 available
« Reply #15 on: 2 May '06 - 10:33 »
Hello,

the download link in the first post is now updated to point to the new version of BASS_VST, 2.2.0.2

I've added two new functions, BASS_VST_SetBypass() and BASS_VST_GetBypass(). Moreover, there is a new parameter for BASS_VST_ChannelSetDSP() which may take the flag BASS_UNICODE, please see bass_vst.h inside the package for details.



Hi
In the bass_vst.h I didn`t seen this 2 Functions
and
#define BASS_VST_PARAM_CHANGED  1
#define BASS_VST_KEEP_CHANS 1

both will have a Value of 1 ??

Greets Chris

bpetersen

  • Posts: 70
Re: New version 2.2.0.2 available
« Reply #16 on: 2 May '06 - 11:16 »
Hi
In the bass_vst.h I didn`t seen this 2 Functions
and
#define BASS_VST_PARAM_CHANGED  1
#define BASS_VST_KEEP_CHANS 1

both will have a Value of 1 ?? [...]

These are no functions but optional constants that may be used by BASS_VST_ChannelSetDSP() (for BASS_VST_KEEP_CHANS) ...

Code: [Select]
DWORD vstHandle = BASS_VST_ChannelSetDSP(ch, "my.dll", BASS_VST_KEEP_CHANS, 0); // BASS_VST_KEEP_CHANS forces not to mixdown stereo channels for mono effects
... or by a VSTPROC callback (for BASS_VST_PARAM_CHANGED):

Code: [Select]
// our VST callback - referenced below by BASS_VST_SetCallback()
DWORD myVstProc(DWORD vstHandle, DWORD action, DWORD param1, DWORD param2, DWORD user)
{
   switch( action )
   {
     case BASS_VST_PARAM_CHANGED:
       // we get notified that the user has changed some sliders in the editor -
       // do what to do here ...
       break;

     case BASS_VST_EDITOR_RESIZED:
       // the editor window requests a new size,
       // maybe we should resize the window the editor is embedded in?
       // the new width/height can be found in param1/param2
       break;
     
     case BASS_VST_AUDIO_MASTER:
       // this is only for people familiar with the VST SDK,
       // param1 is a pointer to a BASS_VST_AUDIO_MASTER_PARAM structure
       // which contains all information needed
       break;
   }
   return 0;
}

// open the VST editor
HWND hWndParent = CreateWindow(...);
BASS_VST_EmbedEditor(vstHandle, (void*)hWndParent);

// we want to get notified for parameter changes etc.
BASS_VST_SetCallback(vstHandle, myVstProc, 0);

Of course, defining a callback is optional and not needed in many cases. For the resizing: I have not seen an effect that uses it.
« Last Edit: 2 May '06 - 11:25 by bpetersen »

Chris

  • Posts: 1808
Re: BASS_VST 2.2.0.2 - available for download
« Reply #17 on: 2 May '06 - 11:25 »
oops sorry I have me a little bit unclear worded

I know that #define is a constructor
Thats now clear

But my Question was

I did`nt seen this 2 functions in the bass_vst.h

BASS_VST_SetBypass() and BASS_VST_GetBypass()
(so I don`t know the Parameters of the call , so that I can`t translate that to the delphi header)
Greets Chris

victor

  • Posts: 124
Re: BASS_VST 2.2.0.2 - available for download
« Reply #18 on: 2 May '06 - 11:34 »
see line 231 and 234 in the new bass_vst.h

se

  • Posts: 22
Re: BASS_VST 2.2.0.2 - available for download
« Reply #19 on: 2 May '06 - 14:57 »
great!

working with delphi5, after the changes on the .pas header, everything is fine.

questions:
- do you think it will work with BASS_Mixer_StreamCreate function ?
- putting more than one vst plugin on a specific channel, which order do we have for the processing of the audio samples?

One of my problem is that I would like to put an effect on a whole playlist, and for each title I'm creating a new channel (autofree). SO I have now to recreate the same effect for each new channel, (I don't take care now of the parameters of this effect).
I guess the Bass_mix is the solution....

thank you for this great job!

bpetersen

  • Posts: 70
Re: BASS_VST 2.2.0.2 - available for download
« Reply #20 on: 2 May '06 - 15:22 »
questions:
- do you think it will work with BASS_Mixer_StreamCreate function ?

I have not tried this, but I do not think that there will be a problem.

- putting more than one vst plugin on a specific channel, which order do we have for the processing of the audio samples?

You define the order by the priority parameter or BASS_VST_ChannelSetDSP() - effects with higher priority are called before those with lower.

One of my problem is that I would like to put an effect on a whole playlist, and for each title I'm creating a new channel (autofree). SO I have now to recreate the same effect for each new channel, (I don't take care now of the parameters of this effect).
I guess the Bass_mix is the solution....

Both is possible - just do what you like more or what fits better to your current implementation. Creating one VST effects eg. to every song in the playlist is no problem, in fact it is exactly what I am doing in Silverjuke. However, Bass_mix may be the easier solution regarding the parameter/editor handling.

thank you for this great job!

Your are welcome.

Bjoern

jensrodi

  • Posts: 39
Re: BASS_VST 2.2.0.2 - available for download
« Reply #21 on: 2 May '06 - 15:49 »
No, the line is correct. I simply use void* instead of HWND to have the interface to be compatibly to an upcoming OS X version. In the documentation for BASS_VST_EmbedEditor() is written "... call this function with parentWindow set to the HWND of the parent window" which means the following:

Code: [Select]
HWND hWnd = CreateWindow(...);
BASS_VST_EmbedEditor(vstHandle, (void*)hWnd); // not: (void*)&hWnd


Still, this convention seems very strange to me, essentially typecasting a value into a pointer. Normally you'd declare pointer parameters when you want the function called to return information in that pointer. Delphi or C, there is not that much difference in how functions are declared, only in the syntax. I'm not familiar with OSX but I know my way around both C and Pascal.

radio42

  • Posts: 4574
Re: BASS_VST 2.2.0.2 - available for download
« Reply #22 on: 2 May '06 - 16:24 »
No religios discussions here ;-)
It looks like Björn knows what to do.

The cast to a void-pointer is just a generic way to avoid type-mismatches which will happen under OSX, since there no HWND datatype does exist - that is a Windows only datatype.

"hWnd" is a variable and the value contains already a pointer (an address) to the Window-Handle.
So the cast (void*) simply takes away the HWND restriction.

If you would declare "(void*)&hWnd" you would get a pointer to the address of the variable "hWnd" - which would be wrong, since you want to pass the content of the variable to the method.
Take a look at native BASS. Ian is already using a lot of void-pointers, which is simply a generic pointer to any kind of object - a stupid address so to say.

jensrodi

  • Posts: 39
Re: BASS_VST 2.2.0.2 - available for download
« Reply #23 on: 2 May '06 - 17:33 »
No religios discussions here ;-)
It looks like Björn knows what to do.

I'm sure he does. Everything else about the VST plug-in is great and very easy to use. It was not meant as a 'religious' comment, just me wondering why this is so, trying to understand the reason for the otherwise illogical declaration :)

The cast to a void-pointer is just a generic way to avoid type-mismatches which will happen under OSX, since there no HWND datatype does exist - that is a Windows only datatype.

I guess HWND is a Windows thing, though OSX would have something similar. But couldn't you typedef youself out of that with some conditional defines, adding the missing type on OSX? Unless BASS_VST_EmbedEditor changes the parent window handle, and I can't see why, the handle should be passable as a value, even on OSX.

Take a look at native BASS. Ian is already using a lot of void-pointers, which is simply a generic pointer to any kind of object - a stupid address so to say.

I have only been using the Delphi version and to this day never seen a function using pointers unless it made sense. Like for instance passing a filename or a function address, which could not be parsed as a value.

Anyway, this is not meant as criticism in any negative way. I'm very greatfull to all participating in developing BASS, plug-ins for BASS and keeping the Delphi wrappers up-to-date. I realize the amount of work going into this is big, being a fulltime developer my self.

Ian @ un4seen

  • Administrator
  • Posts: 20400
Re: BASS_VST 2.2.0.2 - available for download
« Reply #24 on: 2 May '06 - 22:30 »
Is Delphi available for OSX? If not, I guess the Delphi API could just use "HWND" :)

The C/C++ API could also make use of an #ifdef...

Code: [Select]
BASS_VSTSCOPE BOOL BASS_VSTDEF(BASS_VST_EmbedEditor)
#ifdef _WIN32
    (DWORD vstHandle, HWND parentWindow);
#else
    (DWORD vstHandle, void* parentWindow);
#endif