note-switcher

gabbapeople/barrel-organ/note-switcher

No description
note-switcher
@/note-switcher
TRACKnumber
CHboolean
note-switcher
TRACK
CH
T1
T2
T3
T3boolean
T2boolean
T1boolean
To use the node in your project you should have the gabbapeople/barrel-organ 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

struct State {
};

{{ GENERATED_CODE }}

void evaluate(Context ctx) {
    bool channel = getValue<input_CH>(ctx);
    int track = getValue<input_TRACK>(ctx);

    if (channel) {
        switch(track) {
            case 1:
                emitValue<output_T1>(ctx, true);
                emitValue<output_T2>(ctx, false);
                emitValue<output_T3>(ctx, false);
                break;
            case 2:
                emitValue<output_T1>(ctx, false);
                emitValue<output_T2>(ctx, true);
                emitValue<output_T3>(ctx, false);
                break;
            case 3:
                emitValue<output_T1>(ctx, false);
                emitValue<output_T2>(ctx, false);
                emitValue<output_T3>(ctx, true);
                break;
        }
    } else {
        emitValue<output_T1>(ctx, false);
        emitValue<output_T2>(ctx, false);
        emitValue<output_T3>(ctx, false);
    }
}