Implement the reset function everywhere

This commit is contained in:
Robbert van der Helm
2022-03-08 00:42:58 +01:00
parent 70d3b5d557
commit fd8bd025c8
5 changed files with 27 additions and 16 deletions

View File

@@ -125,6 +125,12 @@ impl Plugin for Sine {
true
}
fn reset(&mut self) {
self.phase = 0.0;
self.midi_note_freq = 1.0;
self.midi_note_gain.reset(0.0);
}
fn process(&mut self, buffer: &mut Buffer, context: &mut impl ProcessContext) -> ProcessStatus {
let mut next_event = context.next_midi_event();
for (sample_id, channel_samples) in buffer.iter_mut().enumerate() {