[][src]Struct open_sound_module::sequencer::SineSequencer

pub struct SineSequencer { /* fields omitted */ }

SineSequencer generates a sequence of CvMessages representing a sine wave.

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

Methods

impl SineSequencer[src]

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

Create a new SineSequencer from a CvAddress, a rate and a hertz. 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 SineSequencer[src]

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

Return the duration the sequence should wait between messages.

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