[][src]Struct sfxr::Sample

pub struct Sample {
    pub wave_type: WaveType,
    pub base_freq: f64,
    pub freq_limit: f64,
    pub freq_ramp: f64,
    pub freq_dramp: f64,
    pub duty: f32,
    pub duty_ramp: f32,
    pub vib_strength: f64,
    pub vib_speed: f64,
    pub vib_delay: f32,
    pub env_attack: f32,
    pub env_sustain: f32,
    pub env_decay: f32,
    pub env_punch: f32,
    pub lpf_resonance: f32,
    pub lpf_freq: f32,
    pub lpf_ramp: f32,
    pub hpf_freq: f32,
    pub hpf_ramp: f32,
    pub pha_offset: f32,
    pub pha_ramp: f32,
    pub repeat_speed: f32,
    pub arp_speed: f32,
    pub arp_mod: f64,
}

Defines a sound effect configuration for a Generator

Fields

wave_type: WaveType

Oscillator wave type

base_freq: f64

Oscillator base frequency. Value must be between 0.0 and 1.0.

freq_limit: f64

Oscillator frequency limit. Value must be between 0.0 and 1.0.

freq_ramp: f64

Oscillator frequency change over time. Value must be between -1.0 and 1.0.

freq_dramp: f64

freq_ramp change over time. Value must be between -1.0 and 1.0.

duty: f32

Oscillator square wave duty cycle. Value must be between 0.0 and 1.0.

duty_ramp: f32

Oscillator square wave duty cycle change over time. Value must be between -1.0 and 1.0.

vib_strength: f64

Vibrato strength. Value must be between 0.0 and 1.0.

vib_speed: f64

Vibrato speed. Value must be between 0.0 and 1.0.

vib_delay: f32

Vibrato delay. Value must be between 0.0 and 1.0.

env_attack: f32

Duration of attack envelope. Value must be between 0.0 and 1.0.

env_sustain: f32

Duration of sustain envelope. Value must be between 0.0 and 1.0.

env_decay: f32

Duration of decay envelope. Value must be between 0.0 and 1.0.

env_punch: f32

Amount of "punch" in sustain envelope. Value must be between -1.0 and 1.0.

lpf_resonance: f32

Low pass filter resonance. Value must be between 0.0 and 1.0.

lpf_freq: f32

Low pass filter cutoff frequency. Value must be between 0.0 and 1.0.

lpf_ramp: f32

Low pass filter cutoff frequency change over time. Value must be between -1.0 and 1.0.

hpf_freq: f32

High pass filter cutoff frequency. Value must be between 0.0 and 1.0.

hpf_ramp: f32

High pass filter cutoff frequency change over time. Value must be between -1.0 and 1.0.

pha_offset: f32

Phaser temporal offset. Value must be between -1.0 and 1.0.

pha_ramp: f32

Phaser temporal offset change over time. Value must be between -1.0 and 1.0.

repeat_speed: f32

Sample repeat speed. Value must be between 0.0 and 1.0.

arp_speed: f32

Arpeggio interval. Value must be between 0.0 and 1.0.

arp_mod: f64

Arpeggio step in frequency. Value must be between -1.0 and 1.0.

Methods

impl Sample[src]

pub fn new() -> Sample[src]

Constructs a new Sample with default settings

pub fn mutate(&mut self, seed: Option<u64>)[src]

Changes Sample fields randomly by a little

pub fn pickup(seed: Option<u64>) -> Sample[src]

Constructs a new random "coin" or "item pickup" style sample using optional random seed

pub fn laser(seed: Option<u64>) -> Sample[src]

Constructs a new random "shoot" or "laser" style sample using optional random seed

pub fn explosion(seed: Option<u64>) -> Sample[src]

Constructs a new random "explosion" style sample using optional random seed

pub fn powerup(seed: Option<u64>) -> Sample[src]

Constructs a new random "powerup" style sample using optional random seed

pub fn hit(seed: Option<u64>) -> Sample[src]

Constructs a new random "hit" or "damage" style sample using optional random seed

pub fn jump(seed: Option<u64>) -> Sample[src]

Constructs a new random "jump" style sample using optional random seed

pub fn blip(seed: Option<u64>) -> Sample[src]

Constructs a new random "blip" or "menu navigation" style sample using optional random seed

Auto Trait Implementations

impl Send for Sample

impl Sync for Sample

impl Unpin for Sample

impl UnwindSafe for Sample

impl RefUnwindSafe for Sample

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]