Audio Effects Framework
Audio Effects Framework

Cross platform C++ library with low-latency audio effects processing algorithms designed for real-time audio processing.

Video demonstration for the framework : https://www.youtube.com/watch?v=NgGLyauAIhE

The Doxygen documentation can be accessed here: http://rishikeshdaoo.github.io/AudioEffectsFramework

Motivation

This project aims to provide an easy to use API for creating audio effects processing applications. With well documented, low-level implementation of audio effects in C++, the library is designed to be simple and efficient. The effects use a process function designed for variable-length input blocks, making them suitable for real-time plugin applications such as JUCE.

We designed this library for users of all levels of experience. To this end, the effects in this framework contain commonly used default values for effect parameters and receive variable-length lists of parameters and values when initialized. This means that they can be used simply by instantiating the audio effect and running its process function and that more advanced users can edit any set of parameters they choose.

We tested these effect implementations against reference MATLAB code from http://dafx.de/DAFX_Book_Page/index.html, as well as C++ unit testing.

This repository also contains an executable .cpp file. A user can enter an input and output file path and effect type/subtype in order to generate an instance of that effect on an audio file, using default parameters.

Effects included in the library

  • Gain
  • Pan
  • Delay
  • Biquad
  • Distortion
  • Compressor
  • Expander
  • Flanger
  • Chorus
  • Reverb
  • Tremolo
  • Vibrato

Use Cases

  • Creating plugins for Digital Audio Workstations.
  • For use in applications that require real-time audio effects.

Getting Started

Instructions

Effect Subtype Categorization

  • Some of the effects have an hierarchical structure, where a class hold several effect subtypes. To use a specific effect subtype, the correct subtype enum should be passed to in the constructor/init function. The below diagram explains the categorization and the enum corresponding to the subtypes.

Effect Subtype Categories

Usage

Create the Effect Instance

CAudioEffectDelay *phAudioEffectDelay = nullptr;
phAudioEffectDelay = new CAudioEffectDelay(fSampleRateInHz, iNumChannels, subType, fMaxDelayInSec, params[] , values[], iNumParams);

  • fSampleRateInHz, iNumChannels - Required arguments that should be taken from the host application. Both are required arguments
  • subType - Required argument for the effect subtype the user wishes to use. Exists only for effects that have subtypes. Refer above section on effect subtype categorization.
  • fMaxDelayInSec - Required argument the user sets according to their requirement for parameter value range (Only delay based effects have this argument).
  • params, values, iNumParams - Optional arguments that need to be initialized as below. These are the values of the effect parameters. These are optional arguments, which will take default values if they are not passed by the user.

int iNumParams = 5;
CAudioEffect::EffectParam_t param[iNumParams];
float value[iNumParams];

param[0] = CAudioEffect::kParamDelayInSecs;
value[0] = 0.002f;
param[1] = CAudioEffect::kParamModRateInHz;
value[1] = 0.5f;
param[2] = CAudioEffect::kParamModWidthInSecs;
value[2] = 0.002f;
param[3] = CAudioEffect::kParamDryWetMix;
value[3] = 0.7f;
param[4] = CAudioEffect::kParamFeedback;
value[4] = 0.5f;

Call the effect's process function

Error_t error = phAudioEffectDelay -> process(ppfAudioInput, ppfAudioOutput, iNumFrames);

  • ppfAudioInput, ppfAudioOutput - Input/output buffers used by the library. The user should take care of creating and destroying these buffers.
  • iNumFrames - Argument that tells the process function the number of samples in a block of buffered audio.