- 📱 iOS 9.0+
- 💻 OS X 10.11+
- 🐧 Ubuntu Trusty 14.04+
- 🤖 Android SDK r24+
- 🖥️ Microsoft UWP
PeqBank
is a C-library designed to perform parametric equalization using analog-like parametric EQs. This implementation was documented in Musical Applications of New Filter Extensions to Max/MSP.
main.c
provides an example program.
The following explains how to setup a low pass filter:
#include "peqbank.h"
/* Assume arrays signal_in and signal_out and values
num_frames, buffer_size and num_channels are declared
$a. somewhere else
*/
t_filter **filters = new_filters(1); // init number of desired filters
filters[0] = new_lowpass(4000, 1, 6); // attach lowpass filter
peqbank_setup(x, filters); // setup filters
for (int i = 0; i < num_frames; i += buffer_size) {
if (num_frames - i < buffer_size) x->s_n = num_frames - i;
frame += peqbank_callback_int16(
x, &signal_in[frame * num_channels], &signal_out[frame * num_channels]);
}
x->s_n = buffer_size; // reset buffer size...
free(filters[0]);
It is important to note that the peq filter bank must be allocated and free'd manually. There is no RAII support as it is currently meant to be C-compatible.
PeqBank
is a Cmake project. While you are free to download the prebuilt static libraries it is recommended to use Cmake to install this project into your wider project. In order to add this into a wider Cmake project, add the following line to your CMakeLists.txt
file:
add_subdirectory(PeqBank)
Each script in ci/
demonstrates how to build and the dependencies required per platform, although they do not account for integration into other build systems, like Gradle.
Generally the process is:
$ mkdir build
$ cd build
$ cmake .. -GXcode # or Ninja
$ open PeqBank.xcodeproj # MacOS Only
Check ths scripts in ci/
for more platform-specific details.
Contributions are welcomed, have a look at the CONTRIBUTING.md document for more information.
This project adheres to the Open Code of Conduct. By participating, you are expected to honor this code.
The project is available under the Apache 2.0 license.
- Icon in readme banner is "Bank by Adrien Coquet from the Noun Project".
Primary contributors to this repository at the time of open sourcing:
- Tristan Jehan: Original Author
- David Rubinstein
- Julia Cox
- Will Sackfield