MCPcopy Create free account
hub / github.com/PerroEngine/Perro / next

Method next

perro_source/audio_stack/perro_pawdio/src/dsp.rs:178–209  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

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
191impl<S> Iterator for DspSource<S>
192where
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) {

Callers 5

first_addrFunction · 0.45
query_first_nodeMethod · 0.45
normalize_href_implFunction · 0.45
split_query_args_implFunction · 0.45
bench_midiFunction · 0.45

Calls 8

apply_compressionFunction · 0.85
snapshotMethod · 0.80
apply_eqMethod · 0.80
apply_low_passMethod · 0.80
processMethod · 0.80
minMethod · 0.45
maxMethod · 0.45
clampMethod · 0.45

Tested by

no test coverage detected