pub struct NoteExpressionCurve<I> { /* private fields */ }
Expand description
A note expression curve is a series of NoteExpressionPoint
s over a buffer.
Note that the following invariants will hold:
- The number of points is at least 1
- The points are sorted by time
- The time of the first point is 0
Between points, the value the expression is constant - this makes it
different from [conformal_component::parameters::PiecewiseLinearCurve
],
where the value is linearly interpolated between points.
Implementations§
Source§impl<I: Iterator<Item = NoteExpressionPoint> + Clone> NoteExpressionCurve<I>
impl<I: Iterator<Item = NoteExpressionPoint> + Clone> NoteExpressionCurve<I>
Sourcepub fn iter_by_sample(self) -> impl Iterator<Item = NoteExpressionState> + Clone
pub fn iter_by_sample(self) -> impl Iterator<Item = NoteExpressionState> + Clone
Creates an iterator that yields the note expression state for each sample
Source§impl<I: Iterator<Item = NoteExpressionPoint> + Clone> NoteExpressionCurve<I>
impl<I: Iterator<Item = NoteExpressionPoint> + Clone> NoteExpressionCurve<I>
Sourcepub fn new(points: I) -> Option<Self>
pub fn new(points: I) -> Option<Self>
Creates a new note expression curve from an iterator of points.
Returns None
if the curve does not satisfy the invariants described
in the documentation for NoteExpressionCurve
.
Trait Implementations§
Source§impl<I: Clone> Clone for NoteExpressionCurve<I>
impl<I: Clone> Clone for NoteExpressionCurve<I>
Source§fn clone(&self) -> NoteExpressionCurve<I>
fn clone(&self) -> NoteExpressionCurve<I>
Returns a copy 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 moreSource§impl<I: Debug> Debug for NoteExpressionCurve<I>
impl<I: Debug> Debug for NoteExpressionCurve<I>
Source§impl<I: Iterator<Item = NoteExpressionPoint>> IntoIterator for NoteExpressionCurve<I>
impl<I: Iterator<Item = NoteExpressionPoint>> IntoIterator for NoteExpressionCurve<I>
Auto Trait Implementations§
impl<I> Freeze for NoteExpressionCurve<I>where
I: Freeze,
impl<I> RefUnwindSafe for NoteExpressionCurve<I>where
I: RefUnwindSafe,
impl<I> Send for NoteExpressionCurve<I>where
I: Send,
impl<I> Sync for NoteExpressionCurve<I>where
I: Sync,
impl<I> Unpin for NoteExpressionCurve<I>where
I: Unpin,
impl<I> UnwindSafe for NoteExpressionCurve<I>where
I: UnwindSafe,
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