Vst Plugin Agp

/ Comments off
Page 1 of 3
[ 44 posts ] Go to page1, 2, 3Next
  1. Vst Plugin Guitar Preamp
  2. Vst Plugin Guitar Rig
  3. Vst Plugin Companies
Print viewPrevious topic Next topic
AuthorMessage
Posted: Tue Apr 16, 2019 8:22 am
User

Joined: Mon Dec 24, 2012 9:07 am
Posts: 41
Location: Ukraine, Donetck
Hello all!
I wrote a small example that works on Windows x86 / x64. I only tested at Cockos Reaper, in other DAWs it should work just as well.
Thanks a lot for helping Infratec and fixing my a few bugs with pointers.
There all translated basic include files and example VST plugin (no GUI).
https://www.dropbox.com/sh/j0vun0sg751f .. drVEa?dl=0
update link:
29.12.2019 vst window test.
EnableExplicit
Global channels.l = 2
Global paramvolume.f = 1.0
PrototypeC.i DispatcherProc(*effect, opcode.l, index.l, Value.i, *ptr, opt.f)
PrototypeC ProcessProc(*effect, *inputs.Float, *outputs.Float, sampleframes.l)
PrototypeC SetParameterProc(*effect, index.l, parameter.f)
PrototypeC.f GetParameterProc(*effect, index.l)
PrototypeC ProcessReplacingProc(*effect, *inputs.Float, *outputs.Float, sampleframes.l)
PrototypeC ProcessDoubleReplacingProc(*effect, *inputs.Double, *outputs.Double, sampleframes.l)
Structure AEffect Align #PB_Structure_AlignC
magic.l
dispatcher.DispatcherProc
process.ProcessProc
setParameter.SetParameterProc
getParameter.GetParameterProc
numPrograms.l
numParams.l
numInputs.l
numOutputs.l
flags.l
*resvd1
*resvd2
initialDelay.l
realQualities.l
offQualities.l
ioRatio.f
*Object
*user
uniqueID.l
version.l
processReplacing.ProcessReplacingProc
processDoubleReplacing.ProcessDoubleReplacingProc
Array future.b(56)
EndStructure
; constants
#kEffectMagic = $56737450
#effFlagsCanReplacing = 16
#kPlugCategEffect = 1
#kPlugCategSynth = 2
#kPlugCategAnalysis = 3
; AEffect constants
#effClose = 1
#effGetParamLabel = 6
#effGetParamDisplay = 7
#effGetParamName = 8
#effSetSampleRate = 10
#effSetBlockSize = 11;
#effGetPlugCategory = 35
#effGetEffectName = 45
#effGetVendorString = 47
#effGetProductString = 48
#effGetVendorVersion = 49
; string sizes
#kVstMaxParamStrLen = 8
#kVstMaxVendorStrLen = 64
#kVstMaxProductStrLen = 64
#kVstMaxEffectNameLen = 32
; other procedures
Procedure getParameterName(index.l, *text)
Select index
Case 0
PokeS(*text, 'Volume', #kVstMaxParamStrLen, #PB_Ascii)
EndSelect
EndProcedure
Procedure getParameterDisplay(index.l, *text)
Select index
Case 0
PokeS(*text, StrF(paramvolume, 4), 4, #PB_Ascii)
EndSelect
EndProcedure
; procedures for VST sdk
ProcedureC.i DispatcherProc(*d.AEffect, opcode.l, index.l, Value.i, *ptr, opt.f)
Protected result.i
Select opcode
Case #effClose
FreeStructure(*d)
Case #effGetParamDisplay
getParameterDisplay(index, *ptr)
Case #effGetParamName
getParameterName(index, *ptr)
Case #effGetPlugCategory
result = #kPlugCategEffect #kPlugCategAnalysis
Case #effGetEffectName
PokeS(*ptr, 'test plugin', #kVstMaxEffectNameLen, #PB_Ascii)
Case #effGetVendorString
PokeS(*ptr, 'Alex Longard', #kVstMaxVendorStrLen, #PB_Ascii)
Default
EndSelect
ProcedureReturn result
EndProcedure
ProcedureC ProcessReplacingProc(*ap.AEffect, *inputs, *outputs, sampleframes.l)
Protected *In1, *In2, *Out1, *Out2, i.l
*In1 = PeekI(*inputs)
*Out1 = PeekI(*outputs)
If channels = 2
*In2 = PeekI(*inputs + SizeOf(integer))
*Out2 = PeekI(*outputs + SizeOf(integer))
EndIf
For i = 0 To sampleframes - 1
PokeF(*Out1 + i * SizeOf(float), PeekF(*In1 + i * SizeOf(float)) * paramvolume)
If channels = 2
PokeF(*Out2 + i * SizeOf(float), PeekF(*In2 + i * SizeOf(float)) * paramvolume)
EndIf
Next i
EndProcedure
ProcedureC ProcessDoubleReplacingProc(*ap.AEffect, *inputs, *outputs, sampleframes.l)
EndProcedure
ProcedureC SetParameterProc(*asp.AEffect, index.l, value.f)
paramvolume = value
EndProcedure
ProcedureC.f GetParameterProc(*agp.AEffect, index.l)
ProcedureReturn paramvolume
EndProcedure
ProcedureCDLL VSTPluginMain(*audioMaster)
Protected *Aef.AEffect = AllocateStructure(AEffect)
*aefmagic = #kEffectMagic
*aefdispatcher = @DispatcherProc()
*aefsetParameter = @SetParameterProc()
*aefgetParameter = @GetParameterProc()
*aefnumParams = 1
*aefnumInputs = channels
*aefnumOutputs = channels
*aefflags = #effFlagsCanReplacing
*aefprocessReplacing = @ProcessReplacingProc()
; *aefprocessDoubleReplacing = @ProcessDoubleReplacingProc()
*aefuniqueID = 02081987
*aefversion = 1
*aefObject = 0
ProcedureReturn *aef
EndProcedure

_________________
Sory my bad english

Last edited by Aleks_Longard on Sun Dec 29, 2019 9:41 am, edited 3 times in total.

Top

Berkeley Electronic Press Selected Works.

AGP-Ext by Ample Sound is a Virtual Instrument Audio Plugin for macOS and Windows. /prophet-08-vst-free.html. It functions as a VST Plugin, an Audio Units Plugin, an RTAS Plugin and an AAX Plugin. A VST plugin is a software-based audio effect or a virtual instrument intended for use in a host program that supports Virtual Studio Technology. Most digital audio workstations nowadays can load VST and VST3 plugins. Vst plugin old radio. AGPF by Ample Sound is a Virtual Instrument Audio Plugin and a Standalone Application for macOS and Windows. It functions as a VST Plugin, an Audio Units Plugin, a VST 3 Plugin, an AAX Plugin and a Standalone Application. Type of plugin: VSTi. What it does: This virtual analog synth was inspired by the Clavia Nord. I wrote a small example that works on Windows x86 / x64. I only tested at Cockos Reaper, in other DAWs it should work just as well. Thanks a lot for helping Infratec and fixing my a few bugs with pointers.

Posted: Tue Apr 16, 2019 9:52 am
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 14181
Location: France


Top
Post subject: Re: VST SDK plugin example
User

Joined: Wed Feb 26, 2014 3:16 pm
Posts: 80
@Aleks_Longard.
Hi, I've been doing this stuff for over 10 years now in PureBasic.
If you have any questions, don't hesitate to ask!
I'm glad I am not the only one anymore.
You can see my plugins here :
http://www.raxntrax.com
Beware though, there's a bug in the threadsave library of PureBasic.
So if you want to make stable plugins don't use threadsafety, you'll need to protect all your lists/maps/strings all by your own code.
It's an old bug that appears on closing the plugin only in some hosts (cantabile/tracktion/mulab/flstudio).
You'll get an access violation. Probably a threadsave ressource not cleaned up properly.
It has been mentioned a couple of times here on the forum, but still there seems to be no solution..
Success!
Eric


Top
Posted: Tue Apr 16, 2019 11:38 am
User

Joined: Mon Dec 24, 2012 9:07 am
Posts: 41
Location: Ukraine, Donetck
Hello Fred, thank you!!!
Hello Sq4, thanks, i am C++ developer and write some plugins with VST SDK and Reaper SDK on C++.
I very love Purebasic, and only recently I had time to rewrite some my old codes on Purebasic, since in C++ I don’t like some things related to classes and silly wrappers for simple functions.
Cheers!

_________________
Sory my bad english


Top
Posted: Tue Apr 16, 2019 11:44 am
Enthusiast

Joined: Fri Oct 16, 2009 10:12 am
Posts: 724
Location: BE
..
If anyone is interested in this, I can translate the full VST SDK.

I'm realy interested in this !
This might give me a new start on some of my own smaller midi-projects.
I always found these VST-C sources to difficult to my knowledge,
so I realy hope you will continu your work.
Yet, some more info on 'how to use this' would help.
(DAW's and VST-host's I use here, are Logic on OSX and still one on XP too, Cantabile, LMMS).
Thanks and keep up the good work.

_________________
Yeah I know, but keep in mind .. Leonardo da Vinci was also an autodidact.


Top
Posted: Tue Apr 16, 2019 11:59 am
User

Joined: Mon Dec 24, 2012 9:07 am
Posts: 41
Location: Ukraine, Donetck
Hello Joris,
I can't try this in Logic, since I don't have a Mac os, and vst plug's for Mac is different from Windows plugins.
I will try to find information for vst on a Mac, as long as I can translate all includes 'aeffect.h, aeffectx.h' which are essential for plugins for Windows DAWs.
Cheers!

_________________
Sory my bad english


Top
Posted: Tue Apr 16, 2019 5:44 pm
Enthusiast

Joined: Sat Jun 24, 2006 3:29 am
Posts: 264
Location: Edinburgh, Scotland.
Really great stuff Aleks. PLEASE continue
Compiled and loaded in daw (REAPER also) as vst dll without problems. It's a really nice basic starting framework.
How about simple ASIO vst host next? DD (Just kidding about that one Or..? )
Thank you very much for this.
sq4: Your music software stuff has always highly impressed me. Very good work mate.

_________________
Proud supporter of PB! * Musician * C64/6502 Freak


Top
Posted: Tue Apr 16, 2019 6:59 pm
User

Joined: Wed Feb 26, 2014 3:16 pm
Posts: 80
How about simple ASIO vst host next? DD (Just kidding about that one Or..? )

If you search for Asio you'll find an older topic of mine under my previous member name 'eriansa'.
I remember I had to write assembler for the x86 version due to calling conventions. Pure coding hell..
Btw thanks for your nice comment on my plugins.


Top
Posted: Wed Apr 17, 2019 7:27 am
User

Joined: Mon Dec 24, 2012 9:07 am
Posts: 41
Location: Ukraine, Donetck
Oreopa
I not see problem trying to write Asio / VST host
AudioMasterCallback it's same as AEffectDispatcherProc function.
I will translate sdk and try to write something.
I already wrote a simple host on pure C to test my ideas for VST and Reaper))))
Cheers!

