Difference between revisions of "Creating Audio Plugins"

From MOD Wiki
Jump to navigation Jump to search
m (Crudo moved page Creating Plugins to Creating Audio Plugins without leaving a redirect)
(updated from a draft I had before)
Line 1: Line 1:
'''WARNING: This page is currently being written, please check in later!'''
+
A plugin is a software extension that adds new features to an existing application. Similarly, an audio plugin can add or enhance audio-related functionality to a device (e.g. MOD Duo). Such functionality may include digital signal processing, sound synthesis or MIDI data processing[1].
  
== What is a plugin? ==
+
== LV2 standard ==
 +
 
 +
MOD devices run [http://lv2plug.in/ LV2 plugins] internally. This means that if you want to create your own plugin for using with the MOD, you will need to build an LV2 plugin. LV2 is an open-source plugin specification designed for audio applications 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 [http://lv2plug.in/pages/why-lv2.html in this page] of the LV2 website.
 +
 
 +
Thanks to the extensibility and the bundle concept which LV2 provides we were able to create beautiful HTML/CSS interfaces for the plugins present in the MOD devices.
 +
 
 +
== Creating plugins ==
 +
 
 +
The idea of this page is not to go deep into the LV2 standard 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
 +
 
 +
Note that LV2 standard is not listed as requirement because you don't need to know it if you are using Max gen~.
 +
 
 +
There are 3 ways to create an LV2 plugin:
 +
 
 +
* Coding everything from scratch
 +
* Using a framework or high level language (e.g.: DFP, Faust)
 +
* Using visual programming software (e.g.: Max Gen~)
 +
 
 +
Regardless the option you choose it's highly recommended that you use Linux (preferable) or Mac OS for development. Not only all MOD team developers use Linux but most of the LV2 developers does as well. In other words this means that almost all documentation you will find assumes that you are using Linux and 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 (seen 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:
  
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.
+
* C/C++ language
 +
* LV2 standard
  
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 allowed 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 too!
+
To learn about the LV2 standard start reading this [blog post http://harryhaaren.blogspot.com.br/2012/06/writing-lv2-plugins-lv2-overview.html] by Harry Van Haaren.
  
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.
+
[Programming LV2 Plugins Book http://lv2plug.in/book/] from David Robillard. It aims to explain the LV2 by using examples instead of API documentation.
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.
 
  
== LV2 standard ==
+
TODO: short explanation of TTL files and links to examples and/or documentation.
  
MOD devices run [http://lv2plug.in/ LV2 plugins] internally. This means that if you want to create your own plugin for using with the MOD, you will need to build an LV2 plugin.  LV2 is an open-source plugin specification designed for audio applications. It is a powerful and extensible of writing audio code, which allows the MOD to understand the plugins when using them.
+
TODO: development environment setup (docker only?)
  
An example of why LV2 is a great format for the MOD is that the plugins describe their control ports, and the MOD uses this information to allow mapping each control port to the hardware in different ways. The reason the MOD understands the port, is because there is metadata about each port in a plugin.
+
=== Framework / High Level Language ===
  
In order to get a full understanding of LV2, a document is available, the "LV2 book": http://lv2plug.in/book
+
TODO: Juce and DPF, Examples: there are plugins done using DPF, need to find out)
 +
TODO: development environment
  
== Basic skeleton ==
 
  
(Advice from Harry - don't duplicate LV2 stuff - just link to it)
+
=== Visual Programming ===
TODO: lv2.h plugin struct, lv2_instantiate call and export symbol
 
  
== Alternative Frameworks ==
+
TODO: Max/MSP (MAX Gen~) Examples: shiro plugins
 +
TODO: Puredata (Camomile) Examples?
  
TODO: Juce and DPF. (Juce WIP)
+
TODO: development environment
TODO: Faust, Max/MSP, Puredata.
 
Also csound, lua, contact if interested.
 
  
== Setting up the turtle data ==
 
  
TODO: how hosts know what plugin has, meta-data
+
[1] https://en.wikipedia.org/wiki/Audio_plug-in
TODO: Caution, human-error, typos.
 

Revision as of 10:26, 21 August 2018

A plugin is a software extension that adds new features to an existing application. Similarly, an audio plugin can add or enhance audio-related functionality to a device (e.g. MOD Duo). Such functionality may include digital signal processing, sound synthesis or MIDI data processing[1].

LV2 standard

MOD devices run LV2 plugins internally. This means that if you want to create your own plugin for using with the MOD, you will need to build an LV2 plugin. LV2 is an open-source plugin specification designed for audio applications 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.

Thanks to the extensibility and the bundle concept which LV2 provides we were able to create beautiful HTML/CSS interfaces for the plugins present in the MOD devices.

Creating plugins

The idea of this page is not to go deep into the LV2 standard 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

Note that LV2 standard is not listed as requirement because you don't need to know it if you are using Max gen~.

There are 3 ways to create an LV2 plugin:

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

Regardless the option you choose it's highly recommended that you use Linux (preferable) or Mac OS for development. Not only all MOD team developers use Linux but most of the LV2 developers does as well. In other words this means that almost all documentation you will find assumes that you are using Linux and 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 (seen 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 standard

To learn about the LV2 standard start reading this [blog post http://harryhaaren.blogspot.com.br/2012/06/writing-lv2-plugins-lv2-overview.html] by Harry Van Haaren.

[Programming LV2 Plugins Book http://lv2plug.in/book/] from David Robillard. It aims to explain the LV2 by using examples instead of API documentation.

TODO: short explanation of TTL files and links to examples and/or documentation.

TODO: development environment setup (docker only?)

Framework / High Level Language

TODO: Juce and DPF, Examples: there are plugins done using DPF, need to find out) TODO: development environment


Visual Programming

TODO: Max/MSP (MAX Gen~) Examples: shiro plugins TODO: Puredata (Camomile) Examples?

TODO: development environment


[1] https://en.wikipedia.org/wiki/Audio_plug-in