Delphi ASIO & VST sourceforge project
-
- KVRer
- 25 posts since 28 Oct, 2005 from Oslo, Norway
Hi all
i'm trying to improve the VSThost commponent to support more plugins (it does not like all plugins)
i found that for some plugins,
PVstEffect := FMainFunction(@audioMaster)
returns NIL. and then raises an exeption
This is espessialy the case with some shell plugins.
Can someone explain how and when the PVstEffect is passed?
I also found a bug (i think) regarding loading of shells the opcode
audioMasterCurrentId allways seems to return 0 in AudioMasterCallback of DVSTHost instead of the id of the subplugin.
Any ideas
All Best
Nikolai
i'm trying to improve the VSThost commponent to support more plugins (it does not like all plugins)
i found that for some plugins,
PVstEffect := FMainFunction(@audioMaster)
returns NIL. and then raises an exeption
This is espessialy the case with some shell plugins.
Can someone explain how and when the PVstEffect is passed?
I also found a bug (i think) regarding loading of shells the opcode
audioMasterCurrentId allways seems to return 0 in AudioMasterCallback of DVSTHost instead of the id of the subplugin.
Any ideas
All Best
Nikolai
-
Christian Budde Christian Budde https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=25572
- KVRAF
- Topic Starter
- 1538 posts since 14 May, 2004 from Europe
Hi Nikolai,
please have a look at the current code in the SVN repository. Several bugs regarding unsupported plugins are already fixed there.
Kind regards,
Christian
please have a look at the current code in the SVN repository. Several bugs regarding unsupported plugins are already fixed there.
Kind regards,
Christian
-
- KVRer
- 25 posts since 28 Oct, 2005 from Oslo, Norway
Hi thanks for your reply.Christian Budde wrote:Hi Nikolai,
please have a look at the current code in the SVN repository. Several bugs regarding unsupported plugins are already fixed there.
Kind regards,
Christian
A lot of good changes there..
But now i'm a bit puzzled on how to load shells.
My plan was like this:
-When scanning VST plugins, check if the dll is a shell
- if it is a shell loop ShellGetNextPlugin until result=0, and store all uniqueIDs
When opening a subplugin, Load the shell DLL and when it asks for audioMasterCurrentId return the ID of the sub plugin you want to load. this will open the subplugin.
Only problem is that audioMasterCurrentId returns 0 cause 'thePlug' = NIL at the time.
Before I create some fancy way of doing this I just want to know what your ideas are.
Thanks
Nikolai
-
Christian Budde Christian Budde https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=25572
- KVRAF
- Topic Starter
- 1538 posts since 14 May, 2004 from Europe
Hi Nikolai,
Kind regards,
Chistian
The problem is, that I don't own a plugin that naturally has shell support. I once wrote a plugin for my self, but can't remember (it's been over 4 years now). The problem with writing shell plugins is the fact, that some hosts automatically assume these are 'Waves' plugins, which lead not only to confusion, but in some cases to several problems.Nikolai wrote: But now i'm a bit puzzled on how to load shells.
My plan was like this:
-When scanning VST plugins, check if the dll is a shell
- if it is a shell loop ShellGetNextPlugin until result=0, and store all uniqueIDs
When opening a subplugin, Load the shell DLL and when it asks for audioMasterCurrentId return the ID of the sub plugin you want to load. this will open the subplugin.
Only problem is that audioMasterCurrentId returns 0 cause 'thePlug' = NIL at the time.
Before I create some fancy way of doing this I just want to know what your ideas are.
Kind regards,
Chistian
-
- KVRer
- 25 posts since 28 Oct, 2005 from Oslo, Norway
HiChristian Budde wrote: The problem is, that I don't own a plugin that naturally has shell support. I once wrote a plugin for my self, but can't remember (it's been over 4 years now). The problem with writing shell plugins is the fact, that some hosts automatically assume these are 'Waves' plugins, which lead not only to confusion, but in some cases to several problems.
Kind regards,
Chistian
Yes that makes it hard to debug. But I have found a way to support shell plugins with the DAV_ASIOhost. I have only tried this with waves plugins, and I still can't make the waves shell version 5.7 work (SSL bundle) but I leave that for now.
Ok, here is what I did.
first set host cando, ShellCategory on.
When your host scans for vst plugins, check the category and see if it is a shell.
If it is a shell, branch and get all sub plugins.
To get the subplugins, loop ShellGetNextPlugin until result=0, and save the UniqueIDs returned.
to later open a subplugin, you need to do a little trick.
I made a global variable called ShellLoadID. this should always be 0 if you are not loading a shell-sub-plugin. Else set it to the UniqueID of the shellSubPlug. (this is a longint variable so you need to convert the 4char text string).
when the upcode audioMasterCurrentId is called I changed the host code so that it returns the new variable ShellLoadID if the pointer "ThePlug" = nil.
This loads the sub plug.
A bit strange I know.. and the trick with a global variable makes it a bit fragile.
Also as a side not some plugins seem to need a call to getrect before OpenEdit to display it self properly.
Hope this helps others
All Best Nikolai
-
- KVRist
- 101 posts since 29 Dec, 2002
Hi,
I posted back in this thread a while ago about getting the framework to compile in D2009. I don't know if this information is irrelevant now, but just in case, I documented some other changes I needed to make.
Delphi12\DAV_Common_D12.dpk
---------------------------
The following:
CPUDetectionTool in '...\Source\CPUDetectionTool.pas',
Should be:
DAV_CPUDetectionTool in '..\Source\DAV_CPUDetectionTool.pas',
The following should be removed:
DAV_AudioFileFLAC in '..\Source\FileFormats\DAV_AudioFileFLAC.pas',
DAV_AudioFileWavePack in '..\Source\FileFormats\DAV_AudioFileWavePack.pas',
DAV_AudioFileMonkeyAudio in '..\Source\FileFormats\DAV_AudioFileMonkeyAudio.pas',
Delphi12\DAV_VSTPlugin_D12.dpk
------------------------------
The requires clause is missing "designide", so the following:
requires
rtl,
vcl,
DAV_Common_D12;
Should be:
requires
rtl,
vcl,
designide,
DAV_Common_D12;
The following:
Config in '..\Source\Config.pas',
OpenToolsUtils in '..\Source\OpenToolsUtils.pas',
Should be:
DAV_VSTPluginConfig in '..\Source\VST\DAV_VSTPluginConfig.pas',
DAV_OpenToolsUtils in '..\Source\DAV_OpenToolsUtils.pas',
The following:
DAV_VSTEffectFunctions in '..\Source\VST\DAV_VSTEffectFunctions.pas',
Should be:
DAV_VSTOfflineTask in '..\Source\VST\DAV_VSTOfflineTask.pas',
Source\FileFormats\DAV_ChunkAIFFFile.pas
----------------------------------------
In procedure TAIFFApplicationSpecificChunk.SetData the following:
then FApplicationSignature[index + 1] := Char(Value);
Should be:
then FApplicationSignature[index + 1] := AnsiChar(Value);
Source\VST\DAV_VSTCustomModule.pas
----------------------------------------
In procedure TCustomVSTModule.SetUniqueID the following:
then FEffect.uniqueID[4 - i] := Value
Should be:
then FEffect.uniqueID[4 - i] := AnsiChar(Value)
In function TCustomVSTModule.GetHostProduct the following:
var
Text : PChar;
should be:
var
Text : PAnsiChar;
In function TCustomVSTModule.GetHostVendor the following:
var
Text : PChar;
should be:
var
Text : PAnsiChar;
Source\DAV_Common.pas
---------------------
The following:
TChunkName = array [0..3] of Char;
Should be:
TChunkName = array [0..3] of AnsiChar;
Source\VST\DAV_VSTEffect.pas
----------------------------
The implementation of function FourCharToLong(C1, C2, C3, C4: AnsiChar): Longint; was still "Char". Needs to be AnsiChar
Source\DSP\DAV_DSPUpDownSampling.pas
------------------------------------
Unable to compile as undeclared identifier: 'TOrderFilterClass'
Delphi12\DAV_DSP_D12.dpk
------------------------
Includes DAV_DSPSineLFO in '..\Source\DSP\DAV_DSPSineLFO.pas', which doesn't exist
I posted back in this thread a while ago about getting the framework to compile in D2009. I don't know if this information is irrelevant now, but just in case, I documented some other changes I needed to make.
Delphi12\DAV_Common_D12.dpk
---------------------------
The following:
CPUDetectionTool in '...\Source\CPUDetectionTool.pas',
Should be:
DAV_CPUDetectionTool in '..\Source\DAV_CPUDetectionTool.pas',
The following should be removed:
DAV_AudioFileFLAC in '..\Source\FileFormats\DAV_AudioFileFLAC.pas',
DAV_AudioFileWavePack in '..\Source\FileFormats\DAV_AudioFileWavePack.pas',
DAV_AudioFileMonkeyAudio in '..\Source\FileFormats\DAV_AudioFileMonkeyAudio.pas',
Delphi12\DAV_VSTPlugin_D12.dpk
------------------------------
The requires clause is missing "designide", so the following:
requires
rtl,
vcl,
DAV_Common_D12;
Should be:
requires
rtl,
vcl,
designide,
DAV_Common_D12;
The following:
Config in '..\Source\Config.pas',
OpenToolsUtils in '..\Source\OpenToolsUtils.pas',
Should be:
DAV_VSTPluginConfig in '..\Source\VST\DAV_VSTPluginConfig.pas',
DAV_OpenToolsUtils in '..\Source\DAV_OpenToolsUtils.pas',
The following:
DAV_VSTEffectFunctions in '..\Source\VST\DAV_VSTEffectFunctions.pas',
Should be:
DAV_VSTOfflineTask in '..\Source\VST\DAV_VSTOfflineTask.pas',
Source\FileFormats\DAV_ChunkAIFFFile.pas
----------------------------------------
In procedure TAIFFApplicationSpecificChunk.SetData the following:
then FApplicationSignature[index + 1] := Char(Value);
Should be:
then FApplicationSignature[index + 1] := AnsiChar(Value);
Source\VST\DAV_VSTCustomModule.pas
----------------------------------------
In procedure TCustomVSTModule.SetUniqueID the following:
then FEffect.uniqueID[4 - i] := Value
Should be:
then FEffect.uniqueID[4 - i] := AnsiChar(Value)
In function TCustomVSTModule.GetHostProduct the following:
var
Text : PChar;
should be:
var
Text : PAnsiChar;
In function TCustomVSTModule.GetHostVendor the following:
var
Text : PChar;
should be:
var
Text : PAnsiChar;
Source\DAV_Common.pas
---------------------
The following:
TChunkName = array [0..3] of Char;
Should be:
TChunkName = array [0..3] of AnsiChar;
Source\VST\DAV_VSTEffect.pas
----------------------------
The implementation of function FourCharToLong(C1, C2, C3, C4: AnsiChar): Longint; was still "Char". Needs to be AnsiChar
Source\DSP\DAV_DSPUpDownSampling.pas
------------------------------------
Unable to compile as undeclared identifier: 'TOrderFilterClass'
Delphi12\DAV_DSP_D12.dpk
------------------------
Includes DAV_DSPSineLFO in '..\Source\DSP\DAV_DSPSineLFO.pas', which doesn't exist
-
Christian Budde Christian Budde https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=25572
- KVRAF
- Topic Starter
- 1538 posts since 14 May, 2004 from Europe
Hi Chrispy,
Being a single developer I can only be aware of the things I see, so I am in need of such reports. However, it would be preferable to send them by mail next time as I'm often on vacations lately and often do not have the time to check KVR regulary.
At the moment I'm trying to bundle a version 1.4 as the new platform independent WAV read/write routines are more or less done now. When this is done the next major milestone will be a proper Lazarus support. It is likely that this will break compatibility. For this reason I also guess that the 1.4 release will be the last release that supports Delphi 5 & 6.
Furthermore, I will slow down the development after 1.4 has been released as most of the goals are reached and the framework is overall working well.
Kind regards,
Christian
Thanks for the effort. I applied all of them to the latest SVN (at least I think so). I also added some more changes to improve the compatibility for D12.Chrispy wrote:I posted back in this thread a while ago about getting the framework to compile in D2009. I don't know if this information is irrelevant now, but just in case, I documented some other changes I needed to make.
[...]
Being a single developer I can only be aware of the things I see, so I am in need of such reports. However, it would be preferable to send them by mail next time as I'm often on vacations lately and often do not have the time to check KVR regulary.
At the moment I'm trying to bundle a version 1.4 as the new platform independent WAV read/write routines are more or less done now. When this is done the next major milestone will be a proper Lazarus support. It is likely that this will break compatibility. For this reason I also guess that the 1.4 release will be the last release that supports Delphi 5 & 6.
Furthermore, I will slow down the development after 1.4 has been released as most of the goals are reached and the framework is overall working well.
Kind regards,
Christian
-
- KVRist
- 55 posts since 30 Aug, 2008
Hi,
First, big thanks Christian for this great package.
I seem to be the only one still on D6.
If anyone uses D6, this is what I did.
To install I used modified D10 packages. Works fine with some D10 to D6 mods.
I had to plug StringToIOTAFile(), as D6 do not have it, and I don't have the source for it. I added an empty function in DAV_OpenToolsUtils.pas:
{$IFNDEF DELPHI7_UP}
function StringToIOTAFile(s: string): IOTAFile;
begin
result := nil;
end;
{$ENDIF} + prototype in interface section. I guess this will prevent the plugin wizard from proper working.
SE package does not install, I get the old L1030 "compiler error" for some reason, but I don't really need them.
One minor problem left: I installed on my main dev-PC, everything works except parameters can not be written from host, always default parameters. No Automation works. I had the old version installed, but everything was removed, incl. bpl's.
So, I installed on a second PC. Everything works fine there including automation.
So where did I mess up? I really want it to work on my main dev.
/O
First, big thanks Christian for this great package.
I seem to be the only one still on D6.
If anyone uses D6, this is what I did.
To install I used modified D10 packages. Works fine with some D10 to D6 mods.
I had to plug StringToIOTAFile(), as D6 do not have it, and I don't have the source for it. I added an empty function in DAV_OpenToolsUtils.pas:
{$IFNDEF DELPHI7_UP}
function StringToIOTAFile(s: string): IOTAFile;
begin
result := nil;
end;
{$ENDIF} + prototype in interface section. I guess this will prevent the plugin wizard from proper working.
SE package does not install, I get the old L1030 "compiler error" for some reason, but I don't really need them.
One minor problem left: I installed on my main dev-PC, everything works except parameters can not be written from host, always default parameters. No Automation works. I had the old version installed, but everything was removed, incl. bpl's.
So, I installed on a second PC. Everything works fine there including automation.
So where did I mess up? I really want it to work on my main dev.
/O
-
- KVRist
- 55 posts since 30 Aug, 2008
Ok, just ignore previous post about host not updating parameters. Seems like I managed to download trunk to dev PC while it was updated. After new download everything works (well, not quite, but that's due to D6. Will work on that now).
/O
/O
-
- KVRist
- 95 posts since 8 Jan, 2008 from norway
I download the new subversion files and installes the D7 package.. I can't find the file DAV_Guimodular.dcu, so I commented it out.. and I can't run the wizard, it gives me an errormessage "Error reading TSWelcome.ExplicitLeft: Property ExplicitLeft does not exist." ..
TSE Audio - Lead Developer
-
Christian Budde Christian Budde https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=25572
- KVRAF
- Topic Starter
- 1538 posts since 14 May, 2004 from Europe
Hi Sping,sping wrote:I seem to be the only one still on D6.
If anyone uses D6, this is what I did. [..]
as soon as I'm spending some more time on the package I'll make sure to add your changes.
Hi onqel,onqel wrote:I download the new subversion files and installes the D7 package.. I can't find the file DAV_Guimodular.dcu, so I commented it out.. and I can't run the wizard, it gives me an errormessage "Error reading TSWelcome.ExplicitLeft: Property ExplicitLeft does not exist." ..
I added these files recently just before I left for a vacation. I'll add them as well. Also I'll remove the Explicit* properties introduced in Delphi 10. So far you can easily open the dfm file yourself and remove the properties manually.
Kind regards,
Christian
-
- KVRist
- 55 posts since 30 Aug, 2008
D6 testing:
I have only tried VST creation so far, it works fine with D6, no problems at all. Can't find DAV_GuiModular, so I removed it from registration.
A change:
Maybe I am the only one, but one thing I missed in the GUI components was using the mouse wheel for the GUI dial, so I added that. Not much testing yet, but so far no problems.
Also the updated D6 package files, and an update to one of the samples I used for testing.
If you want to use it, files are here: http://sping.net/audio/vst/Delphi-ASIO-VST-Update.zip
/O
I have only tried VST creation so far, it works fine with D6, no problems at all. Can't find DAV_GuiModular, so I removed it from registration.
A change:
Maybe I am the only one, but one thing I missed in the GUI components was using the mouse wheel for the GUI dial, so I added that. Not much testing yet, but so far no problems.
Also the updated D6 package files, and an update to one of the samples I used for testing.
If you want to use it, files are here: http://sping.net/audio/vst/Delphi-ASIO-VST-Update.zip
/O
-
Christian Budde Christian Budde https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=25572
- KVRAF
- Topic Starter
- 1538 posts since 14 May, 2004 from Europe
Hi Sping,
I had a look at the files in the zip, but it was a bit difficult to find all changes as the SVN's DIFF can not deal properly with the format changes you did. However, I added a quite basic mouse wheel support now. It copes the fact that the later Delphi versions have mouse wheel support already (not sure about D6 and at what level it is). I did so to make it easier for the move to the LCL one day.
Kind regards,
Christian
PS: It will be available in the next check-in.
I had a look at the files in the zip, but it was a bit difficult to find all changes as the SVN's DIFF can not deal properly with the format changes you did. However, I added a quite basic mouse wheel support now. It copes the fact that the later Delphi versions have mouse wheel support already (not sure about D6 and at what level it is). I did so to make it easier for the move to the LCL one day.
Kind regards,
Christian
PS: It will be available in the next check-in.
-
- KVRist
- 55 posts since 30 Aug, 2008
Hi Christian,
Sorry about the format change, been using this style since TP1 so not easy to change. I am using the DelForEx to make it into "my" format, recommended.
I added "//sping" at the changes in the Gui for easy finding. The LightweightMultibandCompressorDM.pas changes are only some bad pointer inits I changed, should just be a replacement.
As I can see the gui dials are TControl based and they will not have wheel support in D7+, or ??? I changed them to TWinControl based and added a bit. I can add some {$IFDEF}'s if you like to enable compiler on/off. For some reason the property WheelOnHoover does not work in dll's (fine in exe's), you need to select a dial before wheel is active.
There is a simple VST I made if you like to see the wheel action in the same dir as the zip.
/Olle
Sorry about the format change, been using this style since TP1 so not easy to change. I am using the DelForEx to make it into "my" format, recommended.
I added "//sping" at the changes in the Gui for easy finding. The LightweightMultibandCompressorDM.pas changes are only some bad pointer inits I changed, should just be a replacement.
As I can see the gui dials are TControl based and they will not have wheel support in D7+, or ??? I changed them to TWinControl based and added a bit. I can add some {$IFDEF}'s if you like to enable compiler on/off. For some reason the property WheelOnHoover does not work in dll's (fine in exe's), you need to select a dial before wheel is active.
There is a simple VST I made if you like to see the wheel action in the same dir as the zip.
/Olle
-
- KVRist
- 63 posts since 22 May, 2002
Hi Christian,
Thanks for this great project.
Do you have any plans to add support for other audio interfaces like DirectSound? I think support for standard audio interfaces would be a good thing to have, especially for potential users who are not into pro-audio and don't have ASIO drivers installed on their system. Also I think most stand-alone synths feature DirectSound and MME support.
Sadly, I wouldn't know how to add this myself.
Thanks,
rola
Thanks for this great project.
Do you have any plans to add support for other audio interfaces like DirectSound? I think support for standard audio interfaces would be a good thing to have, especially for potential users who are not into pro-audio and don't have ASIO drivers installed on their system. Also I think most stand-alone synths feature DirectSound and MME support.
Sadly, I wouldn't know how to add this myself.
Thanks,
rola
