[−][src]Struct dasp_signal::Rate
The rate at which phrase a Signal is sampled.
Implementations
impl Rate
[src]
pub fn const_hz(self, hz: f64) -> ConstHz
[src]
Create a ConstHz
signal which consistently yields hz / rate
.
pub fn hz<S>(self, hz: S) -> Hz<S> where
S: Signal<Frame = f64>,
[src]
S: Signal<Frame = f64>,
Create a Hz
signal which yields phase step sizes controlled by an input
signal hz
.
Example
use dasp_signal::{self as signal, Signal}; fn main() { let step = signal::rate(4.0).hz(signal::gen(|| 1.0)); let mut phase = signal::phase(step); assert_eq!(phase.next(), 0.0); assert_eq!(phase.next(), 0.25); assert_eq!(phase.next(), 0.5); assert_eq!(phase.next(), 0.75); assert_eq!(phase.next(), 0.0); assert_eq!(phase.next(), 0.25); }
Trait Implementations
impl Clone for Rate
[src]
impl Copy for Rate
[src]
impl Debug for Rate
[src]
impl PartialEq<Rate> for Rate
[src]
impl StructuralPartialEq for Rate
[src]
Auto Trait Implementations
impl RefUnwindSafe for Rate
impl Send for Rate
impl Sync for Rate
impl Unpin for Rate
impl UnwindSafe for Rate
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<S, T> Duplex<S> for T where
T: FromSample<S> + ToSample<S>,
[src]
T: FromSample<S> + ToSample<S>,
impl<T> From<T> for T
[src]
impl<S> FromSample<S> for S
[src]
fn from_sample_(s: S) -> S
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> ToSample<U> for T where
U: FromSample<T>,
[src]
U: FromSample<T>,
fn to_sample_(self) -> U
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,