#vst-plugin #web #gui

augmented_oscillator

Very simple implementation of an oscillator

10 releases (4 stable)

1.3.0 May 22, 2023
1.2.1 Mar 22, 2023
1.2.0 Oct 22, 2022
1.1.0 Sep 22, 2022
1.0.0-alpha.3 Jan 15, 2022

#714 in Audio

Download history 20/week @ 2023-06-11 138/week @ 2023-06-18 72/week @ 2023-06-25 224/week @ 2023-07-02 62/week @ 2023-07-09 104/week @ 2023-07-16 72/week @ 2023-07-23 27/week @ 2023-07-30 56/week @ 2023-08-06 69/week @ 2023-08-13 34/week @ 2023-08-20 43/week @ 2023-08-27 73/week @ 2023-09-03 46/week @ 2023-09-10 39/week @ 2023-09-17 38/week @ 2023-09-24

197 downloads per month
Used in 15 crates (6 directly)

MIT license

35KB
556 lines

augmented_oscillator

Very simple implementation of an oscillator.

Examples

Sine oscillator

let sample_rate = 44100.0;
let mut osc = augmented_oscillator::Oscillator::sine(sample_rate);
osc.set_frequency(40.0);  // set freq. in Hz
let _sample = osc.next_sample(); // tick the oscillator forward

Wave-table oscillator

use augmented_oscillator::{Oscillator, wavetable::WaveTableOscillator};

let sample_rate = 44100.0;
// let mut osc = WaveTableOscillator::new(vec![/* your wave table data */]);
// You can either ^^^^ provide your own table (and update it at runtime) or generate a table
// of a certain length (100 sample here) from a function oscillator
let mut osc = WaveTableOscillator::from_oscillator(Oscillator::sine(sample_rate), 100);
osc.set_frequency(40.0);  // set freq. in Hz
let _sample = osc.next_sample(); // tick the oscillator forward

Custom oscillator generator function

let sample_rate = 44100.0;
let mut osc = augmented_oscillator::Oscillator::new_with_sample_rate(
    sample_rate,
    move |phase: f32| phase.sin()
);
osc.set_frequency(40.0);  // set freq. in Hz
let _sample = osc.next_sample(); // tick the oscillator forward

License: MIT

Dependencies

~0.5–1.2MB
~26K SLoC