pub struct Sample {Show 24 fields
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,
}Expand description
Defines a sound effect configuration for a Generator
Fields§
§wave_type: WaveTypeOscillator wave type
base_freq: f64Oscillator base frequency. Value must be between 0.0 and 1.0.
freq_limit: f64Oscillator frequency limit. Value must be between 0.0 and 1.0.
freq_ramp: f64Oscillator frequency change over time. Value must be between -1.0 and 1.0.
freq_dramp: f64freq_ramp change over time. Value must be between -1.0 and 1.0.
duty: f32Oscillator square wave duty cycle. Value must be between 0.0 and 1.0.
duty_ramp: f32Oscillator square wave duty cycle change over time. Value must be between -1.0 and 1.0.
vib_strength: f64Vibrato strength. Value must be between 0.0 and 1.0.
vib_speed: f64Vibrato speed. Value must be between 0.0 and 1.0.
vib_delay: f32Vibrato delay. Value must be between 0.0 and 1.0.
env_attack: f32Duration of attack envelope. Value must be between 0.0 and 1.0.
env_sustain: f32Duration of sustain envelope. Value must be between 0.0 and 1.0.
env_decay: f32Duration of decay envelope. Value must be between 0.0 and 1.0.
env_punch: f32Amount of “punch” in sustain envelope. Value must be between -1.0 and 1.0.
lpf_resonance: f32Low pass filter resonance. Value must be between 0.0 and 1.0.
lpf_freq: f32Low pass filter cutoff frequency. Value must be between 0.0 and 1.0.
lpf_ramp: f32Low pass filter cutoff frequency change over time. Value must be between -1.0 and 1.0.
hpf_freq: f32High pass filter cutoff frequency. Value must be between 0.0 and 1.0.
hpf_ramp: f32High pass filter cutoff frequency change over time. Value must be between -1.0 and 1.0.
pha_offset: f32Phaser temporal offset. Value must be between -1.0 and 1.0.
pha_ramp: f32Phaser temporal offset change over time. Value must be between -1.0 and 1.0.
repeat_speed: f32Sample repeat speed. Value must be between 0.0 and 1.0.
arp_speed: f32Arpeggio interval. Value must be between 0.0 and 1.0.
arp_mod: f64Arpeggio step in frequency. Value must be between -1.0 and 1.0.
Implementations§
Source§impl Sample
impl Sample
Sourcepub fn pickup(seed: Option<u64>) -> Sample
pub fn pickup(seed: Option<u64>) -> Sample
Constructs a new random “coin” or “item pickup” style sample using optional random seed
Sourcepub fn laser(seed: Option<u64>) -> Sample
pub fn laser(seed: Option<u64>) -> Sample
Constructs a new random “shoot” or “laser” style sample using optional random seed
Sourcepub fn explosion(seed: Option<u64>) -> Sample
pub fn explosion(seed: Option<u64>) -> Sample
Constructs a new random “explosion” style sample using optional random seed
Sourcepub fn powerup(seed: Option<u64>) -> Sample
pub fn powerup(seed: Option<u64>) -> Sample
Constructs a new random “powerup” style sample using optional random seed
Sourcepub fn hit(seed: Option<u64>) -> Sample
pub fn hit(seed: Option<u64>) -> Sample
Constructs a new random “hit” or “damage” style sample using optional random seed