Example #1
0
static void Freeverb_state_reset(
        Freeverb_state* fstate,
        const DSP_freeverb* freeverb)
{
    assert(fstate != NULL);
    assert(freeverb != NULL);

    for (int i = 0; i < FREEVERB_COMBS; ++i)
    {
        Freeverb_comb_clear(fstate->comb_left[i]);
        Freeverb_comb_clear(fstate->comb_right[i]);
    }

    for (int i = 0; i < FREEVERB_ALLPASSES; ++i)
    {
        Freeverb_allpass_clear(fstate->allpass_left[i]);
        Freeverb_allpass_clear(fstate->allpass_right[i]);
    }

    for (int i = 0; i < FREEVERB_COMBS; ++i)
    {
        assert(fstate->comb_left[i] != NULL);
        assert(fstate->comb_right[i] != NULL);
        Freeverb_comb_set_feedback(fstate->comb_left[i], freeverb->reflect1);
        Freeverb_comb_set_feedback(fstate->comb_right[i], freeverb->reflect1);
        Freeverb_comb_set_damp(fstate->comb_left[i], freeverb->damp1);
        Freeverb_comb_set_damp(fstate->comb_right[i], freeverb->damp1);
    }

    for (int i = 0; i < FREEVERB_ALLPASSES; ++i)
    {
        assert(fstate->allpass_left[i] != NULL);
        assert(fstate->allpass_right[i] != NULL);
        Freeverb_allpass_set_feedback(fstate->allpass_left[i], 0.5);
        Freeverb_allpass_set_feedback(fstate->allpass_right[i], 0.5);
    }

    return;
}
Example #2
0
static void Freeverb_pstate_reset(Device_state* dstate)
{
    assert(dstate != NULL);

    Freeverb_pstate* fstate = (Freeverb_pstate*)dstate;

    for (int ch = 0; ch < 2; ++ch)
    {
        for (int i = 0; i < FREEVERB_COMBS; ++i)
        {
            Freeverb_comb_clear(fstate->combs[ch][i]);
        }

        for (int i = 0; i < FREEVERB_ALLPASSES; ++i)
        {
            Freeverb_allpass_clear(fstate->allpasses[ch][i]);
            Freeverb_allpass_set_feedback(fstate->allpasses[ch][i], 0.5);
        }
    }

    return;
}