Skip to main content

Synthwave

Struct Synthwave 

Source
pub struct Synthwave {
    pub unison: u8,
    pub detune: u16,
    pub spread: u8,
    pub pan: i8,
    pub voices: u8,
    pub glide_ms: u32,
    pub legato: bool,
    pub filter: Option<VoiceFilter>,
    pub pitch_lfo: Option<Lfo>,
    pub cutoff_lfo: Option<Lfo>,
    pub amplitude_lfo: Option<Lfo>,
    pub pan_lfo: Option<Lfo>,
}
Expand description

Opt-in synthwave controls, combined with an instrument’s waveform and amplitude ADSR. Supports pulse/square, saw and triangle. Mutually exclusive with chip/drum, except that a wavetable chip source takes voices alone, with every other field at its default, for per-note voices.

Fields§

§unison: u8

Oscillators per note, 1..=8, normalized by their count.

§detune: u16

Symmetric outer detune, 0..=100 cents; one oscillator has zero detune.

§spread: u8

Symmetric linear stereo spread, 0..=100 percent.

§pan: i8

Whole-note stereo pan, -100..=100 percent.

§voices: u8

Voice slots per channel, 1..=16. Idle, then oldest releasing, then oldest held voice is reused, ties by slot index. Stealing is immediate.

§glide_ms: u32

Portamento duration in milliseconds, 0..=60000. Requires voices=1. Active-note retriggers interpolate in cents from the previous current pitch.

§legato: bool

With voices=1, adjacent full-gate notes of the same instrument preserve amplitude/filter envelopes, phase and filter state. Gaps retrigger.

§filter: Option<VoiceFilter>§pitch_lfo: Option<Lfo>§cutoff_lfo: Option<Lfo>§amplitude_lfo: Option<Lfo>§pan_lfo: Option<Lfo>

Implementations§

Trait Implementations§

Source§

impl Clone for Synthwave

Source§

fn clone(&self) -> Synthwave

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Synthwave

Source§

impl Debug for Synthwave

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Synthwave

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for Synthwave

Source§

impl Hash for Synthwave

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Synthwave

Source§

fn eq(&self, other: &Synthwave) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Synthwave

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.