pub fn process_overlap_add<M, F>(
        &mut self,
        main_buffer: &mut M,
        window_function: &[f32],
        overlap_times: usize,
        mut process_cb: F,
    ) where
        M: StftInputMut,
        F: FnMut(usize, &mut [f32]),
    {
        self.process_overlap_add_sidechain(
            main_buffer,
            [&NoSidechain; NUM_SIDECHAIN_INPUTS],
            window_function,
            overlap_times,
            |channel_idx, sidechain_idx, real_fft_scratch_buffer| {
                if sidechain_idx.is_none() {
                    process_cb(channel_idx, real_fft_scratch_buffer);
                }
            },
        );
    }
/// Process the audio in `main_buffer` in small overlapping blocks with a window function
/// applied, adding up the results for the main buffer so they can be written back to the host.
/// The window overlap amount is compensated automatically when adding up these samples.
/// Whenever a new block is available, `process_cb()` gets called with a new audio block of the
/// specified size with the windowing function already applied. The summed reults will then be
/// written back to `main_buffer` exactly one block later, which means that this function will
/// introduce one block of latency. This can be compensated by calling
/// [`ProcessContext::set_latency()`][`crate::prelude::ProcessContext::set_latency()`] in your
/// plugin's initialization function.
///
/// This function does not apply any gain compensation for the windowing. You will need to do
/// that yoruself depending on your window function and the amount of overlap.
///
/// For efficiency's sake this function will reuse the same vector for all calls to
/// `process_cb`. This means you can only access a single channel's worth of windowed data at a
/// time. The arguments to that function are `process_cb(channel_idx, real_fft_buffer)`.
/// `real_fft_buffer` will be a slice of `block_size` real valued samples. This can be passed
/// directly to an FFT algorithm.
///
/// # Panics
///
/// Panics if `main_buffer` or the buffers in `sidechain_buffers` do not have the same number of
/// channels as this [`StftHelper`], if the sidechain buffers do not contain the same number of
/// samples as the main buffer, or if the window function does not match the block size.
///
/// TODO: Add more useful ways to do STFT and other buffered operations. I just went with this
///       approach because it's what I needed myself, but generic combinators like this could
///       also be useful for other operations.
Process the audio in `main_buffer` in small overlapping blocks with a window function
applied, adding up the results for the main buffer so they can be written back to the host.
The window overlap amount is compensated automatically when adding up these samples.
Whenever a new block is available, `process_cb()` gets called with a new audio block of the
specified size with the windowing function already applied. The summed reults will then be
written back to `main_buffer` exactly one block later, which means that this function will
introduce one block of latency.

This function does not apply any gain compensation for the windowing. You will need to do
that yoruself depending on your window function and the amount of overlap.

For efficiency's sake this function will reuse the same vector for all calls to
`process_cb`. This means you can only access a single channel's worth of windowed data at a
time.
Process the audio in ` main_buffer ` in small overlapping blocks with a window function applied adding up the results for the main buffer so they can be written back to the host . The window overlap amount is compensated automatically when adding up these samples . Whenever a new block is available ` process_cb () ` gets called with a new audio block of the specified size with the windowing function already applied . The summed reults will then be written back to ` main_buffer ` exactly one block later which means that this function will introduce one block of latency . This function does not apply any gain compensation for the windowing . You will need to do that yoruself depending on your window function and the amount of overlap . For efficiency ' s sake this function will reuse the same vector for all calls to ` process_cb ` . This means you can only access a single channel ' s worth of windowed data at a time .
pub fn process_overlap_add<M, F>(
        &mut self,
        main_buffer: &mut M,
        window_function: &[f32],
        overlap_times: usize,
        mut process_cb: F,
    ) where
        M: StftInputMut,
        F: FnMut(usize, &mut [f32]),
    {
        self.process_overlap_add_sidechain(
            main_buffer,
            [&NoSidechain; NUM_SIDECHAIN_INPUTS],
            window_function,
            overlap_times,
            |channel_idx, sidechain_idx, real_fft_scratch_buffer| {
                if sidechain_idx.is_none() {
                    process_cb(channel_idx, real_fft_scratch_buffer);
                }
            },
        );
    }
pub fn process_overlap_add < M , F > ( & mut self , main_buffer : & mut M , window_function : & [ f32 ] , overlap_times : usize , mut process_cb : F , ) where M : StftInputMut , F : FnMut ( usize , & mut [ f32 ] ) , { self . process_overlap_add_sidechain ( main_buffer , [ & NoSidechain ; NUM_SIDECHAIN_INPUTS ] , window_function , overlap_times , | channel_idx , sidechain_idx , real_fft_scratch_buffer | { if sidechain_idx . is_none ( ) { process_cb ( channel_idx , real_fft_scratch_buffer ) ; } } , ) ; }
Process the audio in `main_buffer` in small overlapping blocks with a window function
applied, adding up the results for the main buffer so they can be written back to the host.
Process the audio in ` main_buffer ` in small overlapping blocks with a window function applied adding up the results for the main buffer so they can be written back to the host .
&mut self
main_buffer
&mut M
window_function
&[f32]
overlap_times
usize
process_cb
F
&mut self
main_buffer
&mut M
window_function
&[f32]
overlap_times
usize
process_cb
F
panics
Panics if `main_buffer` or the buffers in `sidechain_buffers` do not have the same number of
channels as this [`StftHelper`], if the sidechain buffers do not contain the same number of
samples as the main buffer, or if the window function does not match the block size.

Add more useful ways to do STFT and other buffered operations. I just went with this
approach because it's what I needed myself, but generic combinators like this could
also be useful for other operations.
Panics if ` main_buffer ` or the buffers in ` sidechain_buffers ` do not have the same number of channels as this [ ` StftHelper ` ] if the sidechain buffers do not contain the same number of samples as the main buffer or if the window function does not match the block size . Add more useful ways to do STFT and other buffered operations . I just went with this approach because it ' s what I needed myself but generic combinators like this could also be useful for other operations .