[][src]Struct open_sound_module::sequencer::NoiseSequencer

pub struct NoiseSequencer { /* fields omitted */ }

NoiseSequencer generates a sequence of CvMessages representing random noise.

use open_sound_module::OscMessageSequencer;
use open_sound_module::NoiseSequencer;
use open_sound_module::CvAddress;
use std::time;

fn main() -> Result<(), failure::Error> {
    let seconds = time::Duration::from_secs(1);
    let mut noise = NoiseSequencer::new(CvAddress::A, 0, 4.0, seconds);
    let _msg = noise.next();
    let _delay = noise.delay();
    Ok(())  
}

Methods

impl NoiseSequencer[src]

Important traits for NoiseSequencer
pub fn new(
    addr: CvAddress,
    seed: u64,
    rate: f64,
    duration: Duration
) -> NoiseSequencer
[src]

Create a new NoiseSequencer from a CvAddress, a random seed, a rate, and a duration. The rate is a sample rate that is used to determine the delay between messages. For exampe, a sample rate of 4.0 will cause the OscSeq to wait 250ms between messages for a rate of 4 messages a second.

Trait Implementations

impl OscMessageSequencer for NoiseSequencer[src]

fn delay(&self) -> Duration[src]

Return the duration the sequencer should wait between messages.

impl Iterator for NoiseSequencer[src]

type Item = OscMessage

The type of the elements being iterated over.

fn next(&mut self) -> Option<Self::Item>[src]

Yield the next message in the sequence.

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<S> FromSample<S> for S[src]

impl<T, U> ToSample<U> for T where
    U: FromSample<T>, 
[src]

impl<S, T> Duplex<S> for T where
    T: FromSample<S> + ToSample<S>, 
[src]