Browse Source

Use odd prime number for port frame divider so plug lights get a more diverse statistical sample of voltages.

tags/v2.0.6
Andrew Belt 2 years ago
parent
commit
e0a78e0a27
1 changed files with 3 additions and 4 deletions
  1. +3
    -4
      src/engine/Module.cpp

+ 3
- 4
src/engine/Module.cpp View File

@@ -12,7 +12,7 @@ namespace rack {
namespace engine {


static const int PORT_DIVIDER = 7;
// Arbitrary prime number so it doesn't over- or under-estimate time of buffered processors.
static const int METER_DIVIDER = 37;
static const int METER_BUFFER_LEN = 32;
@@ -373,9 +373,8 @@ void Module::doProcess(const ProcessArgs& args) {
}

// Iterate ports to step plug lights
const int portDivider = 8;
if (args.frame % portDivider == 0) {
float portTime = args.sampleTime * portDivider;
if (args.frame % PORT_DIVIDER == 0) {
float portTime = args.sampleTime * PORT_DIVIDER;
for (Input& input : inputs) {
Port_step(&input, portTime);
}


Loading…
Cancel
Save