pub struct Pattern { /* private fields */ }
Expand description
A musical pattern that can be shared between nodes
Implementations§
Source§impl Pattern
impl Pattern
Sourcepub const fn chord_class(&self) -> Triads
pub const fn chord_class(&self) -> Triads
returns a copy of the pattern’s class
Sourcepub fn pattern_id(&self) -> &str
pub fn pattern_id(&self) -> &str
returns a copy of the pattern’s id
Sourcepub const fn source_node(&self) -> NodeId
pub const fn source_node(&self) -> NodeId
returns a copy of the pattern’s source node
Sourcepub fn set_chord_class(&mut self, chord_class: Triads)
pub fn set_chord_class(&mut self, chord_class: Triads)
set the pattern to the given class
Sourcepub fn set_pattern_id(&mut self, pattern_id: String)
pub fn set_pattern_id(&mut self, pattern_id: String)
set the pattern to the given id
Sourcepub fn set_output(&mut self, output: f32)
pub fn set_output(&mut self, output: f32)
set the pattern to the given output
Sourcepub fn set_source_node(&mut self, source_node: NodeId)
pub fn set_source_node(&mut self, source_node: NodeId)
set the pattern to the given source node
Sourcepub fn with_chord_class(self, class: Triads) -> Self
pub fn with_chord_class(self, class: Triads) -> Self
consumes the current instance to create another with the given class
Sourcepub fn with_pattern_id(self, pattern_id: String) -> Self
pub fn with_pattern_id(self, pattern_id: String) -> Self
consumes the current instance to create another with the given id
Sourcepub fn with_input(self, input: [f32; 3]) -> Self
pub fn with_input(self, input: [f32; 3]) -> Self
consumes the current instance to create another with the given input
Sourcepub fn with_output(self, output: f32) -> Self
pub fn with_output(self, output: f32) -> Self
consumes the current instance to create another with the given output
Sourcepub fn with_source_node(self, source_node: NodeId) -> Self
pub fn with_source_node(self, source_node: NodeId) -> Self
consumes the current instance to create another with the given source node
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Pattern
impl<'de> Deserialize<'de> for Pattern
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Pattern
Auto Trait Implementations§
impl Freeze for Pattern
impl RefUnwindSafe for Pattern
impl Send for Pattern
impl Sync for Pattern
impl Unpin for Pattern
impl UnwindSafe for Pattern
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<A, B, C> PercentDifference<B> for A
impl<A, B, C> PercentDifference<B> for A
type Output = C
Source§fn percent_diff(self, rhs: B) -> <A as PercentDifference<B>>::Output
fn percent_diff(self, rhs: B) -> <A as PercentDifference<B>>::Output
Computes the percent difference between two values.