pub struct PulseSampleClip { /* private fields */ }Expand description
A Lua-friendly sample clip that renders into offline audio exports.
Implementations§
Source§impl PulseSampleClip
impl PulseSampleClip
Sourcepub fn with_playback_rate(self, playback_rate: f32) -> PulseResult<Self>
pub fn with_playback_rate(self, playback_rate: f32) -> PulseResult<Self>
Sets sample playback rate. Values above 1 play faster and higher.
Sourcepub fn with_gain(self, gain: f32) -> PulseResult<Self>
pub fn with_gain(self, gain: f32) -> PulseResult<Self>
Sets sample gain before the clip is inserted into the composition.
Sourcepub fn with_pitch_shift(self, semitones: f32) -> PulseResult<Self>
pub fn with_pitch_shift(self, semitones: f32) -> PulseResult<Self>
Shifts pitch in semitones without intentionally changing duration.
Sourcepub fn with_time_stretch(self, factor: f32) -> PulseResult<Self>
pub fn with_time_stretch(self, factor: f32) -> PulseResult<Self>
Stretches time without intentionally changing pitch.
Sourcepub fn with_start_at(self, start_at: f32) -> PulseResult<Self>
pub fn with_start_at(self, start_at: f32) -> PulseResult<Self>
Sets clip start offset relative to the song or phrase placement.
Sourcepub fn with_track(self, track_name: impl Into<String>) -> Self
pub fn with_track(self, track_name: impl Into<String>) -> Self
Sets the track name used when this sample clip is inserted into a song or phrase.
Sourcepub fn with_volume(self, volume: f32) -> PulseResult<Self>
pub fn with_volume(self, volume: f32) -> PulseResult<Self>
Sets track-level volume for the sample clip.
Sourcepub fn with_pan(self, pan: f32) -> PulseResult<Self>
pub fn with_pan(self, pan: f32) -> PulseResult<Self>
Sets track-level stereo pan for the sample clip.
Sourcepub fn with_effect(self, effect: PulseEffect) -> Self
pub fn with_effect(self, effect: PulseEffect) -> Self
Appends one track-level effect to this sample clip.
Sourcepub fn with_slice(self, start: f32, end: f32) -> PulseResult<Self>
pub fn with_slice(self, start: f32, end: f32) -> PulseResult<Self>
Selects a source audio time range before pitch, stretch, gain, and rate transforms.
Sourcepub fn with_reverse(self) -> Self
pub fn with_reverse(self) -> Self
Reverses the selected source sample range before fades, pitch, stretch, gain, and rate transforms.
Sourcepub fn with_loop_for(self, duration: f32) -> PulseResult<Self>
pub fn with_loop_for(self, duration: f32) -> PulseResult<Self>
Repeats the selected source sample range to a fixed offline render duration.
Sourcepub fn with_normalize(self) -> Self
pub fn with_normalize(self) -> Self
Normalizes the selected source sample peak before fades and final gain.
Sourcepub fn with_fade_in(self, duration: f32) -> PulseResult<Self>
pub fn with_fade_in(self, duration: f32) -> PulseResult<Self>
Applies a fade-in to the rendered source sample before pitch, stretch, gain, and rate transforms.
Sourcepub fn with_fade_out(self, duration: f32) -> PulseResult<Self>
pub fn with_fade_out(self, duration: f32) -> PulseResult<Self>
Applies a fade-out to the rendered source sample before pitch, stretch, gain, and rate transforms.
Sourcepub fn playback_rate(&self) -> f32
pub fn playback_rate(&self) -> f32
Returns the sample playback rate.
Sourcepub fn start_at(&self) -> f32
pub fn start_at(&self) -> f32
Returns clip start offset relative to the song or phrase placement.
Sourcepub fn track_name(&self) -> Option<&str>
pub fn track_name(&self) -> Option<&str>
Returns the explicit track name, if one was set.
Sourcepub fn effects(&self) -> &[PulseEffect]
pub fn effects(&self) -> &[PulseEffect]
Returns track-level effects in insertion order.
Sourcepub fn slice_range(&self) -> Option<(f32, f32)>
pub fn slice_range(&self) -> Option<(f32, f32)>
Returns selected source slice range, if any.
Sourcepub fn reverse(&self) -> bool
pub fn reverse(&self) -> bool
Returns whether the selected source sample range is reversed before rendering.
Sourcepub fn normalize(&self) -> bool
pub fn normalize(&self) -> bool
Returns whether the rendered source sample is normalized before final gain.
Sourcepub fn duration(&self) -> PulseResult<f32>
pub fn duration(&self) -> PulseResult<f32>
Returns rendered clip duration after sample transforms and playback rate.
Trait Implementations§
Source§impl Clone for PulseSampleClip
impl Clone for PulseSampleClip
Source§fn clone(&self) -> PulseSampleClip
fn clone(&self) -> PulseSampleClip
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PulseSampleClip
impl Debug for PulseSampleClip
Source§impl PartialEq for PulseSampleClip
impl PartialEq for PulseSampleClip
Source§fn eq(&self, other: &PulseSampleClip) -> bool
fn eq(&self, other: &PulseSampleClip) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PulseSampleClip
Source§impl UserData for PulseSampleClip
impl UserData for PulseSampleClip
Source§fn add_methods<M: UserDataMethods<Self>>(methods: &mut M)
fn add_methods<M: UserDataMethods<Self>>(methods: &mut M)
Source§fn add_fields<F>(fields: &mut F)where
F: UserDataFields<Self>,
fn add_fields<F>(fields: &mut F)where
F: UserDataFields<Self>,
Source§fn register(registry: &mut UserDataRegistry<Self>)
fn register(registry: &mut UserDataRegistry<Self>)
Auto Trait Implementations§
impl Freeze for PulseSampleClip
impl RefUnwindSafe for PulseSampleClip
impl Send for PulseSampleClip
impl Sync for PulseSampleClip
impl Unpin for PulseSampleClip
impl UnsafeUnpin for PulseSampleClip
impl UnwindSafe for PulseSampleClip
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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>
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>
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