buffer

xod/core/buffer

Permanently holds a single value
buffer
@/buffer
Permanently holds a single value
NEWgeneric t1
A value to store
UPDpulse
Saves `NEW` value in memory
buffer
NEW
UPD
MEM
MEMgeneric t1
The latest saved value

C++ implementation

#pragma XOD evaluate_on_pin disable
#pragma XOD evaluate_on_pin enable input_UPD

node {
    void evaluate(Context ctx) {
        if (!isInputDirty<input_UPD>(ctx))
            return;

        emitValue<output_MEM>(ctx, getValue<input_NEW>(ctx));
    }
}