Difference between revisions of "Creating Audio Plugins"

From MOD Wiki
Jump to navigation Jump to search
 
(30 intermediate revisions by 6 users not shown)
Line 1: Line 1:
'''WARNING: This page is currently being written, please check in later!'''
+
This page describes the process of creating an audio plugin for MOD.<br>
 +
The idea of this page is not to go deep into any plugin standards but to show the options you have when creating your own plugin, guide you through the appropriate documentation according the method you choose and finally show how to upload and test it on your device.
  
== What is a plugin? ==
+
Bellow are listed the topics that you might need to know in order to create audio plugins for MOD devices.
  
A plugin is an addition to an existing piece of software, to provide it with new features. For the MOD, each plugin is one effect: so each effect installed on your MOD is a "plugin". The MOD is aware of the plugins currently installed, and is able to use them to process your guitar's audio.
+
* Digital signal processing (DSP)
 +
* Programming
 +
* Basic math
  
A plugin has "ports", which allows audio or control values to be used in a plugin. Audio ports provide the audio to be processed to a plugin. Control ports allow a value set by the UI or the MOD hardware to be used in the plugin itself. Simple plugins expose a small number of control ports (often less than 3), but it is allow to have a large number of control ports. These controls are the dials that you see in the MOD interface, and the controls that you can assign the MOD hardware dials and footswitches to!
+
We assume that you know what an audio plugin is and how they might generally work. If not, see the [https://en.wikipedia.org/wiki/Audio_plug-in Wikipedia page on audio plugins].
  
Presets can be saved of the control ports. These presets can be loaded by the MOD, and are a good way to get good settings from which to start playing.
+
== Creating plugins ==
Basic plugins use only control and audio ports, but more powerful plugins can also use Atom ports for MIDI messages. This allows building synthesizers and advanced plugins that interact directly with MIDI controllers.
+
 
 +
There are 3 ways to create an audio plugin:
 +
 
 +
* Coding everything from scratch
 +
* Using a framework or high level language (e.g.: DPF, Faust, JUCE)
 +
* Using visual programming software (e.g.: MAX Gen~, PureData)
 +
 
 +
Regardless of the option you choose it's highly recommended that you use Linux or macOS for development.<br>
 +
Not only all MOD team developers use Linux but most of the LV2 developers do as well.<br>
 +
In other words this means that almost all documentation you will find assumes that you are using Linux so in the case you need to ask for support it'll be much easier.
 +
 
 +
=== From scratch ===
 +
 
 +
The first option, coding everything from scratch, is the hardest one if you are new to programming.<br>
 +
Here we will need to know C or C++ to code the plugins and also read the LV2 documentation and examples.<br>
 +
Although the learning curve is steep (seeing that you'll need to learn programming first) that's a good choice if you want full control of what you're doing and probably it's the best choice to write well performing plugins.
 +
 
 +
What to learn:
 +
 
 +
* C/C++ language
 +
* LV2 plugin standard
 +
 
 +
LV2 is described in more detail a bit below on this same page.<br>
 +
Also see our dedicated [[LV2]] page for more information on how the LV2 plugin standard is integrated in MOD.
 +
 
 +
=== Framework / High Level Language ===
 +
 
 +
The second option works best if you prefer to use more high-level stuff for programming instead of going into details of a plugin standard.<br>
 +
This means instead of needing to understand very specific concepts of LV2 (that do not always translate well to other plugin standards) you code your plugin in a more generic way.<br>
 +
You trade off special features (like multiple MIDI inputs) for an easier initial learning curve.<br>
 +
As a bonus, many of these frameworks also support/export more than LV2 so you will be getting additional VST2/3 compatibility for free.
 +
 
 +
TODO for falkTX: JUCE dedicated page (rough start)
 +
 
 +
TODO for falkTX: DPF dedicated page (rough start)
 +
 
 +
=== Visual Programming ===
 +
 
 +
If you do not want to do any coding but still want to make your own plugins, a visual programming interface is an option.<br>
 +
This typically consists of an application providing a modular environment to connect different blocks together, and exporting such projects into existing "template plugins" that generate a real plugin based on this exported data.
 +
 
 +
The most commonly used at the moment is [[Max_gen~|MAX Gen~]].<br>
 +
'''SHIRO''' and '''WOV''' are examples of plugins created on this environment, with only the GUI made externally.
 +
 
 +
Other solutions exist, but they are still work in progress and have not been integrated yet.<br>
 +
Look around in [https://forum.moddevices.com/ the forums] to get an idea of their current state.
  
 
== LV2 standard ==
 
== LV2 standard ==
  
TODO: explain ports, extensions, host-side presets, static ttl
+
MOD devices run [http://lv2plug.in/ LV2 plugins] internally.<br>
 +
This means that if you want to create your own plugin from scratch to work with a MOD unit, you will need to build an LV2 plugin.<br>
 +
LV2 is an open-source, liberally-licensed audio plugin specification designed which is powerful and extensible.
 +
 
 +
There are many good reasons why LV2 is the best choice as the audio plugin standard for the MOD devices.<br>
 +
Most of them gracefully explained [http://lv2plug.in/pages/why-lv2.html in this page] of the LV2 website.
  
== Basic skeleton ==
+
TODO for Mark: create page describing simple LV2 concepts
  
TODO: (Advice from Harry - don't duplicate LV2 stuff - just link to it) lv2.h plugin struct, lv2_instantiate call and export symbol
+
See our [[LV2]] page for more information on how LV2 is integrated in MOD.
  
== Alternative Frameworks ==
+
=== External references ===
  
TODO: Juce and DPF. (Juce WIP)
+
There are plenty of documentation and guides on how to create LV2 plugins in the web.
  
== Alternative Methods ==
+
The [https://github.com/lv2/lv2/wiki LV2 wiki] has lots of useful links and references that can help you in the process of creating a LV2 plugin.
 +
We highly recommend you to have a look.
  
TODO: Faust, Max/MSP, Puredata.
+
Harry Van Haaren (from OpenAV ArtyFX suite) has a [http://harryhaaren.blogspot.com.br/2012/06/writing-lv2-plugins-lv2-overview.html blog post] about creating LV2 plugins.
Also csound, lua, contact if interested.
 
  
== Setting up the turtle data ==
+
Sven Jaehnichen (from B* plugin suite) has a [https://github.com/sjaehn/lv2tutorial series of tutorial videos] for programming LV2 plugins from scratch.
  
TODO: how hosts know what plugin has, meta-data
+
The [http://lv2plug.in/book/ Programming LV2 Plugins Book] has a detailed walk-through on the plugin examples contained within the LV2 source.
TODO: Caution, human-error, typos.
 
  
== LV2 book ==
+
== Development Environment ==
  
link
+
TODO for falkTX and Mark: brief overview of the setup

Latest revision as of 09:56, 25 October 2021

This page describes the process of creating an audio plugin for MOD.
The idea of this page is not to go deep into any plugin standards but to show the options you have when creating your own plugin, guide you through the appropriate documentation according the method you choose and finally show how to upload and test it on your device.

Bellow are listed the topics that you might need to know in order to create audio plugins for MOD devices.

  • Digital signal processing (DSP)
  • Programming
  • Basic math

We assume that you know what an audio plugin is and how they might generally work. If not, see the Wikipedia page on audio plugins.

Creating plugins

There are 3 ways to create an audio plugin:

  • Coding everything from scratch
  • Using a framework or high level language (e.g.: DPF, Faust, JUCE)
  • Using visual programming software (e.g.: MAX Gen~, PureData)

Regardless of the option you choose it's highly recommended that you use Linux or macOS for development.
Not only all MOD team developers use Linux but most of the LV2 developers do as well.
In other words this means that almost all documentation you will find assumes that you are using Linux so in the case you need to ask for support it'll be much easier.

From scratch

The first option, coding everything from scratch, is the hardest one if you are new to programming.
Here we will need to know C or C++ to code the plugins and also read the LV2 documentation and examples.
Although the learning curve is steep (seeing that you'll need to learn programming first) that's a good choice if you want full control of what you're doing and probably it's the best choice to write well performing plugins.

What to learn:

  • C/C++ language
  • LV2 plugin standard

LV2 is described in more detail a bit below on this same page.
Also see our dedicated LV2 page for more information on how the LV2 plugin standard is integrated in MOD.

Framework / High Level Language

The second option works best if you prefer to use more high-level stuff for programming instead of going into details of a plugin standard.
This means instead of needing to understand very specific concepts of LV2 (that do not always translate well to other plugin standards) you code your plugin in a more generic way.
You trade off special features (like multiple MIDI inputs) for an easier initial learning curve.
As a bonus, many of these frameworks also support/export more than LV2 so you will be getting additional VST2/3 compatibility for free.

TODO for falkTX: JUCE dedicated page (rough start)

TODO for falkTX: DPF dedicated page (rough start)

Visual Programming

If you do not want to do any coding but still want to make your own plugins, a visual programming interface is an option.
This typically consists of an application providing a modular environment to connect different blocks together, and exporting such projects into existing "template plugins" that generate a real plugin based on this exported data.

The most commonly used at the moment is MAX Gen~.
SHIRO and WOV are examples of plugins created on this environment, with only the GUI made externally.

Other solutions exist, but they are still work in progress and have not been integrated yet.
Look around in the forums to get an idea of their current state.

LV2 standard

MOD devices run LV2 plugins internally.
This means that if you want to create your own plugin from scratch to work with a MOD unit, you will need to build an LV2 plugin.
LV2 is an open-source, liberally-licensed audio plugin specification designed which is powerful and extensible.

There are many good reasons why LV2 is the best choice as the audio plugin standard for the MOD devices.
Most of them gracefully explained in this page of the LV2 website.

TODO for Mark: create page describing simple LV2 concepts

See our LV2 page for more information on how LV2 is integrated in MOD.

External references

There are plenty of documentation and guides on how to create LV2 plugins in the web.

The LV2 wiki has lots of useful links and references that can help you in the process of creating a LV2 plugin. We highly recommend you to have a look.

Harry Van Haaren (from OpenAV ArtyFX suite) has a blog post about creating LV2 plugins.

Sven Jaehnichen (from B* plugin suite) has a series of tutorial videos for programming LV2 plugins from scratch.

The Programming LV2 Plugins Book has a detailed walk-through on the plugin examples contained within the LV2 source.

Development Environment

TODO for falkTX and Mark: brief overview of the setup