VST SDK plugin example
Re: VST SDK plugin example
I suppose the 32 bit version is probably not ready to be used, as I tried the plugin_x86.dll in different DAW's and nothing is shown. Only in Ableton I get a little black square surface with a name analyse.
So I still don't know what the vst should do. I only have 64 bit for osx and ubuntu, but the vst is not ment for those.
So I still don't know what the vst should do. I only have 64 bit for osx and ubuntu, but the vst is not ment for those.
Yeah I know, but keep in mind ... Leonardo da Vinci was also an autodidact.
Re: VST SDK plugin example
The example implements only the bare bones of a VST.Joris wrote:I suppose the 32 bit version is probably not ready to be used, as I tried the plugin_x86.dll in different DAW's and nothing is shown. Only in Ableton I get a little black square surface with a name analyse.
So I still don't know what the vst should do. I only have 64 bit for osx and ubuntu, but the vst is not ment for those.
A VST can have an editor, but it is not necessary.
Things like effEditOpen/effEditClose/effEditGetRect/effEditIdle are not yet implemented.
Re: VST SDK plugin example
And (no offence intended) I think that was the reason that put me off... ASM I'm fine with 6502 (I did a little 8086 code in dos, but thats all ). Maybe I'll revisit that topic...sq4 wrote:If you search for Asio you'll find an older topic of mine under my previous member name "eriansa".oreopa wrote: How about simple ASIO vst host next? :DDD (Just kidding about that one Or...? )
I remember I had to write assembler for the x86 version due to calling conventions. Pure coding hell...
And that is what is quite cool about this example. You don't have to install a byte of Steinberg SDK to make VST - I didn't know this . It even has a place holder for DSP experiments with the volume calculation (I guess we do ALL THE DSP at this point, and break into procedures if needed?).sq4 wrote:The example implements only the bare bones of a VST.Joris wrote:I suppose the 32 bit version is probably not ready to be used, as I tried the plugin_x86.dll in different DAW's and nothing is shown. Only in Ableton I get a little black square surface with a name analyse.
So I still don't know what the vst should do. I only have 64 bit for osx and ubuntu, but the vst is not ment for those.
A VST can have an editor, but it is not necessary.
Things like effEditOpen/effEditClose/effEditGetRect/effEditIdle are not yet implemented.
What I need to find out next is how to query the sample rate and block size so as to make some smooth constant waveforms without breaks/glitches between blocks... Any hints?
Proud supporter of PB! * Musician * C64/6502 Freak
Re: VST SDK plugin example
The host calls the plugin dispatcher with following opcodes :oreopa wrote: What I need to find out next is how to query the sample rate and block size so as to make some smooth constant waveforms without breaks/glitches between blocks... Any hints?
effSetSampleRate and effSetBlockSize or even with effSetBlockSizeAndSampleRate.
Every host will do it on initialization, but the order can be different per host...
They can also be called on other events, p.e. when the blocksize/samplerate has been changed in the host.
Anyway, when you get those opcodes in your dispatcher, you must rebuild your waveforms.
Re: VST SDK plugin example
You don't need the Steinberg SDK at all. Just some knowledge of C in order to rewrite it in PB.oreopa wrote: And that is what is quite cool about this example. You don't have to install a byte of Steinberg SDK to make VST - I didn't know this . It even has a place holder for DSP experiments with the volume calculation (I guess we do ALL THE DSP at this point, and break into procedures if needed?).
TBH the VST2.x SDK if quite simple and straightforward.
The VST3 SDK is quite the opposite...
Anyway, to be sure, I did ask and got a license from Steinberg in order to publish VST 2.x plugins.
-
- User
- Posts: 59
- Joined: Mon Dec 24, 2012 9:07 am
- Location: Germany, Munich
Re: VST SDK plugin example
In first post i add link to AEffect.pbi and AEffectX.pbi and example.
More examples with GUI i add later.
I have problems on my work and i don’t have free time to practice VST on PureBasic.
Happy coding!!!
oreopa
see this:
in DispatcherProc
in basic code:
More examples with GUI i add later.
I have problems on my work and i don’t have free time to practice VST on PureBasic.
Happy coding!!!
oreopa
see this:
in DispatcherProc
Code: Select all
case effSetSampleRate
setSampleRate(opt)
case effSetBlockSize
setBlockSize(value)
Code: Select all
global samplerate
global blocksize
procedure setSampleRate(opt.f)
samplerate = opt
endprocedure
procedure setBlockSize(value.i)
blocksize = value
endprocedure
Sory my bad english
Re: VST SDK plugin example
I did not notice, this is great! Thanks.Aleks_Longard wrote:In first post i add link to AEffect.pbi and AEffectX.pbi and example.
Perfect... I see now...Aleks_Longard wrote: oreopa
see this[...]
You have kindly provided a very good start for further experiments. I really am grateful. Thank you. Good luck with work!Aleks_Longard wrote: I have problems on my work and i don’t have free time to practice VST on PureBasic.
All the best.
Proud supporter of PB! * Musician * C64/6502 Freak
Re: VST SDK plugin example
Perfect explanation. Im just not getting the full mechanics of the VST flow... It's seems the host is handling all the things like when to fill the next buffer/block in time for gapless playback... Thats what ProcessReplacing is for, right? (I know its recommended to implement ProcessReplacingDouble also, but we can skip that fact for now....)... Actually I see: ProcessReplacingProc(*ap.AEffect, *inputs, *outputs, sampleframes.l)... "sampleframes" is the amount of sample frames to fill till the VST mech calls ProcessReplacing again, right? Duh... I missed thatsq4 wrote:The host calls the plugin dispatcher with following opcodes :oreopa wrote: What I need to find out next is how to query the sample rate and block size so as to make some smooth constant waveforms without breaks/glitches between blocks... Any hints?
effSetSampleRate and effSetBlockSize or even with effSetBlockSizeAndSampleRate.
Every host will do it on initialization, but the order can be different per host...
They can also be called on other events, p.e. when the blocksize/samplerate has been changed in the host.
Anyway, when you get those opcodes in your dispatcher, you must rebuild your waveforms.
Thanx for help.
Proud supporter of PB! * Musician * C64/6502 Freak
-
- User
- Posts: 59
- Joined: Mon Dec 24, 2012 9:07 am
- Location: Germany, Munich
Re: VST SDK plugin example
Oreopa
Thanks! Happy experements!
I update link and all include files.
Thanks! Happy experements!
I update link and all include files.
Sory my bad english
Re: VST SDK plugin example
@Aleks_Longard
You do a "Freestructure(*AEffect)" on effClose.
In a well defined SDK one would assume that this is correct, but it isn't.
Some hosts will call effOpen/effClose and then again effOpen (see p.e. on a VST scan).
This will lead to an IMA.
You should also implement "ProcedureCDLL main(*callback)" for older hosts.
Let "ProcedureCDLL VstPluginMain()" call "main()".
You do a "Freestructure(*AEffect)" on effClose.
In a well defined SDK one would assume that this is correct, but it isn't.
Some hosts will call effOpen/effClose and then again effOpen (see p.e. on a VST scan).
This will lead to an IMA.
You should also implement "ProcedureCDLL main(*callback)" for older hosts.
Let "ProcedureCDLL VstPluginMain()" call "main()".
-
- User
- Posts: 59
- Joined: Mon Dec 24, 2012 9:07 am
- Location: Germany, Munich
Re: VST SDK plugin example
Hello Sq4,
I wrote an example of a plugin for my interest.
And i do not plan to write plugins on PB in the future.
If anyone is interested in this thing, I will be glad that my sdk translation will be useful to anyone.
I shared the example of a plugin for people to see what is possible to write on PB without an OOP style, only I wrote and will write in C++, since they use this language in my work and I work with VST developer who writes only in C++.
I wrote an example of a plugin for my interest.
And i do not plan to write plugins on PB in the future.
If anyone is interested in this thing, I will be glad that my sdk translation will be useful to anyone.
I shared the example of a plugin for people to see what is possible to write on PB without an OOP style, only I wrote and will write in C++, since they use this language in my work and I work with VST developer who writes only in C++.
Sory my bad english
Re: VST SDK plugin example
Is it possible to get a handle from a purebasic native canvasgadget (maybe canvasgadget in borderless window?) to use as the GUI for a plugin? And furthermore can we then just use the mouse input handling of the canvasgadget to make the complete gui?
I guess its could be a problem eventually with GUI + DSP and only one thread, but I'm trying to ignore this for now
If I could use a canvasgadget, I think that would be ideal for the gui part.
I guess its could be a problem eventually with GUI + DSP and only one thread, but I'm trying to ignore this for now
If I could use a canvasgadget, I think that would be ideal for the gui part.
Proud supporter of PB! * Musician * C64/6502 Freak
-
- User
- Posts: 59
- Joined: Mon Dec 24, 2012 9:07 am
- Location: Germany, Munich
Re: VST SDK plugin example
Hello Oreopa,
i'm already slowly writing an example with a GUI using canvasgadget, another option I thought of.
Cheers!
i'm already slowly writing an example with a GUI using canvasgadget, another option I thought of.
Cheers!
Sory my bad english
Re: VST SDK plugin example
Very nice... I really look forwards to it... Just one simple on off switch would be a perfect start.Aleks_Longard wrote:Hello Oreopa,
i'm already slowly writing an example with a GUI using canvasgadget, another option I thought of.
Cheers!
I know VST spec allows for gui/input stuff, but to use PB native stuff where possible would be better! (I do not mind doing all the redraw/input logic/gui stuff by hand... i masochistically love that part also).
I tried some things already on effOpen and making hasEditor = 1... using handle of a windowed canvas gadget... but i guess its more complex than that...
I find this VST fun stuff a LOT of fun at the moment. It's long been my dream to start making my own vst effects, synths and also MIDI manipulators/sequencing/arp plugs... I'm a musician, and VST never works perfectly to my own satisfaction... Theres a lot to learn, but doing it in PB is a pleasure with your translations. Again, thanx.
Report back soon
Proud supporter of PB! * Musician * C64/6502 Freak
Re: VST SDK plugin example
I could not agree, more.oreopa wrote:Aleks_Longard wrote:... VST never works perfectly to my own satisfaction...
Best wishes to the PB community. Thank you for the memories.