Browse Source

Tweak components of ADSR, Sum, Viz, and WTVCO. Fix freq knob of VCO.

tags/v2.0.1
Andrew Belt 3 years ago
parent
commit
39150b7652
5 changed files with 9 additions and 7 deletions
  1. +2
    -0
      src/ADSR.cpp
  2. +1
    -1
      src/Sum.cpp
  3. +2
    -2
      src/VCO.cpp
  4. +1
    -1
      src/Viz.cpp
  5. +3
    -3
      src/WTVCO.cpp

+ 2
- 0
src/ADSR.cpp View File

@@ -213,6 +213,8 @@ struct ADSRDisplay : LedDisplay {
float decay = std::pow(decayLambda, -power);
float release = std::pow(releaseLambda, -power);
float totalLambda = attack + decay + release;
if (totalLambda == 0.f)
return;

Rect r = box.zeroPos().shrink(Vec(4, 5));
Vec p0 = r.getBottomLeft();


+ 1
- 1
src/Sum.cpp View File

@@ -126,7 +126,7 @@ struct SumWidget : ModuleWidget {

addOutput(createOutputCentered<PJ301MPort>(mm2px(Vec(7.62, 113.066)), module, Sum::MONO_OUTPUT));

SumDisplay* display = createWidget<SumDisplay>(mm2px(Vec(0.0, 12.834)));
SumDisplay* display = createWidget<SumDisplay>(mm2px(Vec(0.0, 13.039)));
display->box.size = mm2px(Vec(15.241, 36.981));
display->module = module;
addChild(display);


+ 2
- 2
src/VCO.cpp View File

@@ -58,7 +58,7 @@ struct VoltageControlledOscillator {

void process(float deltaTime, T syncValue) {
// Advance phase
T deltaPhase = simd::clamp(freq * deltaTime, 1e-6f, 0.35f);
T deltaPhase = simd::clamp(freq * deltaTime, 0.f, 0.35f);
if (soft) {
// Reverse direction
deltaPhase *= syncDirection;
@@ -320,7 +320,7 @@ struct VCO : Module {
oscillator.soft = soft;

// Get frequency
float_4 pitch = freqParam / 12.f + inputs[PITCH_INPUT].getPolyVoltageSimd<float_4>(c);
float_4 pitch = freqParam + inputs[PITCH_INPUT].getPolyVoltageSimd<float_4>(c);
float_4 freq;
if (!linear) {
pitch += inputs[FM_INPUT].getPolyVoltageSimd<float_4>(c) * fmParam;


+ 1
- 1
src/Viz.cpp View File

@@ -104,7 +104,7 @@ struct VizWidget : ModuleWidget {

addInput(createInputCentered<PJ301MPort>(mm2px(Vec(7.62, 113.115)), module, Viz::POLY_INPUT));

VizDisplay* display = createWidget<VizDisplay>(mm2px(Vec(0.003, 13.039)));
VizDisplay* display = createWidget<VizDisplay>(mm2px(Vec(0.0, 13.039)));
display->box.size = mm2px(Vec(15.237, 89.344));
display->module = module;
addChild(display);


+ 3
- 3
src/WTVCO.cpp View File

@@ -243,9 +243,9 @@ struct WTVCO : Module {
// Light
if (lightDivider.process()) {
if (channels == 1) {
float b = 1.f - phases[0][0];
lights[PHASE_LIGHT + 0].setSmoothBrightness(b, args.sampleTime * lightDivider.getDivision());
lights[PHASE_LIGHT + 1].setBrightness(0.f);
float b = std::sin(2 * M_PI * phases[0][0]);
lights[PHASE_LIGHT + 0].setSmoothBrightness(-b, args.sampleTime * lightDivider.getDivision());
lights[PHASE_LIGHT + 1].setSmoothBrightness(b, args.sampleTime * lightDivider.getDivision());
lights[PHASE_LIGHT + 2].setBrightness(0.f);
}
else {


Loading…
Cancel
Save