Creating Audio Plugins

From MOD Wiki
Jump to: navigation, search

WARNING: This page is currently being written, please check in later!

What is a plugin?

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.

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!

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. 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

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. It is a powerful and extensible of writing audio code, which allows the MOD to understand the plugins when using them.

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.

In order to get a full understanding of LV2, a document is available, the "LV2 book": http://lv2plug.in/book

Basic skeleton

(Advice from Harry - don't duplicate LV2 stuff - just link to it) TODO: lv2.h plugin struct, lv2_instantiate call and export symbol

Alternative Frameworks

TODO: Juce and DPF. (Juce WIP) 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 TODO: Caution, human-error, typos.