pulse-on-change(boolean)

xod/core/pulse-on-change(boolean)

Emits a pulse every time input value changes.
pulse-on-change(boolean)
@/pulse-on-change(boolean)
Emits a pulse every time input value changes.
INboolean
pulse-on-change(boolean)
IN
OUT
OUTpulse

C++ implementation

node {
    bool sample = false;

    void evaluate(Context ctx) {
        int8_t newValue = (int8_t) getValue<input_IN>(ctx);

        if (!isSettingUp() && newValue != sample)
            emitValue<output_OUT>(ctx, 1);

        sample = newValue;
    }
}

Tabular tests

INOUT
falseno-pulse
truepulse
trueno-pulse
falsepulse
falseno-pulse
truepulse