modified-buffer

hjlab/hachan-lab1/modified-buffer

No description
modified-buffer
@/modified-buffer
NEWgeneric t2
UPDpulse
Saves `NEW` value in memory
Rstoutgeneric t1
RSTpulse
modified-buffer
NEW
UPD
Rstout
RST
MEM
MEMgeneric t3
To use the node in your project you should have the hjlab/hachan-lab1 library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

node {
    void evaluate(Context ctx) {
        // Read inputs
        int input1 = getValue<input_NEW>(ctx);
        XString input2 = getValue<input_Rstout>(ctx);
        
        // Choose which input to forward based on selection
        bool useInput1 = getValue<input_NEW>(ctx);
        
        // Emit the selected input value as output
        if (useInput1) {
            emitValue<output>(ctx, input1);
        } else {
            emitValue<output>(ctx, input2);
        }
    }
}