Files
xod/workspace/big-patch/play-note/patch.cpp
2019-12-17 13:27:36 +03:00

18 lines
334 B
C++

struct State {
};
{{ GENERATED_CODE }}
void evaluate(Context ctx) {
if (!isInputDirty<input_UPD>(ctx)) return;
auto pin = getValue<input_PIN>(ctx);
auto frequency = getValue<input_FREQ>(ctx);
auto duration = getValue<input_DUR>(ctx);
tone(pin, frequency);
delay(duration*1000);
noTone(pin);
}