Convert Figma logo to code with AI

iPlug2 logoiPlug2

C++ Audio Plug-in Framework for desktop, mobile and web

2,098
309
2,098
204

Top Related Projects

1,788

VST 3 Plug-In SDK

7,344

JUCE is an open-source cross-platform C++ application framework for desktop and mobile applications, including VST, VST3, AU, AUv3, LV2 and AAX audio plug-ins.

3,402

Synthesizer plug-in (previously released as Vember Audio Surge)

C library for cross-platform real-time audio input and output

1,117

The Synthesis ToolKit in C++ (STK) is a set of open source audio signal processing and algorithmic synthesis classes written in the C++ programming language.

Quick Overview

iPlug 2 is a cross-platform C++ audio plug-in framework that simplifies the development of audio plugins and applications. It supports various plugin formats (VST2, VST3, AudioUnit, AAX, AUv3, and Web Audio Module) and provides a flexible, object-oriented API for creating user interfaces and processing audio.

Pros

  • Cross-platform support for Windows, macOS, iOS, and Web
  • Supports multiple plugin formats with a single codebase
  • Provides a simple and intuitive API for audio processing and UI creation
  • Includes helpful tools and examples for rapid development

Cons

  • Steeper learning curve compared to some other audio plugin frameworks
  • Limited documentation and community resources compared to more established frameworks
  • Requires knowledge of C++ programming
  • Some features and optimizations are still in development

Code Examples

  1. Basic audio processing:
void MyPlugin::ProcessBlock(sample** inputs, sample** outputs, int nFrames)
{
  for (int s = 0; s < nFrames; s++) {
    for (int c = 0; c < NOutChansConnected(); c++) {
      outputs[c][s] = inputs[c][s] * mGain;
    }
  }
}
  1. Creating a simple UI control:
mGainKnob = new IVKnobControl(IRECT(20, 20, 60, 60), kGain, "Gain");
AttachControl(mGainKnob);
  1. Handling parameter changes:
void MyPlugin::OnParamChange(int paramIdx)
{
  switch (paramIdx)
  {
    case kGain:
      mGain = GetParam(kGain)->Value() / 100.;
      break;
    // ...
  }
}

Getting Started

  1. Clone the iPlug 2 repository:

    git clone https://github.com/iPlug2/iPlug2.git
    
  2. Install dependencies (varies by platform, see documentation)

  3. Use the provided scripts to generate a new project:

    cd iPlug2/Examples/IPlugInstrument
    python3 duplicate.py MyPlugin
    
  4. Open the generated project in your IDE and start developing your plugin

  5. Build and test your plugin using the provided build scripts or IDE configurations

For more detailed instructions and platform-specific setup, refer to the official iPlug 2 documentation.

Competitor Comparisons

1,788

VST 3 Plug-In SDK

Pros of VST3 SDK

  • Official SDK from Steinberg, ensuring compatibility with VST3 standard
  • Comprehensive documentation and examples
  • Regular updates and maintenance by Steinberg

Cons of VST3 SDK

  • Steeper learning curve compared to iPlug2
  • More complex setup and configuration process
  • Limited cross-platform support out of the box

Code Comparison

VST3 SDK:

#include "public.sdk/source/vst/vstaudioeffect.h"

class MyPlugin : public Steinberg::Vst::AudioEffect {
    // Implementation
};

iPlug2:

#include "IPlug_include_in_plug_hdr.h"

class MyPlugin : public iplug::Plugin {
    // Implementation
};

The VST3 SDK provides a more standardized approach, while iPlug2 offers a simplified API for rapid development. iPlug2 abstracts many complexities, making it easier for beginners to create plugins. However, the VST3 SDK gives developers more control over low-level details and ensures full compliance with the VST3 standard.

7,344

JUCE is an open-source cross-platform C++ application framework for desktop and mobile applications, including VST, VST3, AU, AUv3, LV2 and AAX audio plug-ins.

Pros of JUCE

  • More extensive and mature ecosystem with a larger community
  • Cross-platform support for desktop, mobile, and web applications
  • Comprehensive documentation and learning resources

Cons of JUCE

  • Commercial licensing can be expensive for some developers
  • Steeper learning curve due to its extensive feature set
  • Larger codebase and potential overhead for simpler projects

Code Comparison

JUCE example:

class MainComponent : public juce::Component
{
public:
    MainComponent()
    {
        addAndMakeVisible(myButton);
        myButton.onClick = [this] { buttonClicked(); };
    }
    // ...
};

iPlug2 example:

class MyPlugin : public Plugin
{
public:
    MyPlugin(const InstanceInfo& info)
    : Plugin(info, MakeConfig(kNumParams, kNumPresets))
    {
        GetParam(kGain)->InitDouble("Gain", 0., 0., 100.0, 0.01, "%");
    }
    // ...
};

Both frameworks provide abstractions for audio plugin development, but JUCE offers a more comprehensive set of tools for general application development, while iPlug2 focuses specifically on audio plugins with a simpler API.

3,402

Synthesizer plug-in (previously released as Vember Audio Surge)

Pros of Surge

  • Fully-featured, production-ready synthesizer with a rich set of features
  • Active community and regular updates
  • Extensive documentation and user guides

Cons of Surge

  • Steeper learning curve for beginners
  • Less flexibility for creating custom audio plugins
  • More complex codebase, potentially harder to contribute to

Code Comparison

Surge (C++):

void SurgeVoice::processBlock(float *__restrict L, float *__restrict R, int nsamples)
{
   for (int s = 0; s < nsamples; s++)
   {
      float oL = 0.f, oR = 0.f;
      // ... (processing logic)
      L[s] += oL;
      R[s] += oR;
   }
}

