Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-lueders committed Oct 22, 2017
2 parents bb921e6 + 9759c7f commit 76cc86a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Counter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct Counter : Module {
NUM_PARAMS
};
enum InputIds {
MAX_INPUT,
LENGTH_INPUT,
GATE_INPUT,
START_INPUT,
STOP_INPUT,
Expand Down Expand Up @@ -59,7 +59,7 @@ void Counter::step() {
max = params[MAX_PARAM].value;


if( inputs[MAX_INPUT].active ) max = max * clampf(inputs[MAX_INPUT].value/10.0,0,1.0);
if( inputs[LENGTH_INPUT].active ) max = max * clampf(inputs[LENGTH_INPUT].value/10.0,0,1.0);

if( startTrigger.process(inputs[START_INPUT].normalize(0.0) )) {
state=true;
Expand Down Expand Up @@ -169,7 +169,7 @@ CounterWidget::CounterWidget() {
addChild(createScrew<ScrewSilver>(Vec(15, 365)));

addParam(createParam<Davies1900hSmallBlackKnob>(Vec(12, 85), module, Counter::MAX_PARAM, 0.0, 128.0, 8.0));
addInput(createInput<PJ301MPort>(Vec(53, 87), module, Counter::MAX_INPUT));
addInput(createInput<PJ301MPort>(Vec(53, 87), module, Counter::LENGTH_INPUT));

addInput(createInput<PJ301MPort>(Vec(13, 168), module, Counter::GATE_INPUT));
addOutput(createOutput<PJ301MPort>(Vec(53, 168), module, Counter::GATE_OUTPUT));
Expand Down
11 changes: 10 additions & 1 deletion src/TrigDelay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ struct TrigDelay : Module {
NUM_OUTPUTS
};

TrigDelay() : Module( NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS ) {};
TrigDelay() : Module( NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS ) {
#ifdef v_dev
gSampleRate = engineGetSampleRate();
#endif
};


void step() override;
Expand All @@ -38,6 +42,11 @@ struct TrigDelay : Module {


#ifdef v_dev

float gSampleRate;

void onSampleRateChange() { gSampleRate = engineGetSampleRate(); }

void reset() override {
#endif

Expand Down

0 comments on commit 76cc86a

Please sign in to comment.