_________________
Sory my bad english


Top

Vst Plugin Guitar Preamp

Posted: Wed Apr 17, 2019 8:17 am
Enthusiast

Joined: Fri Oct 16, 2009 10:12 am
Posts: 724
Location: BE
@Aleks_Longard
I also have a pc with XP still, but how do I have to use your code on that, isn't clear ?
If I run it nothing happens or appears ?
Somewhere the source looks like a DLL, so then it would be VST itself not a VST-host..
Sorry, for my stupidity about this.

_________________
Yeah I know, but keep in mind .. Leonardo da Vinci was also an autodidact.


Top
Posted: Wed Apr 17, 2019 9:16 am
User

Joined: Mon Dec 24, 2012 9:07 am
Posts: 41
Location: Ukraine, Donetck
Hello Joris!
See this:
https://www.dropbox.com/sh/j0vun0sg751f .. drVEa?dl=0
I compile dll for x64 and x86 Windows.
And example.pb in folder.
I while not have time for write vsthost and some examples.

_________________
Sory my bad english


Top
Vst plugin guitar rig
Posted: Wed Apr 17, 2019 11:13 am
Enthusiast

Joined: Fri Oct 16, 2009 10:12 am
Posts: 724
Location: BE
@Aleks_Longard,
I can open it here in Cantabile Lite (a VST host) and LMMS (a DAW).
In Cantabile I get some volume-controller shown, LMMS loads the VST but nothing is shown.
Logic (on XP) didn't work, yet I must retry as I might have done something wrong there.
Thanks

