bool Event_channel_autowah_depth_process(
        Channel* ch,
        Device_states* dstates,
        const Value* value)
{
    assert(ch != NULL);
    assert(dstates != NULL);
    (void)dstates;
    assert(value != NULL);
    assert(value->type == VALUE_TYPE_FLOAT);

    const double actual_depth = value->value.float_type / 8;
    ch->autowah_depth = actual_depth;

    for (int i = 0; i < KQT_GENERATORS_MAX; ++i)
    {
        Event_check_voice(ch, i);
        Voice_state* vs = ch->fg[i]->state;

        if (ch->autowah_speed > 0)
            LFO_set_speed(&vs->autowah, ch->autowah_speed);

        LFO_set_depth(&vs->autowah, actual_depth);
        LFO_turn_on(&vs->autowah);
    }

    return true;
}
Example #2
0
void Linear_controls_osc_depth_value(Linear_controls* lc, double depth)
{
    rassert(lc != NULL);
    rassert(isfinite(depth));

    //if (lc->osc_speed > 0)
    //    LFO_set_speed(&lc->lfo, lc->osc_speed);

    LFO_set_depth(&lc->lfo, depth);
    LFO_turn_on(&lc->lfo);

    return;
}