pub struct PulseDrumGrid { /* private fields */ }Expand description
A step-based drum arrangement rendered into a tunes composition track.
Implementations§
Source§impl PulseDrumGrid
impl PulseDrumGrid
Sourcepub fn with_track(self, track_name: impl Into<String>) -> Self
pub fn with_track(self, track_name: impl Into<String>) -> Self
Sets the output track name.
Sourcepub fn with_steps(self, steps: usize) -> PulseResult<Self>
pub fn with_steps(self, steps: usize) -> PulseResult<Self>
Sourcepub fn with_step_duration(self, duration: f32) -> PulseResult<Self>
pub fn with_step_duration(self, duration: f32) -> PulseResult<Self>
Sets the duration of one grid step in beats.
§Errors
Returns an error when duration is zero, negative, or not finite.
Sourcepub fn sound(
self,
drum: impl Into<String>,
pattern: Vec<usize>,
) -> PulseResult<Self>
pub fn sound( self, drum: impl Into<String>, pattern: Vec<usize>, ) -> PulseResult<Self>
Adds a drum alias and zero-based step pattern.
§Errors
Returns an error when drum is not in the drum catalog.
Sourcepub fn accent(self, pattern: Vec<usize>) -> Self
pub fn accent(self, pattern: Vec<usize>) -> Self
Sets accent steps that raise matching drum hit velocities.
Sourcepub fn with_repeat(self, repeats: usize) -> Self
pub fn with_repeat(self, repeats: usize) -> Self
Sets additional grid repetitions after the first pass.
Sourcepub fn with_repeat_times(self, repeat_times: usize) -> PulseResult<Self>
pub fn with_repeat_times(self, repeat_times: usize) -> PulseResult<Self>
Sourcepub fn with_effect(self, effect: PulseEffect) -> Self
pub fn with_effect(self, effect: PulseEffect) -> Self
Adds a track-level effect to the drum grid.
Sourcepub fn with_volume(self, volume: f32) -> PulseResult<Self>
pub fn with_volume(self, volume: f32) -> PulseResult<Self>
Sourcepub fn with_pan(self, pan: f32) -> PulseResult<Self>
pub fn with_pan(self, pan: f32) -> PulseResult<Self>
Sourcepub fn apply_to_composition(
&self,
composition: &mut Composition,
) -> PulseResult<()>
pub fn apply_to_composition( &self, composition: &mut Composition, ) -> PulseResult<()>
Applies the grid to a composition starting at time zero.
§Errors
Returns an error when stored grid options are invalid.
Sourcepub fn apply_to_composition_at(
&self,
composition: &mut Composition,
start_at: f32,
) -> PulseResult<()>
pub fn apply_to_composition_at( &self, composition: &mut Composition, start_at: f32, ) -> PulseResult<()>
Applies the grid to a composition at an absolute start offset in beats.
§Errors
Returns an error when stored grid options are invalid.
Sourcepub fn track_name(&self) -> &str
pub fn track_name(&self) -> &str
Returns the output track name.
Sourcepub fn step_duration(&self) -> f32
pub fn step_duration(&self) -> f32
Returns the duration of one grid step in beats.
Sourcepub fn hits(&self) -> &[PulseDrumHit]
pub fn hits(&self) -> &[PulseDrumHit]
Returns all drum hit patterns.
Sourcepub fn effects(&self) -> &[PulseEffect]
pub fn effects(&self) -> &[PulseEffect]
Returns track-level effects in insertion order.
Trait Implementations§
Source§impl Clone for PulseDrumGrid
impl Clone for PulseDrumGrid
Source§fn clone(&self) -> PulseDrumGrid
fn clone(&self) -> PulseDrumGrid
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 PulseDrumGrid
impl Debug for PulseDrumGrid
Source§impl Default for PulseDrumGrid
impl Default for PulseDrumGrid
Source§impl PartialEq for PulseDrumGrid
impl PartialEq for PulseDrumGrid
Source§fn eq(&self, other: &PulseDrumGrid) -> bool
fn eq(&self, other: &PulseDrumGrid) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PulseDrumGrid
Source§impl UserData for PulseDrumGrid
impl UserData for PulseDrumGrid
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 PulseDrumGrid
impl RefUnwindSafe for PulseDrumGrid
impl Send for PulseDrumGrid
impl Sync for PulseDrumGrid
impl Unpin for PulseDrumGrid
impl UnsafeUnpin for PulseDrumGrid
impl UnwindSafe for PulseDrumGrid
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