_________________
Yeah I know, but keep in mind .. Leonardo da Vinci was also an autodidact.


Top
Posted: Wed Apr 17, 2019 11:29 am
User

Joined: Mon Dec 24, 2012 9:07 am
Posts: 41
Location: Ukraine, Donetck
Joris,
this example not have GUI, volume slider accessible as automatable control.
In Reaper DAW this shows in alternative GUI, which make Reaper for nongui plugins.
I can not have others DAWs for testing.

_________________
Sory my bad english


Top

Vst Plugin Guitar Rig

Posted: Thu Apr 18, 2019 8:30 am
Enthusiast

Joined: Fri Oct 16, 2009 10:12 am
Posts: 724
Location: BE
I can not have others DAWs for testing.
Ok.
If you need some testings .. I have 4 DAW's available.
(LMMS is a free one and opensource.)

_________________
Yeah I know, but keep in mind .. Leonardo da Vinci was also an autodidact.


Top
Posted: Thu Apr 18, 2019 10:13 am
Enthusiast

Joined: Sun Jun 11, 2006 12:07 am
Posts: 587
Location: Near Hamburg
in adobe audition the x64 plugin example works great.
maybe in future i will dive into this vst stuff. it sounds amazing to write a vst plugin in purebasic.
Sent via mobile phone

