Skip to content
This repository has been archived by the owner on Oct 13, 2022. It is now read-only.

spotify/PeqBank

Repository files navigation

PeqBank

CircleCI License Spotify FOSS Slack Readme Score

Architecture 📐

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.

Usage example 👀

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.

Installation 📥

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.

Development

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.

Contributing 📬

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.

License 📝

The project is available under the Apache 2.0 license.

Acknowledgements

Contributors 👩‍💻 👨‍💻

Primary contributors to this repository at the time of open sourcing:

About

A cross-platform (iOS, Mac, Windows, Linux, Android) flexible bank of analog-like parametric EQs

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published