Saturday 11 May 2013

What is a Plug-In?

In order to be able to program audio plug-ins we need to know what one is. What information is a host expecting from our plug-in? What information is our plug-in expecting from a host?

A plug-in is a dynamically loaded object. This means it can be loaded into a host application when it is needed. The plug-in will add some new features to the operation of the host application. In the audio plug-in world we add some new audio processing algorithms to a DAW (or some other piece of audio software). In order for these new features to be accessible the host needs to know how to speak to the plug-in. The plug-in also needs to know how to respond when the host asks it for something.

This is achieved through the use of an Application Programming Interface (API). In essence the API defines what our plug-in needs to tell the host in order for everything to work. Every different plug-in format (VST/AU etc.) has a different API. If we were to work with each plug-in format individually we would need to rewrite our code using each of these different APIs. When we use JUCE we can write a plug-in using JUCE's API. There are then a series of "wrappers" which take this code and make it look like it was written with one of the other APIs. As mentioned previously this allows us to write one piece of code and compile it as any plug-in format that JUCE supports.

There are several different things that our plug-in can tell the host about itself. This tutorial will not cover all of them. There are two main areas we will deal with.
  1. Information about parameters.
  2. The audio processing.

Parameters:

A parameter is any feature of our plug-in that is changeable by the user. Say we had an EQ plugin, our parameters might be frequency, Q and gain for each channel. The plug-in needs to be able to tell the host.
  • How many parameters it has.
  • What each parameter is called.
  • The current value of each parameter.
The host can also ask to set the value of a parameter. Our plug-in needs to know what to do when the host does this.

Audio Processing:

Obviously our plug-in needs to know what to do with any audio given to it by the host.

What does the plug-in look like?

One other thing we will need to consider is the plug-ins appearance. I'm sure in your experience using audio plug-ins you have come across some pretty swizzy GUIs. For now we will not deal with how to make our own custom interfaces. From the information our plug-in gives the host about its parameters the host can build its own simple interface for us. It isn't going to look pretty but it will make the programming a lot simpler for us.

Now we know what information we need to put into our plug-in code we can start planning a simple plug-in.

Have a nice day now!
Sean

No comments:

Post a Comment