_________________
PB 5.73 x64, OS: Windows 7 Pro x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age: 52y
'Happiness is a pet.' 'Never run a changing system!'


Top
Page 1 of 3
[ 44 posts ] Go to page1, 2, 3Next

Vst Plugin Companies

  • Products
    • Acoustic GuitarAmple Guitar SJ IIIAmple Guitar Twelve IIIAmple Guitar L IIIAmple Guitar T IIIAmple Guitar M IIIAmple ChinaAmple China ZhengAmple China Pipa IIEthno SeriesAmple Ethno Ukulele IIIElectric GuitarAmple Guitar Vintage CherryAmple Guitar Semi HollowAmple Guitar TCAmple Guitar Peregrine FalconAmple Guitar SCAmple Guitar LP
    • Metal SeriesAmple Metal HellrazerAmple Metal EclipseAmple Metal Ray5Acoustic BassAmple Bass Upright IIIAmple Bass Acoustic IIIElectric BassAmple Bass Jaco Fretless IIIAmple Bass Yinyang IIIAmple Bass J IIIAmple Bass P IIIFree SoftwareAmple Percussion CloudrumAmple Guitar M Lite IIAmple Bass P Lite II
  • Purchase
    • PurchasePurchase ProductsRedeem Products
  • Support
    • SupportNewsReviewFacebookForumAbout UsManualEULA
    • ManualInstallation and ActivationiLok Installation and ActivationFX ManualSettings and CPC ManualSample Editor ManualBass ManualAmple Bass JF ManualAmple Bass P ManualAmple Bass J ManualAmple Bass Yinyang ManualAmple Metal Ray5 ManualAmple Bass Upright ManualAmple Bass Acoustic ManualBass Amp ManualBass Riffer ManualBass Tab Reader ManualTutorial VideosReverend Tutorial VideosHow to Play Ample Guitar on KeyboardProtools Expert Video
    • Guitar ManualAmple Guitar VC ManualAmple Metal Hellrazer ManualAmple Guitar SC ManualAmple Guitar LP ManualAmple Guitar PF ManualAmple Guitar TC ManualAmple Guitar SH ManualAmple Metal Eclipse ManualAmple Guitar SJ ManualAmple Guitar M ManualAmple Guitar T ManualAmple Guitar L ManualAmple Guitar Twelve ManualGuitar AMP ManualGuitar Riffer ManualGuitar Strummer ManualGuitar Tab Reader ManualOther ManualsAmple China Zheng ManualAmple China Pipa ManualAmple Ethno Ukulele ManualAmple Percussion Manual