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: 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
.
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