pub fn phase<S>(step: S) -> Phase<S>where
S: Step,
Expand description
Creates a Phase
that continuously steps forward by the given step
size yielder.
ยงExample
use dasp_signal::{self as signal, Signal};
fn main() {
let step = signal::rate(4.0).const_hz(1.0);
// Note that this is the same as `step.phase()`, a composable alternative.
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);
}