Skip to content

Commit 866b9e6

Browse files
committed
Cascade: add json overrides to start envelopes on load
1 parent d9b24a2 commit 866b9e6

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

src/funcgen.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,24 @@ struct Funcgen : Module {
397397
start_cycle();
398398
}
399399
}
400+
401+
void dataFromJson(json_t *rootJ) override {
402+
DEBUG("dataFromJson");
403+
for (int i = 0; i < CHANNEL_COUNT; i++) {
404+
if (params[LOOP_PARAM + i].getValue() > 0.5f) {
405+
envelope[i].trigger();
406+
}
407+
}
408+
if (params[CASCADE_LOOP_PARAM].getValue() > 0.5f) {
409+
start_cycle();
410+
}
411+
}
412+
413+
json_t *dataToJson() override {
414+
DEBUG("dataToJson");
415+
json_t *rootJ = json_object();
416+
return rootJ;
417+
}
400418
};
401419

402420

0 commit comments

Comments
 (0)