How To Write Vst Plugins
Welcome to my complete guide on how to install VST (Virtual Studio Technology) plugins.This is specifically for guitar players looking to use virtual amps and effects for tones. If you’re like me, you’ve found yourself frustrated more than once trying to install and use plugins. 'The JS code you write is effectively the interesting part of a VST, and what you end up with is effectively a VST plug‑in. For these reasons, JS is a true gateway language: once you've written a JS plug‑in, you're just a platform‑setup‑hassle away from writing a stand‑alone VST, and many JS authors go on to write stand‑alone plug.
Note
Effective November 2020:
What Is A Vst Plugin
- Common Data Service has been renamed to Microsoft Dataverse. Learn more
- Some terminology in Microsoft Dataverse has been updated. For example, entity is now table and field is now column. Learn more
This article will be updated soon to reflect the latest terminology.
The process of writing, registering, and debugging a plug-in is:
- Create a .NET Framework Class library project in Visual Studio
- Add the
Microsoft.CrmSdk.CoreAssemblies
NuGet package to the project - Implement the IPlugin interface on classes that will be registered as steps.
- Add your code to the Execute method required by the interface
- Get references to services you need
- Add your business logic
- Sign & build the assembly
- Test the assembly
- Register the assembly in a test environment
- Add your registered assembly and steps to an unmanaged solution
- Test the behavior of the assembly
- Verify expected trace logs are written
- Debug the assembly as needed
Content in this topic discusses the steps in bold above and supports the following tutorials:
Assembly constraints
When creating assemblies keep the following constraints in mind.
Use .NET Framework 4.6.2
Plug-ins and custom workflow assemblies should use .NET Framework 4.6.2. While assemblies built using later versions should generally work, if they use any features introduced after 4.6.2 an error will occur.
Optimize assembly development
The assembly should include multiple plug-in classes (or types), but can be no larger than 16 MB. It is recommended to consolidate plug-ins and workflow assemblies into a single assembly as long as the size remains below 16 MB. More information: Optimize assembly development
Assemblies must be signed
All assemblies must be signed before they can be registered. This can be done using Visual Studio Signing tab on the project or by using Sn.exe (Strong Name Tool).
Do not depend on .NET assemblies that interact with low-level Windows APIs
Plug-in assemblies must contain all the necessary logic within the respective dll. Plugins may reference some core .Net assemblies. However, we do not support dependencies on .Net assemblies that interact with low-level Windows APIs, such as the graphics design interface.
Do not depend on any other assemblies
Adding the Microsoft.CrmSdk.CoreAssemblies
NuGet package will include these assemblies in the build folder for your assembly, but you will not upload these assemblies with the assembly that includes your logic. These assemblies are already present in the sandbox runtime.
Do not include any other NuGet packages or assemblies to the build folder of your project. You cannot include these assemblies when you register the assembly with your logic. You cannot assume that the assemblies other than those included in the Microsoft.CrmSdk.CoreAssemblies
NuGet package will be present and compatible with your code.
IPlugin interface
A plug-in is a class within an assembly created using a .NET Framework Class library project using .NET Framework 4.6.2 in Visual Studio. Each class in the project that will be registered as a step must implement the IPlugin interface which requires the Execute method.
Important
When implementing IPlugin
, the class should be stateless. This is because the platform caches a class instance and re-uses it for performance reasons. A simple way of thinking about this is that you shouldn't add any properties or methods to the class and everything should be included within the Execute
method. There are some exceptions to this. For example you can have a property that represents a constant and you can have methods that represent functions that are called from the Execute
method. The important thing is that you never store any service instance or context data as a property in your class. These change with every invocation and you don't want that data to be cached and applied to subsequent invocations. More information: Develop IPlugin implementations as stateless
The Execute method accepts a single IServiceProvider parameter. The IServiceProvider
has a single method: GetService. You will use this method to get several different types of services that you can use in your code. More information: Services you can use in your code
Pass configuration data to your plug-in
When you register a plug-in you have the ability to pass configuration data to it. Configuration data allows you to define how a specific instance of a registered plug-in should behave. This information is passed as string data to parameters in the constructor of your class. There are two parameters: unsecure
and secure
.Use the first unsecure
parameter for data that you don't mind if people can see. Use the second secure
parameter for sensitive data.
The following code shows the three possible signatures for a plug-in class named SamplePlugin
.
The secure configuration data is stored in a separate entity which only system administrators have privileges to read. More information: Register plug-in step > Set configuration data
Services you can use in your code
Within your plug-in you will need to:
- Access the contextual information about what is happening in the event your plug-in was registered to handle. This is called the execution context.
- Access the Organization web service so you can write code to query data, work with entity records, use messages to perform operations.
- Write messages to the Tracing service so you can evaluate how your code is executing.
The IServiceProvider.GetService method provides you with a way to access these services as needed. To get an instance of the service you invoke the GetService
method passing the type of service.
Note
When you write a plug-in that uses Azure Service Bus integration, you will use a notification service that implements the IServiceEndpointNotificationService interface, but this will not be described here. More information: Azure Integration
Organization Service
To work with data within a plug-in you use the organization service. Do not try to use the Web API. Plug-ins are optimized to use the .NET SDK assemblies.
To gain access to a svc
variable that implements the IOrganizationService interface, use the following code:
The context.UserId
variable used with IOrganizationServiceFactory.CreateOrganizationService(Nullable<Guid>) comes from execution context the UserId property, so this is call is done after the execution context has been accessed.
More information:
You can use early bound types within a plug-in. Just include the generated types file in your project. But you should be aware that all entity types that are provided by the execution context input parameters will be late-bound types. You will need to convert them to early bound types. For example you can do the following when you know the Target
parameter represents an account entity.
But you should never try to set the value using an early bound type. Don't try to do this:
This will cause an SerializationException to occur.
Use the tracing service
Use the tracing service to write messages to the PluginTraceLog Entity so that you can review the logs to understand what occurred when the plug-in ran.
To write to the tracelog, you need to get an instance of the tracing service. The following code shows how to get an instance of the tracing service using the IServiceProvider.GetService method.
To write to the trace, use the ITracingService.Trace method.
More information: Use Tracing, Logging and tracing.
Performance considerations
When you add the business logic for your plug-in you need to be very aware of the impact they will have on overall performance.
Important
The business logic in plug-ins registered for synchronous steps should take no more than 2 seconds to complete.
Time and resource constraints
There is a 2-minute time limit for message operations to complete. There are also limitations on the amount of CPU and memory resources that can be used by extensions. If the limits are exceeded an exception is thrown and the operation will be cancelled.
If the time limit is exceeded, an TimeoutException will be thrown. If any custom extension exceeds threshold CPU, memory, or handle limits or is otherwise unresponsive, that process will be killed by the platform. At that point any current extension in that process will fail with exceptions. However, the next time that the extension is executed it will run normally.
Monitor Performance
Run-time information about plug-ins and custom workflow extensions is captured and store in the PluginTypeStatistic Entity. These records are populated within 30 minutes to one hour after the custom code executes. This entity provides the following data points:
Attribute | Description |
---|---|
AverageExecuteTimeInMilliseconds | The average execution time (in milliseconds) for the plug-in type. |
CrashContributionPercent | The plug-in type percentage contribution to crashes. |
CrashCount | Number of times the plug-in type has crashed. |
CrashPercent | Percentage of crashes for the plug-in type. |
ExecuteCount | Number of times the plug-in type has been executed. |
FailureCount | Number of times the plug-in type has failed. |
FailurePercent | Percentage of failures for the plug-in type. |
PluginTypeIdName | Unique identifier of the user who last modified the plug-in type statistic. |
TerminateCpuContributionPercent | The plug-in type percentage contribution to Worker process termination due to excessive CPU usage. |
TerminateHandlesContributionPercent | The plug-in type percentage contribution to Worker process termination due to excessive handle usage. |
TerminateMemoryContributionPercent | The plug-in type percentage contribution to Worker process termination due to excessive memory usage. |
TerminateOtherContributionPercent | The plug-in type percentage contribution to Worker process termination due to unknown reasons. |
This data is also available for you to browse using the Power Platform Admin Center. Select Analytics > Common Data Service > Plug-ins.
Next steps
Register a plug-in
Debug Plug-ins
See also
Write plug-ins to extend business processes
Best practices and guidance regarding plug-in and workflow developmentHandle exceptions
Impersonate a user
Tutorial: Write and register a plug-in
Tutorial: Debug a plug-in
Tutorial: Update a plug-in
Finding the essential VST plugins to use in your digital audio workstation is important if want to attain any success in your producing, recording and mixing.
While your DAW provides the canvas where you form your musical masterpieces, the plugins are the tools which allow your masterworks to take shape.
So in this article we’ll go over what are some of the essential types of plugins you’d need to pay attention to.
Some other helpful posts:
If you’ve been producing for at least a little while, you’ll know that it can be overwhelming to decide on the right plugins to use.
It’s like a beginner carpenter looking at an expert toolshed. There are a plethora of tools available to you, but which one to use? And for what purpose?
The music production software world is saturated with software plugins. Every week there seems to be a new plugin or plugin update that offers some new or enhanced features. It can get overwhelming, either with excitement or confusion, when deciding on what plugins to use.
Does this mean that the plugins that you find in music production online stores are unnecessary? No, but you do need to understand what VST plugins are, and also very importantly, what it is you’re trying to achieve in your music in the first place. Then you can decide on what other plugins want to use in your music making and recording.
If you start from the simple basics, you’re sure to advance according to your needs.
The Essential Plugins You Should Use
If you don’t know what plugins to choose from, quite likely you will end up wasting a lot of money and hard drive space on trying out unnecessary plugin software.
It is best to stick the basics of what you need. From the basics, you should seek to achieve sonic mastery by becoming competent in the essential tools.
When you break it down, there are only a small portion of essential VST plugins that you need to handle the necessities of recording and editing any audio.
What are the essential plugins?
All the essential plugins you need will come in just four general categories:
- Virtual Instrument Plugins – also called VSTi
- Effects Plugins – sometimes referred to as Effects processors
- Dynamics Plugins – sometimes referred to as Dynamic processors
- Emulation Plugins
Of course, we’ll need to break it down and we’ll find that these two categories consist of subcategories. So let’s take a look at those.
Virtual Instrument Plugins
VSTi’s are plugins that emulate actual musical instruments. They come in a few different types:
- Samplers
- Softsynths
- Drum Machines
What these plugins do is emulate the sounds of a real live instrument in your digital audio workstation. You can “play” these virtual instruments using a midi controller/instrument, or you can write the notes into your piano roll using your mouse.
Vst Plugin Folder
Sampler Plugins
A sampler takes samples of recorded sound and plays them back. These tend to require the largest amount of GB space in terms of size, simply because they require lots of audio files to be saved onto your system. These audio files are what will be retriggered for playback within your DAW, usually via MIDI controller.
A sample could be anything from a drum kick to a note on the piano. The high-quality ones record them at various “velocities” (soft or loud). Once you trigger a note within the VST from your MIDI controller or from your DAW’s piano roll, the sound sample will be reproduced.
Read: MIDI Controllers for Music Production
Softsynths
A soft synth takes up far less space, but will use up more CPU power.
Softsynths are software synthesizers (hence the name) that work just like your analogue synthesizers, employing various methods of audio synthesis to produce digital audio.
With a synthesizer, you can construct and create new sounds. Practically any sound you like can come from a synthesizer, you’d just have to first learn how to use the various parameters of a synth. Once you do, a whole entire world of sound design will be open up to your fingers and ears, with limitless possibilities and potential.
Drum Machines
A drum machine VSTi is just as the name suggests. It is a drum emulation software that creates looped beats and grooves. They are usually more often used in the electronic music genres, like house, but can be utilized in other styles of music as well.
The basic function of a drum machine is to create groove beats and rhythms that can be looped over and over. A good drum machine VST will give you good sounds to use, whether synthesized or sampled. It will have the ability to alter the effects of those sounds using EQ and other effects. You should also be able to create multiple loops that you can trigger to play at various points in your track.
We have just covered the first broad category of plugins. Now we will take a look at the second category, the type of plugins that don’t (usually) make any sounds of their own, but will go a long way to enhancing the sound of your virtual instruments and audio recordings.
Effects Plugins
Effects plugins are used to change or adjust the sound of the audio coming in and going out of your digital audio workstation.
How To Use A Vst
Generally speaking, but not always, effects processors work in the “time domain,” meaning, they alter the way the sound is perceived or produced within time, to produce a desired effect.
They are essential plugins to have, if you want to get any satisfactory sound from your music. Examples of these are:
- Reverbs and Delays
- Choruses
- Flangers and Phasers
Reverbs and Delays
Reverbs and Delays adds an extra tail of sound to your audio. Reverbs are called upon to add more room and space to your sound, like the sound of singing or playing in a small room or a large theater. They can be very important for vocals, giving the singer presence in the mix. In the studio context, this usually means recording them “dry” and then using either a software or hardware reverb plugin to add the desired effect of space and room.
Some reverbs, like spring reverb plugins, act simply as an effect. They work by thickening a sound and providing more presence to drums, vocals, or guitars.
Delays are also called echoes because they produce an echoing feedback effect on a sound. Similar to reverb if you want to add space to your sounds.
Choruses
Choruses double or multiplies your audio signals to make it seem as if there are multiple instruments or voices being played back. Also a good effect for adding presence when you use it right.
Most likely, the DAW that you’re using has all of these plugins already. In many DAWs like Studio One, Pro Tools, Logic Pro, Reason or Ableton, the plugins that come with the software would already be enough to use. Especially if you’re just starting out, but even after you’re an advanced DAW user, you can still rely on the plugins that come with your DAW.
Flangers and Phasers
Flangers and Phasers give audio an unusual “wah-wah” effect to your audio. These are usually effective in cutting out some frequencies and allowing the instrument to sit well in a large mix. But you can also use it for the effects they provide.
Dynamic VST Plugins
Dynamic plugins are dynamic processors that alter the amplitude of the audio signal to provide desired results. This means, the will either boost or cut parts of or whole frequency sections of an audio signal to change the way it sounds, or otherwise change the way the signal’s loudness is perceived.
Some examples of dynamic processors are:
How To Install Vst
- Equalizers (or EQ for short)
- Filters
- Compressors and Limiters
EQs and Filters
Equalizers allow you to adjust the amplitude of specific or ranges of frequencies in your audio. That means, you can make the lower end (bass) louder or softer, narrow in on certain sounds you’d rather not hear, or boost, or reduce or increase very high sounds in your audio.
These plugins are essential when mixing vocals, or any other instruments, since they carve out spaces for each audio signal to occupy in a mix. That way, one’s fighting for space to be heard. You can find here some examples of professional third party EQs for vocals. Otherwise, the ones that came with your DAW should suffice if you’re just starting out.
Also, filters, another type of plugin, work like EQs, but they allow you to “filter out” entire ranges of frequencies. This can be a useful effect when combined with software automation within the DAW.
Compressors and Limiters
Compressors and limiters are essentially the same things. They both affect the perceived loudness of audio by reducing the volume of loud sounds in your music, or amplifying the quiet sounds. Doing this “compresses” the audio signal’s dynamic range to just a small difference between loudness and softness.
Limiters do the same things, except that it reduces the volume attack (transients) much faster, giving quieter sounds and frequencies the ability to amplify more, therefore increasing the perceived loudness.
There is also another kind of compressor called the “de-esser,” which is designed specifically for those frequencies where you have that “SSS” sound. This removes sibilance from vocals and also from instruments like hi-hats, guitar and bass slides.
Emulation Plugins
Writing Vst Plugins
Because we work on digital audio files, there’s a tendency for music purely mixed on a DAW to lose that the sort of character that a great sounding mix would normally have.
In this case, you reach for an emulation plugin that, like the name says, “emulates” the sound of analog hardware studio devices.
Some of these plugins come in the form of equalizer or delay/reverb plugins that we mentioned above. But if you can use a plugin to add the sort of warmth that recording on a tape machine would provide.
Though not entirely “essential,” to some, these plugins are a must have, especially when you get into mixing and mastering music.
A similar plugin is also the harmonic exciter. While not an emulator, both these hardware and software variants provide that brilliance often necessary in a dry digital mix.
How many plugins do you need?
The best advice is to start with the very basics of each plugin type. If you keep your choices down to the bare essentials, and learn to use these plugins well to do all the things you need for your production, mixes, and recordings, you’ll have an easier time with keeping yourself from “plugin overload”.
Does this mean that every other plugin you find on the internet is going to be useless? No, maybe even the opposite, because starting with the basics, you have a solid framework of what you’d like from a plugin, and what works for you and your music.
Here’s the thing, if you don’t even know how to use a basic plugin to its full potential, you’ll get lost in all the other features that come with more advanced plugins with all its fancy bells and whistles.
Final thoughts
As you can see, these are just an essential set of VST plugins that you need to use. The plugins that were mentioned will be enough to do all that is required in your production or mix. Once you’ve mastered the basics, you can move on to other advanced third-party stuff, or experiment with using a different type.
Naturally, each plugin comes with its own style and way of doing things, so you may find that you develop your own favourites over time.
In the end, continue to have fun. You can give yourself permission to play with your own plugins, and get some new plugins to try out. But as you do so, remember to keep things simple. There’is an acronym for that, actually: KISS – Keep It Simple, Stupid.