Browse Source

Mex: gate in acts as a SchmittTrigger

Muxlicer: removed leftover debug message
tags/v2.1.0
hemmer 3 years ago
parent
commit
0da2c26254
3 changed files with 14 additions and 6 deletions
  1. +1
    -1
      README.md
  2. +12
    -1
      src/Mex.cpp
  3. +1
    -4
      src/Muxlicer.cpp

+ 1
- 1
README.md View File

@@ -15,4 +15,4 @@ We have tried to make the VCV implementations as authentic as possible, however

* Chopping Kinky hardward is DC coupled, but we add the option (default disabled) to remove this offset.

* The hardware Muxlicer assigns multiple functions to the "Speed Div/Mult" dial, that cannot be reproduced with a single mouse click. Some of these have been moved to the context menu, specifically: quadratic gates, the "All In" normalled voltage, and the output clock division/mult.
* The hardware Muxlicer assigns multiple functions to the "Speed Div/Mult" dial, that cannot be reproduced with a single mouse click. Some of these have been moved to the context menu, specifically: quadratic gates, the "All In" normalled voltage, and the input/output clock division/mult. The "Speed Div/Mult" dial remains only as a tap-tempo button.

+ 12
- 1
src/Mex.cpp View File

@@ -25,6 +25,7 @@ struct Mex : Module {
};

MexMessage leftMessages[2] = {};
dsp::SchmittTrigger gateInTrigger;

Mex() {
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
@@ -57,7 +58,17 @@ struct Mex : Module {
gate = message->allGates;
}
else if (state == GATE_IN_MODE) {
gate = inputs[GATE_IN_INPUT].getNormalVoltage(message->outputClock);
// gate in will convert non-gate signals to gates (via schmitt trigger)
// if input is present
if (inputs[GATE_IN_INPUT].isConnected()) {
gateInTrigger.process(inputs[GATE_IN_INPUT].getVoltage());
gate = 10.f * gateInTrigger.isHigh();
}
// otherwise the main Muxlicer output clock (including divisions/multiplications)
// is normalled in
else {
gate = message->outputClock;
}
}

lights[currentStep].setBrightness(gate);


+ 1
- 4
src/Muxlicer.cpp View File

@@ -432,10 +432,7 @@ struct Muxlicer : Module {
const float stepVolume = params[LEVEL_PARAMS + addressIndex].getValue();
for (int c = 0; c < numActiveEngines; c += 4) {
const float_4 allInValue = inputs[ALL_INPUT].getNormalPolyVoltageSimd<float_4>((float_4) allInNormalVoltage, c);
const float_4 stepValue = inputs[MUX_INPUTS + addressIndex].getNormalPolyVoltageSimd<float_4>(allInValue, c) * stepVolume;
if (c == 0) {
DEBUG(string::f("%f %f %d", allInValue[0], stepValue[0], addressIndex).c_str());
}
const float_4 stepValue = inputs[MUX_INPUTS + addressIndex].getNormalPolyVoltageSimd<float_4>(allInValue, c) * stepVolume;
outputs[COM_OUTPUT].setVoltageSimd(stepValue, c);
}
outputs[COM_OUTPUT].setChannels(numActiveEngines);


Loading…
Cancel
Save