pub struct MixGenerator {
pub master_output: StemOutput,
pub voice_output: StemOutput,
pub square_output: StemOutput,
pub triangle_output: StemOutput,
pub noise_output: StemOutput,
/* private fields */
}Expand description
Same per-sample peak-normalization behaviour as [IterMix], for feeding Sample values one-by-one from JS/workers.
Fields§
§master_output: StemOutput§voice_output: StemOutput§square_output: StemOutput§triangle_output: StemOutput§noise_output: StemOutputImplementations§
Source§impl MixGenerator
Mix the song and drum samples together
impl MixGenerator
Mix the song and drum samples together
pub fn new() -> Self
Sourcepub fn with_master_output(self, output: StemOutput) -> Self
pub fn with_master_output(self, output: StemOutput) -> Self
Set the master volume (applied after peak normalisation).
Sourcepub fn with_voice_output(self, output: StemOutput) -> Self
pub fn with_voice_output(self, output: StemOutput) -> Self
Set per-stem output for the voice stem.
Sourcepub fn with_square_output(self, output: StemOutput) -> Self
pub fn with_square_output(self, output: StemOutput) -> Self
Set per-stem output for the square (melody) stem.
Sourcepub fn with_triangle_output(self, output: StemOutput) -> Self
pub fn with_triangle_output(self, output: StemOutput) -> Self
Set per-stem output for the triangle (bass) stem.
Sourcepub fn with_noise_output(self, output: StemOutput) -> Self
pub fn with_noise_output(self, output: StemOutput) -> Self
Set per-stem output for the noise (drum) stem.
pub fn reset(&mut self)
pub fn effective_master_volume(&self) -> f32
pub fn effective_voice_volume(&self) -> f32
pub fn effective_square_volume(&self) -> f32
pub fn effective_triangle_volume(&self) -> f32
pub fn effective_noise_volume(&self) -> f32
pub fn mix_sample(&mut self, sample: Sample) -> Mix
pub fn mix_samples( &mut self, samples: &[Sample], num_samples: usize, ) -> Vec<Mix>
Trait Implementations§
Source§impl Clone for MixGenerator
impl Clone for MixGenerator
Source§fn clone(&self) -> MixGenerator
fn clone(&self) -> MixGenerator
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MixGenerator
impl Debug for MixGenerator
Source§impl Default for MixGenerator
impl Default for MixGenerator
Source§impl PartialEq for MixGenerator
impl PartialEq for MixGenerator
Source§fn eq(&self, other: &MixGenerator) -> bool
fn eq(&self, other: &MixGenerator) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for MixGenerator
impl StructuralPartialEq for MixGenerator
Auto Trait Implementations§
impl Freeze for MixGenerator
impl RefUnwindSafe for MixGenerator
impl Send for MixGenerator
impl Sync for MixGenerator
impl Unpin for MixGenerator
impl UnsafeUnpin for MixGenerator
impl UnwindSafe for MixGenerator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more