Struct playdate_sound_envelope

Source
#[repr(C)]
pub struct playdate_sound_envelope { pub newEnvelope: Option<unsafe extern "C" fn(attack: c_float, decay: c_float, sustain: c_float, release: c_float) -> *mut PDSynthEnvelope>, pub freeEnvelope: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope)>, pub setAttack: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, attack: c_float)>, pub setDecay: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, decay: c_float)>, pub setSustain: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, sustain: c_float)>, pub setRelease: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, release: c_float)>, pub setLegato: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, flag: c_int)>, pub setRetrigger: Option<unsafe extern "C" fn(lfo: *mut PDSynthEnvelope, flag: c_int)>, pub getValue: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope) -> c_float>, pub setCurvature: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, amount: c_float)>, pub setVelocitySensitivity: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, velsens: c_float)>, pub setRateScaling: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, scaling: c_float, start: MIDINote, end: MIDINote)>, }

Fields§

§newEnvelope: Option<unsafe extern "C" fn(attack: c_float, decay: c_float, sustain: c_float, release: c_float) -> *mut PDSynthEnvelope>

PDSynthEnvelope* playdate->sound->envelope->newEnvelope(float attack, float decay, float sustain, float release)

Creates a new envelope with the given parameters.

§freeEnvelope: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope)>

void playdate->sound->envelope->freeEnvelope(PDSynthEnvelope* env)

Frees the envelope.

§setAttack: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, attack: c_float)>

void playdate->sound->envelope->setAttack(PDSynthEnvelope* env, float attack)

§setDecay: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, decay: c_float)>

void playdate->sound->envelope->setDecay(PDSynthEnvelope* env, float decay)

§setSustain: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, sustain: c_float)>

void playdate->sound->envelope->setSustain(PDSynthEnvelope* env, float sustain)

§setRelease: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, release: c_float)>

void playdate->sound->envelope->setRelease(PDSynthEnvelope* env, float release)

Sets the ADSR parameters of the envelope.

§setLegato: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, flag: c_int)>

void playdate->sound->envelope->setLegato(PDSynthEnvelope* env, int flag)

Sets whether to use legato phrasing for the envelope. If the legato flag is set, when the envelope is re-triggered before it’s released, it remains in the sustain phase instead of jumping back to the attack phase.

§setRetrigger: Option<unsafe extern "C" fn(lfo: *mut PDSynthEnvelope, flag: c_int)>

void playdate->sound->envelope->setRetrigger(PDSynthEnvelope* env, int flag)

If retrigger is on, the envelope always starts from 0 when a note starts playing, instead of the current value if it’s active.

§getValue: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope) -> c_float>

float playdate->sound->envelope->getValue(PDSynthEnvelope* env)

Return the current output value of the envelope.

§setCurvature: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, amount: c_float)>

void playdate->sound->envelope->setCurvature(PDSynthEnvelope* env, float amount)

Smoothly changes the envelope’s shape from linear (amount=0) to exponential (amount=1).

§setVelocitySensitivity: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, velsens: c_float)>

void playdate->sound->envelope->setVelocitySensitivity(PDSynthEnvelope* env, float velsens)

Changes the amount by which note velocity scales output level. At the default value of 1, output is proportional to velocity; at 0 velocity has no effect on output level.

§setRateScaling: Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, scaling: c_float, start: MIDINote, end: MIDINote)>

void playdate->sound->envelope->setRateScaling(PDSynthEnvelope* env, float scaling, MIDINote start, MIDINote end)

Scales the envelope rate according to the played note. For notes below start, the envelope’s set rate is used; for notes above end envelope rates are scaled by the scaling parameter. Between the two notes the scaling factor is interpolated from 1.0 to scaling.

Trait Implementations§

Source§

impl Clone for playdate_sound_envelope

Source§

fn clone(&self) -> playdate_sound_envelope

Returns a duplicate of the value. Read more
1.0.0§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for playdate_sound_envelope

Source§

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

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

impl Default for playdate_sound_envelope

Source§

fn default() -> playdate_sound_envelope

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

impl Hash for playdate_sound_envelope

Source§

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

Feeds this value into the given [Hasher]. Read more
1.3.0§

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 Ord for playdate_sound_envelope

Source§

fn cmp(&self, other: &playdate_sound_envelope) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for playdate_sound_envelope

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for playdate_sound_envelope

Source§

fn partial_cmp(&self, other: &playdate_sound_envelope) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Copy for playdate_sound_envelope

Source§

impl Eq for playdate_sound_envelope

Source§

impl StructuralPartialEq for playdate_sound_envelope

Auto Trait Implementations§

§

impl Freeze for playdate_sound_envelope

§

impl RefUnwindSafe for playdate_sound_envelope

§

impl Send for playdate_sound_envelope

§

impl Sync for playdate_sound_envelope

§

impl Unpin for playdate_sound_envelope

§

impl UnwindSafe for playdate_sound_envelope

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

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

§

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
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

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

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

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

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 48 bytes