pub struct TimbreProfile {
pub name: String,
pub description: String,
pub envelopes: Vec<(u8, SpectralEnvelope)>,
pub sample_rate: f32,
pub fft_size: usize,
}Expand description
A complete timbre profile — multiple envelopes at different pitches/velocities.
Fields§
§name: String§description: String§envelopes: Vec<(u8, SpectralEnvelope)>Envelopes at different MIDI notes (for pitch-dependent timbre).
sample_rate: f32§fft_size: usizeImplementations§
Source§impl TimbreProfile
impl TimbreProfile
pub fn new(name: &str, sample_rate: f32, fft_size: usize) -> Self
Sourcepub fn add_envelope(&mut self, note: u8, audio: &[f32])
pub fn add_envelope(&mut self, note: u8, audio: &[f32])
Add an envelope for a specific MIDI note.
Sourcepub fn envelope_for_note(&self, note: u8) -> Option<&SpectralEnvelope>
pub fn envelope_for_note(&self, note: u8) -> Option<&SpectralEnvelope>
Get the best matching envelope for a given MIDI note.
Trait Implementations§
Source§impl Clone for TimbreProfile
impl Clone for TimbreProfile
Source§fn clone(&self) -> TimbreProfile
fn clone(&self) -> TimbreProfile
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TimbreProfile
impl RefUnwindSafe for TimbreProfile
impl Send for TimbreProfile
impl Sync for TimbreProfile
impl Unpin for TimbreProfile
impl UnsafeUnpin for TimbreProfile
impl UnwindSafe for TimbreProfile
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more