[][src]Struct open_sound_module::sequencer::SawSequencer

pub struct SawSequencer { /* fields omitted */ }

SawSequencer generates a sequence of CvMessages representing a saw wave.

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

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

Methods

impl SawSequencer[src]

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

Create a new SawSequencer from a CvAddress, a rate a hertz 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 sequencer to wait 250ms between messages for a rate of 4 messages a second.

Trait Implementations

impl OscMessageSequencer for SawSequencer[src]

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

Return the duration the sequence should wait between messages.

impl Iterator for SawSequencer[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]