1# Development 2 3The effects included are designed to be as portable as possible, as well as making it easy to add additional effects. 4 5## Building 6 7To build the app, simply open the project in android studio and build. The app integrates Oboe via a git submodule. Make sure 8when cloning the repository to clone the submodule as well using `git clone --recursive`, or `git submodule update --init --recursive`. 9 10To update the version of Oboe being used, descend into the Oboe repository [(oboe location)](../app/src/main/cpp) 11and update from its remote. Then, call `git submodule update` in this repository. Alternatively `git submodule update --recursive --remote` will pull the latest version of Oboe from remote. 12 13Although the CMake file requires android headers (to use Oboe), the effects themselves can be compiled with any C++17 compliant compiler. 14 15## Architecture 16 17The UI code (Kotlin) calls native code through the JNI bridge to query information about the various effects implemented, 18and how to render the effect information in the UI. This means that adding an effect only needs to be done on the 19native side. The JNI bridge passes information regarding implemented effects descriptions to the UI as well as functions 20called when the user modifies effects in the UI. 21 22The `DuplexEngine` is responsible for managing and syncing the input and output Oboe streams for rendering audio 23with as low latency as possible. The `FunctionList` class contains the a vector of effects that correspond to the list of 24effects (and their parameters) that the user wants to use to process their audio. Effects (and the `FunctionList`) overload 25their function operator to take in two numeric iterator types. E.g `<template iter_type> void operator() 26(iter_type begin, iter_type end)`, where the `iter_types` correspond to C++ iterators carrying audio data. To erase the type 27of different objects, the `FunctionList` holds objects of types `std::function<void(iter_type, iter_type)>` i.e. functions 28which operate on the range between two numeric iterators in place. The `DuplexEngine`simply calls the `FunctionList` on every 29buffer of samples it receives. 30 31The effects folder contains the classes of various implemented effects. It also contains `Effects.h` where a global tuple of 32all the Effect descriptions implemented lives. The description folder contains the description for all of the effects. 33Each description takes the form of a class with static methods providing information regarding the effect (including name, 34category, parameters, and a factory method). 35 36## Adding Effects 37To add an effect, simply add a Description class similar to the existing classes, and add the class to the tuple in `Effects.h`. The description must provide a way to build the effect by either constructing another class corresponding 38to an effect, or pointing to a standalone function. Adding new effects is welcome! 39 40## Existing Effects 41A instructional implemented effect to examine is the `TremoloEffect.h` (a modulating gain). 42Many of the effects in the delay category 43inherit from `DelayLineEffect` which provides a framework to easily implement many delay based effects, as well as 44the comb filter effects (FIR, IIR, allpass). The slides have a block diagram displaying the mathematical basis of the effect. 45The nonlinear effects (distortion and overdrive) are implemented using a standalone function (from `SingleEffectFunctions.h`. 46The gain effect is implemented by a simple lambda in its description class. 47