MCPcopy Create free account
hub / github.com/BillyDM/Firewheel / process

Method process

crates/firewheel-nodes/src/convolution.rs:269–354  ·  view source on GitHub ↗
(
        &mut self,
        info: &ProcInfo,
        mut buffers: ProcBuffers,
        extra: &mut ProcExtra,
    )

Source from the content-addressed store, hash-verified

267 if !bypassed {
268 self.gain.reset_to_target();
269 self.declick.reset_to_target();
270
271 for c in self.convolver.iter_mut() {
272 c.reset();
273 }
274 }
275 }
276
277 fn process(
278 &mut self,
279 info: &ProcInfo,
280 mut buffers: ProcBuffers,
281 extra: &mut ProcExtra,
282 ) -> ProcessStatus {
283 let mut frames_processed = 0;
284 let mut output_silent = true;
285
286 if self.new_impulse_queued {
287 if self.declick != Declicker::SettledAt0 {
288 // Sanity check
289 assert!(self.declick.trending_towards_zero());
290
291 // Fade out the previous impulse
292 let proc_frames = self.declick.frames_left().min(info.frames);
293
294 self.convolve_block(&mut buffers, 0..proc_frames, extra);
295
296 frames_processed = proc_frames;
297 output_silent = false;
298 }
299
300 if self.declick == Declicker::SettledAt0 {
301 // Finished fading out old impulse, replace with new one
302
303 if let Some(s) = &self.params.impulse_response {
304 if s.num_channels().get() < self.convolver.len() {
305 // Assume a mono impulse response and set it to all channels.
306 let impulse_slice = s.channel(0).unwrap();
307
308 for c in self.convolver.iter_mut() {
309 c.set_response(impulse_slice).unwrap();
310
311 if !self.did_init_first_impulse {
312 c.reset();
313 }
314 }
315 } else {
316 for (ch_i, c) in self.convolver.iter_mut().enumerate() {
317 c.set_response(s.channel(ch_i).unwrap()).unwrap();
318
319 if !self.did_init_first_impulse {
320 c.reset();
321 }
322 }
323 }
324
325 self.did_init_first_impulse = true;
326 self.has_impulse = true;

Callers 1

convolve_blockMethod · 0.45

Calls 11

minMethod · 0.80
frames_leftMethod · 0.80
convolve_blockMethod · 0.80
fade_to_1Method · 0.80
is_channel_silentMethod · 0.80
getMethod · 0.45
num_channelsMethod · 0.45
channelMethod · 0.45
resetMethod · 0.45
reset_to_targetMethod · 0.45

Tested by

no test coverage detected