(&mut self)
| 176 | wet_active: false, |
| 177 | low_state: vec![0.0; channels], |
| 178 | eq_low_state: vec![0.0; channels], |
| 179 | eq_high_prev_in: vec![0.0; channels], |
| 180 | eq_high_prev_out: vec![0.0; channels], |
| 181 | echo: initially_wet |
| 182 | .then(|| DelayLine::new(delay_len(sample_rate, channels, 0.18), 0.32)), |
| 183 | reverb_a: initially_wet |
| 184 | .then(|| DelayLine::new(delay_len(sample_rate, channels, 0.047), 0.62)), |
| 185 | reverb_b: initially_wet |
| 186 | .then(|| DelayLine::new(delay_len(sample_rate, channels, 0.071), 0.54)), |
| 187 | } |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | impl<S> Iterator for DspSource<S> |
| 192 | where |
| 193 | S: Source<Item = f32>, |
| 194 | { |
| 195 | type Item = f32; |
| 196 | |
| 197 | fn next(&mut self) -> Option<Self::Item> { |
| 198 | let input = self.input.next()?; |
| 199 | // First call (counter 0) always snapshots; refresh every N samples. |
| 200 | if self.param_counter == 0 { |
| 201 | self.params = self.control.snapshot(); |
| 202 | } |
| 203 | self.param_counter += 1; |
| 204 | if self.param_counter >= PARAM_REFRESH_SAMPLES { |
| 205 | self.param_counter = 0; |
| 206 | } |
| 207 | let params = self.params; |
| 208 | let ch = self.channel_index.min(self.channels - 1); |
| 209 | let mut sample = input; |
| 210 | |
| 211 | // Unity EQ is an identity passthrough; skip the two filter updates. |
| 212 | if !eq_is_dry(params.eq) { |
no test coverage detected