| @@ -239,7 +239,7 @@ struct MidiThing : Module { | |||||
| // debug only | // debug only | ||||
| bool setFrame = true; | bool setFrame = true; | ||||
| int numActiveChannels = 0; | |||||
| dsp::BooleanTrigger buttonTrigger; | dsp::BooleanTrigger buttonTrigger; | ||||
| dsp::Timer rateLimiterTimer; | dsp::Timer rateLimiterTimer; | ||||
| PORTMODE_t portModes[NUM_INPUTS] = {}; | PORTMODE_t portModes[NUM_INPUTS] = {}; | ||||
| @@ -283,7 +283,7 @@ struct MidiThing : Module { | |||||
| activeChannels.push_back(c); | activeChannels.push_back(c); | ||||
| } | } | ||||
| } | } | ||||
| const int numActiveChannels = activeChannels.size(); | |||||
| numActiveChannels = activeChannels.size(); | |||||
| // we're done if no channels are active | // we're done if no channels are active | ||||
| if (numActiveChannels == 0) { | if (numActiveChannels == 0) { | ||||
| return; | return; | ||||
| @@ -769,6 +769,9 @@ struct MidiThingWidget : ModuleWidget { | |||||
| &module->updateRateIdx)); | &module->updateRateIdx)); | ||||
| menu->addChild(createBoolPtrMenuItem("Set frame", "", &module->setFrame)); | menu->addChild(createBoolPtrMenuItem("Set frame", "", &module->setFrame)); | ||||
| float updateRate = module->updateRates[module->updateRateIdx] / module->numActiveChannels; | |||||
| menu->addChild(createMenuLabel(string::f("Midi Update rate: %.3g Hz", updateRate))); | |||||
| } | } | ||||
| }; | }; | ||||