Struct synth::Synth [] [src]

pub struct Synth<M, NFG, W, A, F, FW> where
    NFG: NoteFreqGenerator
{ pub oscillators: Vec<Oscillator<W, A, F, FW>>, pub voices: Vec<Voice>, pub instrument: Instrument<M, NFG>, pub volume: f32, pub spread: f32, pub loop_points: Option<(f64, f64)>, pub duration_ms: Ms, pub base_pitch: Hz, }

The Synth generates audio via a vector of Voices, while a Voice generates audio via a vector of Oscillators, creating a small DSP tree.

Fields

Oscillators for playback.

Per-instrument::Voice state that is unique to the Synth.

The instrument used for performing the synth.

An amplitude multiplier.

The amount each voice should be spread across the available channels.

The start and end points that will be looped.

Duration of the Synth instrument in samples.

Base pitch of the Synth instrument in Steps.

Methods

impl<NFG, W, A, F, FW> Synth<Mono, NFG, W, A, F, FW> where
    NFG: NoteFreqGenerator
[src]

impl<NFG, W, A, F, FW> Synth<Mono, NFG, W, A, F, FW> where
    NFG: NoteFreqGenerator
[src]

impl<NFG, W, A, F, FW> Synth<Poly, NFG, W, A, F, FW> where
    NFG: NoteFreqGenerator
[src]

impl<M, NFG, W, A, F, FW> Synth<M, NFG, W, A, F, FW> where
    NFG: NoteFreqGenerator
[src]

Constructor for a new Synth.

Return the synth with the given number of voices.

Set the number of voices that the Synth shall use.

Add an oscillator to a Synth.

Add multiple oscillators to a Synth.

Set the Synth's duration.

Set the Synth's base pitch.

Set the Synth's detune amount.

Set the Synth's spread amount.

Set the Synth's volume.

Convert Self into a new Synth with the given NoteFreqGenerator.

Set the loop data for the synth.

Set the fade data for the synth.

Set the start loop point.

Set the end loop point.

Set the attack in milliseconds.

Set the release in milliseconds.

Add an oscillator.

Remove and return the oscillator at the given idx.

Return whether or not there are any currently active voices.

Begin playback of a note. Synth will try to use a free Voice to do this. If no Voices are free, the one playing the oldest note will be chosen to play the new note instead.

Stop playback of the note that was triggered with the matching frequency.

Stop playback and clear the current notes.

Map the Instrument to a new Instrument in place.

This is useful for providing wrapper builder methods for the Synth.

Produces an Iterator that endlessly yields new Frames

Additively fill the given slice of Frames with the Synth::frames method.

Trait Implementations

impl<M: Clone, NFG: Clone, W: Clone, A: Clone, F: Clone, FW: Clone> Clone for Synth<M, NFG, W, A, F, FW> where
    NFG: NoteFreqGenerator
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<M: Debug, NFG: Debug, W: Debug, A: Debug, F: Debug, FW: Debug> Debug for Synth<M, NFG, W, A, F, FW> where
    NFG: NoteFreqGenerator
[src]

Formats the value using the given formatter.

impl<M, NFG, W, A, F, FW> PartialEq for Synth<M, NFG, W, A, F, FW> where
    M: PartialEq,
    NFG: PartialEq + NoteFreqGenerator,
    W: PartialEq,
    A: PartialEq,
    F: PartialEq,
    FW: PartialEq,
    Instrument<M, NFG>: PartialEq
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<FRM, M, NFG, W, A, F, FW> Node<FRM> for Synth<M, NFG, W, A, F, FW> where
    FRM: Frame,
    <FRM::Sample as Sample>::Float: FromSample<f32>,
    <FRM::Sample as Sample>::Signed: FromSample<f32>,
    M: Mode,
    NFG: NoteFreqGenerator,
    W: Waveform,
    A: Amplitude,
    F: Frequency,
    FW: FreqWarp
[src]

Request audio from the Node given some sample_hz (aka sample rate in hertz). If the Node has no inputs, the buffer will be zeroed. If the Node has some inputs, the buffer will consist of the inputs summed together. Read more

Following the call to the Node's audio_requested method, the Graph will sum together some of the original (dry) signal with some of the processed (wet) signal. Read more

Following the call to the Node's audio_requested method, the Graph will sum together some of the original (dry) signal with some of the processed (wet) signal. Read more