mirror of
https://github.com/haileys/mixlab.git
synced 2026-02-11 23:40:40 +01:00
20 lines
306 B
Rust
20 lines
306 B
Rust
pub struct Sequence(usize);
|
|
|
|
impl Sequence {
|
|
pub fn new() -> Self {
|
|
Sequence(0)
|
|
}
|
|
|
|
pub fn next(&mut self) -> usize {
|
|
let seq = self.0;
|
|
self.0 += 1;
|
|
seq
|
|
}
|
|
}
|
|
|
|
pub fn zero(slice: &mut [f32]) {
|
|
for sample in slice.iter_mut() {
|
|
*sample = 0.0;
|
|
}
|
|
}
|