Skip to content

Periodic waveform synthesizer for generating Sine, Square, Triangle, Sawtooth waveforms.

Notifications You must be signed in to change notification settings

Lyamc/periodicsynth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PeriodicSynth

Build Status

A basic periodic waveform synthesizer for generating the most common types of waveforms that a signal generator is able to generate. Basically, it mimics the capabilities of a signal generator.


# Add the line below to the "Cargo.toml"
periodicsynth = "0.1.3"
/**
 * A basic usage of the library, a triangle wave
 * with a frequency of 440hZ and sample rate of
 * 44.1khZ and bit-depth of 64bits.
 */
use periodicsynth;

fn main() {
    /* Intialise an vector with 0 values.
       The length of the vector is the sample rate. */
    let mut samples = vec![0f64; 44100];

    /* Synthesize a triangle wave with frequency of 440hZ. */
    periodicsynth::synth(&mut samples, periodicsynth::PerodicFunction::Sine, 440.0);
}

Motivation

The WebAudio API's OscillatorNode generates periodic waveforms on demand with several types of periodic function types with arbitrary frequency and sample rate.

About

Periodic waveform synthesizer for generating Sine, Square, Triangle, Sawtooth waveforms.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages