Crate twang[][src]

A sound synthesis crate.

A4 (440 Hz) Organ Example

extern crate twang; // for sound generation / effects
extern crate adi; // for speaker

use adi::speaker::Speaker;
use twang::Sound;

fn main() {
    let mut speaker = Speaker::new(0, false).unwrap();
    let mut snds = Sound::new(None, 440.0); // A4

    loop {
        speaker.update(&mut || {
            let x = snds.next().unwrap();

            (x.sin().pos() + x.tri().neg()).into()
        });
    }
}

Modules

prelude

Traits

Structs

Pink

Pink Noise Sampler.

Sample

A Sample and Timestamp.

Sound

Pitched Sound sampler.

Wave

The information necessary to sample a common waveform.

White

White Noise Sampler.