Browse Source

Clamp cables to +/-12V

tags/v0.6.1
Andrew Belt 6 years ago
parent
commit
dcb4d53945
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      src/engine.cpp

+ 2
- 0
src/engine.cpp View File

@@ -54,6 +54,8 @@ void Light::setBrightnessSmooth(float brightness, float frames) {


void Wire::step() { void Wire::step() {
float value = outputModule->outputs[outputId].value; float value = outputModule->outputs[outputId].value;
// Assume a +/-12V power supply (like Eurorack), and prevent voltages outside the power range.
value = clamp(value, -12.f, 12.f);
inputModule->inputs[inputId].value = value; inputModule->inputs[inputId].value = value;
} }




Loading…
Cancel
Save