Module oxcable::oscillator [] [src]

A antialiasing oscillator.

Waveforms

The oscillator supports several classical waveforms. The square, triangle, and saw waves support both aliased and antialiased variants.

The aliased variants produce pure signals; for example, a square wave only emits two values: -1.0 and +1.0. This is useful when a control signal is wanted, but produces aliasing in the frequency domain.

The antialiased variants use PolyBLEP (polynomial bandlimited step) to mitigate the aliasing in the pure signals. This results in a much cleaner audible signal, and is more desirable for most musical purposes.

Pitch Bend

The oscillator supports pitch bending as an additional modifier of the base frequency. This makes it easier to bend a single note when working with MIDI, rather than manually tracking the base frequency and computing a new frequency yourself.

Low Frequency Oscillator

The oscillator supports a low frequency oscillator (LFO) as optional input. If provided, then the LFO is used to modulate the frequency of the oscillator, producing a vibrato.

Example

The oscillator uses a builder pattern for initialization. The following will set up an antialiased saw wave at 440 Hz, with a 0.1 step vibrato:

use oxcable::oscillator::*;
let osc = Oscillator::new(Saw(PolyBlep)).freq(440.0).lfo_intensity(0.1);

Reexports

pub use self::Message::*;
pub use self::AntialiasType::*;
pub use self::Waveform::*;

Structs

Oscillator

An oscillator that generates a periodic waveform.

Enums

AntialiasType

Antialiasing method for certain waveforms.

Message

Defines the messages that the Oscillator supports.

Waveform

Oscillator waveforms.