GithubHelp home page GithubHelp logo

embedded-audio-tools's Introduction

Embedded Audio Tools

Toolbox for creating audio effects with focus on the embedded aspect of things.

Memory

MemorySlice implements the Send trait since it only works safely on statically allocated memory.

Example

use embedded_audio_tools::memory_access::*;

// Thread-safe mutable slice
let mut buffer = [0.0_f32; 24];
let mut mut_slice = from_slice_mut(&mut buffer[..]);

// Null pointer and length of 0
let mut ptr_buffer = null_mut();

// Change associated buffer in runtime
unsafe { 
    ptr_buffer.change_mut_slice_unchecked(buffer.as_mut_ptr(), buffer.len());
}

assert_eq!(ptr_buffer.as_slice(), mut_slice.as_slice());

Biquad

Little suite of filters in a Biquad topology.

FilterType Butterworth Chebyshev Bessel
Lowpass - [x] - [ ] - [ ]
Highpass - [x] - [ ] - [ ]
Allpass - [x] - [ ] - [ ]
Notch - [x] - [ ] - [ ]
Bell - [x] - [ ] - [ ]
Lowshelf - [x] - [ ] - [ ]
Highshelf - [ ] - [ ] - [ ]

Example

use embedded_audio_tools::filter::{Biquad, BiquadCoeffs, Butterworth};

let mut biquad: Biquad<Butterworth> = Biquad::new(BiquadCoeffs::new());

// update coeffs for a lowpass
biquad.coeffs.lowpass(1000.0, 1.0, 48_000.0); // Cutoff = 1kHz, Q = 1.0, fs = 48kHz

// during audio callback
biquad.process(1.0); // process a sample

Delay Line

Uses the MemorySlice as an underlying building block for buffer handling. Can optionally interpolate in between samples either with lerp or lagrange.

Derivates

  • Comb
  • Allpass

Floats

Some common float related stuff:

  • Bitreduction/manipulation
  • Raw IEEE 754 conversion
  • Various Interpolation Algorithms
  • Additional embedded targeted math
  • Decibel to voltage (and back) conversion

Envelope Generator

Currently only implements an ADSR with varying steepness.

Oscillator

A very bad audio oscillator (with no anti-aliasing whatsoever), but maybe not a bad LFO. Comes with the common waveforms:

  • Sine
  • Square
  • Triangle
  • Sawtooth

It is based on a software phase accumulator which is implemented as a trait bound. In theory, one could implement a hardware accumulator (i.e. timer).

Stereo

Panning, balacing and crossfading

embedded-audio-tools's People

Contributors

backtail avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.