iPlug2 (C++):

void MyPlugin::ProcessBlock(sample** inputs, sample** outputs, int nFrames)
{
  const double gain = GetParam(kGain)->Value();
  const int nChans = NOutChansConnected();
  
  for (int s = 0; s < nFrames; s++) {
    for (int c = 0; c < nChans; c++) {
      outputs[c][s] = inputs[c][s] * gain;
    }
  }
}

Summary

Surge is a full-featured synthesizer with a rich set of capabilities, while iPlug2 is a framework for building audio plugins. Surge offers a complete synth experience but may be more complex for beginners. iPlug2 provides more flexibility for creating custom plugins but requires more work to build a complete synthesizer. The code examples show the difference in approach, with Surge focusing on synthesizer-specific processing and iPlug2 providing a more generic plugin structure.

C library for cross-platform real-time audio input and output

Pros of libsoundio

  • Lightweight and focused on audio I/O, making it easier to integrate into projects
  • Cross-platform support with a consistent API across different operating systems
  • Low-latency design, suitable for real-time audio applications

Cons of libsoundio

  • Limited to audio I/O functionality, lacking features for plugin development
  • Smaller community and ecosystem compared to iPlug2
  • Less comprehensive documentation and examples

Code Comparison

libsoundio:

SoundIoOutStream *outstream = soundio_outstream_create(device);
outstream->format = SoundIoFormatFloat32NE;
outstream->write_callback = write_callback;
soundio_outstream_open(outstream);
soundio_outstream_start(outstream);

iPlug2:

void MyPlugin::ProcessBlock(sample** inputs, sample** outputs, int nFrames)
{
  for (int s = 0; s < nFrames; s++) {
    outputs[0][s] = inputs[0][s] * mGain;
    outputs[1][s] = inputs[1][s] * mGain;
  }
}

libsoundio focuses on low-level audio I/O, while iPlug2 provides a higher-level framework for audio plugin development. libsoundio is more suitable for applications requiring direct audio stream control, whereas iPlug2 offers a more comprehensive solution for creating audio plugins with GUI support and additional features.

1,117

The Synthesis ToolKit in C++ (STK) is a set of open source audio signal processing and algorithmic synthesis classes written in the C++ programming language.

Pros of STK

  • Focused on sound synthesis and audio processing algorithms
  • Extensive collection of physical modeling instruments
  • Lightweight and portable, suitable for embedded systems

Cons of STK

  • Limited GUI capabilities compared to iPlug2
  • Less comprehensive plugin development framework
  • Smaller community and fewer resources for plugin developers

Code Comparison

STK (C++):

StkFloat MyInstrument::tick() {
    lastOut_ = filter_.tick(excitation_);
    return lastOut_;
}

iPlug2 (C++):

void MyPlugin::ProcessBlock(sample** inputs, sample** outputs, int nFrames) {
    for (int s = 0; s < nFrames; s++) {
        outputs[0][s] = mFilter.Process(inputs[0][s]);
    }
}

STK focuses on low-level audio processing and synthesis, while iPlug2 provides a more comprehensive framework for plugin development, including GUI tools and host integration. STK is better suited for audio algorithm development and embedded applications, whereas iPlug2 is more appropriate for creating full-featured audio plugins with graphical interfaces.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

iPlug 2

C++ audio plug-in framework for desktop, mobile (iOS) and web

Build Status

iPlug 2 is a simple-to-use C++ framework for developing cross-platform audio plug-ins/apps and targeting multiple plug-in APIs with the same minimalistic code. It abstracts an audio plug-in (IPlug) and its drawing engine/GUI toolkit (IGraphics). IGraphics is a simple graphics abstraction layer with good performance which contains a collection of common controls well suited for audio plug-ins, either using bitmap or vector graphics. IGraphics can use NanoVG or Skia as the drawing backend, providing many options depending on your requirements. Alternatively, iPlug2 can be used with other UI toolkits. Examples are included showing how you can use technologies such as HTML/CSS or SwiftUI on top of a C++ DSP layer.

The recommended starting point for an iPlug2 project in 2024 can be found in a separate repo, iPlug2OOS (out-of-source)

iPlug2GPT is a customized GPT that you can use to learn how to use iPlug2.

iPlug2 API Documentation is published here and be sure to check out the iPlug2 Wiki

The original version of iPlug was released in 2008 as part of Cockos' WDL library. iPlug 2 (2018) is a substantial reworking that brings multiple vector graphics backends to IGraphics (including GPU accelerated options and HiDPI/scaling), a better approach to concurrency, support for distributed plug-in formats and compiling to WebAssembly via emscripten, amongst many other things.

iPlug 2 targets the CLAP, VST2, VST3, AUv2, AUv3, AAX (Native) and the Web Audio Module (WAM) plug-in APIs. It can also produce standalone win32/macOS apps with audio and MIDI I/O, as well as Reaper extensions. Windows 8, macOS 10.13, and iOS 14 are the official minimum target platforms, but depending on the graphics backend used, you may be able to make it work on earlier operating systems.

iPlug 2 is licensed with a liberal zlib-like license, which means that it is free to use in closed source projects and is free from corporate interference.

iPlug2 discussions happen at the iPlug2 forum and on the iPlug2 discord server - see you there!

We welcome any help with bug fixes, features or documentation.

You can help support the project financially via github sponsors. With regular financial support, more time can be spent maintaining and improving the project. Even small contributions are very much appreciated.