Browse Source

Clean up component names. Remove tinting for LED-like displays when rack brightness is decreased.

tags/v2.0.1
Andrew Belt 3 years ago
parent
commit
7f0f08e934
13 changed files with 64 additions and 44 deletions
  1. +6
    -2
      src/LFO.cpp
  2. +1
    -1
      src/Mutes.cpp
  3. +5
    -2
      src/Octave.cpp
  4. +1
    -1
      src/Pulses.cpp
  5. +4
    -0
      src/Quantizer.cpp
  6. +3
    -0
      src/Scope.cpp
  7. +5
    -5
      src/SequentialSwitch.cpp
  8. +7
    -7
      src/Unity.cpp
  9. +23
    -19
      src/VCA.cpp
  10. +1
    -1
      src/VCF.cpp
  11. +4
    -4
      src/VCMixer.cpp
  12. +2
    -2
      src/VCO.cpp
  13. +2
    -0
      src/Viz.cpp

+ 6
- 2
src/LFO.cpp View File

@@ -132,6 +132,8 @@ struct LFO : Module {
configOutput(TRI_OUTPUT, "Triangle");
configOutput(SAW_OUTPUT, "Sawtooth");
configOutput(SQR_OUTPUT, "Square");
configLight(PHASE_LIGHT, "Phase");
lightInfos[PHASE_LIGHT]->description = "Tracks the sine output.\nGreen if positive, red if negative, blue if polyphonic.";

lightDivider.setDivision(16);
}
@@ -272,8 +274,10 @@ struct LFO2 : Module {
configParam(FM_PARAM, 0.f, 1.f, 1.f, "Frequency modulation", "%", 0.f, 100.f);
configInput(FM_INPUT, "Frequency modulation");
configInput(RESET_INPUT, "Reset");
configInput(WAVE_INPUT, "Wave");
configOutput(INTERP_OUTPUT, "Out");
configInput(WAVE_INPUT, "Wave type");
configOutput(INTERP_OUTPUT, "Audio");
configLight(PHASE_LIGHT, "Phase");
lightInfos[PHASE_LIGHT]->description = "Tracks the sine output.\nGreen if positive, red if negative, blue if polyphonic.";

lightDivider.setDivision(16);
}


+ 1
- 1
src/Mutes.cpp View File

@@ -25,7 +25,7 @@ struct Mutes : Module {
Mutes() {
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
for (int i = 0; i < 10; i++) {
configParam(MUTE_PARAMS + i, 0.0, 1.0, 0.0, string::f("Row %d mute", i + 1));
configButton(MUTE_PARAMS + i, string::f("Row %d mute", i + 1));
configInput(IN_INPUTS + i, string::f("Row %d", i + 1));
configOutput(OUT_OUTPUTS + i, string::f("Row %d", i + 1));
}


+ 5
- 2
src/Octave.cpp View File

@@ -23,8 +23,8 @@ struct Octave : Module {
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
configParam(OCTAVE_PARAM, -4.f, 4.f, 0.f, "Octave shift");
configInput(PITCH_INPUT, "Pitch");
configInput(OCTAVE_INPUT, "Octave shift");
configOutput(PITCH_OUTPUT, "Octave-shifted pitch");
configInput(OCTAVE_INPUT, "Octave shift CV");
configOutput(PITCH_OUTPUT, "Pitch");
}

void process(const ProcessArgs& args) override {
@@ -64,6 +64,9 @@ struct OctaveButton : Widget {
if (pq)
activeOctave = std::round(pq->getValue());

// Disable tinting when rack brightness is decreased
nvgGlobalAlpha(args.vg, 1.0);

if (activeOctave == octave) {
// Enabled
nvgBeginPath(args.vg);


+ 1
- 1
src/Pulses.cpp View File

@@ -25,7 +25,7 @@ struct Pulses : Module {
Pulses() {
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
for (int i = 0; i < 10; i++) {
configParam(TAP_PARAMS + i, 0.f, 1.f, 0.f, string::f("Row %d tap", i + 1));
configButton(TAP_PARAMS + i, string::f("Row %d button", i + 1));
configOutput(TRIG_OUTPUTS + i, string::f("Row %d trigger", i + 1));
configOutput(GATE_OUTPUTS + i, string::f("Row %d gate", i + 1));
}


+ 4
- 0
src/Quantizer.cpp View File

@@ -127,6 +127,10 @@ struct QuantizerButton : OpaqueWidget {
void draw(const DrawArgs& args) override {
const float margin = mm2px(1.5);
Rect r = box.zeroPos().grow(Vec(margin, margin / 2).neg());

// Disable tinting when rack brightness is decreased
nvgGlobalAlpha(args.vg, 1.0);

nvgBeginPath(args.vg);
nvgRect(args.vg, RECT_ARGS(r));
if (module ? module->playingNotes[note] : (note == 0)) {


+ 3
- 0
src/Scope.cpp View File

@@ -299,6 +299,9 @@ struct ScopeDisplay : TransparentWidget {
if (!module)
return;

// Disable tinting when rack brightness is decreased
nvgGlobalAlpha(args.vg, 1.0);

float gainX = std::pow(2.f, std::round(module->params[Scope::X_SCALE_PARAM].getValue())) / 10.f;
float gainY = std::pow(2.f, std::round(module->params[Scope::Y_SCALE_PARAM].getValue())) / 10.f;
float offsetX = module->params[Scope::X_POS_PARAM].getValue();


+ 5
- 5
src/SequentialSwitch.cpp View File

@@ -31,22 +31,22 @@ struct SequentialSwitch : Module {

SequentialSwitch() {
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
configParam(STEPS_PARAM, 0.0, 2.0, 0.0, "Steps", "", 0, -1, 4);
configSwitch(STEPS_PARAM, 0.0, 2.0, 0.0, "Steps", {"2", "3", "4"});
configInput(CLOCK_INPUT, "Clock");
configInput(RESET_INPUT, "Reset");
if (INPUTS == 1) {
configInput(IN_INPUTS + 0, "In");
configInput(IN_INPUTS + 0, "Main");
}
else {
for (int i = 0; i < INPUTS; i++)
configInput(IN_INPUTS + i, string::f("Ch %d", i + 1));
configInput(IN_INPUTS + i, string::f("Channel %d", i + 1));
}
if (OUTPUTS == 1) {
configOutput(OUT_OUTPUTS + 0, "Out");
configOutput(OUT_OUTPUTS + 0, "Main");
}
else {
for (int i = 0; i < OUTPUTS; i++)
configOutput(OUT_OUTPUTS + i, string::f("Ch %d", i + 1));
configOutput(OUT_OUTPUTS + i, string::f("Channel %d", i + 1));
}

for (int i = 0; i < 4; i++) {


+ 7
- 7
src/Unity.cpp View File

@@ -29,17 +29,17 @@ struct Unity : Module {

Unity() {
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
configSwitch(AVG1_PARAM, 0.0, 1.0, 0.0, "Ch 1 mode", {"Sum", "Average"});
configSwitch(AVG2_PARAM, 0.0, 1.0, 0.0, "Ch 2 mode", {"Sum", "Average"});
configSwitch(AVG1_PARAM, 0.0, 1.0, 0.0, "Channel 1 mode", {"Sum", "Average"});
configSwitch(AVG2_PARAM, 0.0, 1.0, 0.0, "Channel 2 mode", {"Sum", "Average"});
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 6; j++) {
configInput(IN_INPUTS + i * 6 + j, string::f("In %d ch %d", i + 1, j + 1));
configInput(IN_INPUTS + i * 6 + j, string::f("Channel %d #%d", i + 1, j + 1));
}
}
configOutput(MIX1_OUTPUT, "Mix 1");
configOutput(INV1_OUTPUT, "Inverse mix 1");
configOutput(MIX2_OUTPUT, "Mix 2");
configOutput(INV2_OUTPUT, "Inverse mix 2");
configOutput(MIX1_OUTPUT, "Channel 1 mix");
configOutput(INV1_OUTPUT, "Channel 1 inverse mix");
configOutput(MIX2_OUTPUT, "Channel 2 mix");
configOutput(INV2_OUTPUT, "Channel 2 inverse mix");

lightDivider.setDivision(256);
}


+ 23
- 19
src/VCA.cpp View File

@@ -24,16 +24,16 @@ struct VCA : Module {

VCA() {
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS);
configParam(LEVEL1_PARAM, 0.0, 1.0, 1.0, "Ch 1 level", "%", 0, 100);
configParam(LEVEL2_PARAM, 0.0, 1.0, 1.0, "Ch 2 level", "%", 0, 100);
configInput(EXP1_INPUT, "Exponential CV 1");
configInput(LIN1_INPUT, "Linear CV 1");
configInput(IN1_INPUT, "In 1");
configInput(EXP2_INPUT, "Exponential CV 2");
configInput(LIN2_INPUT, "Linear CV 2");
configInput(IN2_INPUT, "In 2");
configOutput(OUT1_OUTPUT, "Out 1");
configOutput(OUT2_OUTPUT, "Out 2");
configParam(LEVEL1_PARAM, 0.0, 1.0, 1.0, "Channel 1 level", "%", 0, 100);
configParam(LEVEL2_PARAM, 0.0, 1.0, 1.0, "Channel 2 level", "%", 0, 100);
configInput(EXP1_INPUT, "Channel 1 exponential CV");
configInput(EXP2_INPUT, "Channel 2 exponential CV");
configInput(LIN1_INPUT, "Channel 1 linear CV");
configInput(LIN2_INPUT, "Channel 2 linear CV");
configInput(IN1_INPUT, "Channel 1");
configInput(IN2_INPUT, "Channel 2");
configOutput(OUT1_OUTPUT, "Channel 1");
configOutput(OUT2_OUTPUT, "Channel 2");
}

void processChannel(Input& in, Param& level, Input& lin, Input& exp, Output& out) {
@@ -159,7 +159,6 @@ struct VCA_1 : Module {
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
configParam(LEVEL_PARAM, 0.0, 1.0, 1.0, "Level", "%", 0, 100);
configSwitch(EXP_PARAM, 0.0, 1.0, 1.0, "Response mode", {"Exponential", "Linear"});

}

void process(const ProcessArgs& args) override {
@@ -206,6 +205,9 @@ struct VCA_1VUKnob : SliderKnob {
nvgFillColor(args.vg, nvgRGB(0, 0, 0));
nvgFill(args.vg);

// Disable tinting when rack brightness is decreased
nvgGlobalAlpha(args.vg, 1.0);

const Vec margin = Vec(3, 3);
Rect r = box.zeroPos().grow(margin.neg());

@@ -214,14 +216,16 @@ struct VCA_1VUKnob : SliderKnob {
float value = pq ? pq->getValue() : 1.f;

// Segment value
nvgBeginPath(args.vg);
nvgRect(args.vg,
r.pos.x,
r.pos.y + r.size.y * (1 - value),
r.size.x,
r.size.y * value);
nvgFillColor(args.vg, color::mult(color::WHITE, 0.33));
nvgFill(args.vg);
if (value >= 0.005f) {
nvgBeginPath(args.vg);
nvgRect(args.vg,
r.pos.x,
r.pos.y + r.size.y * (1 - value),
r.size.x,
r.size.y * value);
nvgFillColor(args.vg, color::mult(color::WHITE, 0.33));
nvgFill(args.vg);
}

// Segment gain
nvgBeginPath(args.vg);


+ 1
- 1
src/VCF.cpp View File

@@ -103,7 +103,7 @@ struct VCF : Module {
configInput(FREQ_INPUT, "Frequency");
configInput(RES_INPUT, "Resonance");
configInput(DRIVE_INPUT, "Drive");
configInput(IN_INPUT, "In");
configInput(IN_INPUT, "Audio");
configOutput(LPF_OUTPUT, "Lowpass filter");
configOutput(HPF_OUTPUT, "Highpass filter");
configBypass(IN_INPUT, LPF_OUTPUT);


+ 4
- 4
src/VCMixer.cpp View File

@@ -31,10 +31,10 @@ struct VCMixer : Module {
// x^1 scaling up to 6 dB
configParam(MIX_LVL_PARAM, 0.0, 2.0, 1.0, "Master level", " dB", -10, 20);
// x^2 scaling up to 6 dB
configParam(LVL_PARAMS + 0, 0.0, M_SQRT2, 1.0, "Ch 1 level", " dB", -10, 40);
configParam(LVL_PARAMS + 1, 0.0, M_SQRT2, 1.0, "Ch 2 level", " dB", -10, 40);
configParam(LVL_PARAMS + 2, 0.0, M_SQRT2, 1.0, "Ch 3 level", " dB", -10, 40);
configParam(LVL_PARAMS + 3, 0.0, M_SQRT2, 1.0, "Ch 4 level", " dB", -10, 40);
configParam(LVL_PARAMS + 0, 0.0, M_SQRT2, 1.0, "Channel 1 level", " dB", -10, 40);
configParam(LVL_PARAMS + 1, 0.0, M_SQRT2, 1.0, "Channel 2 level", " dB", -10, 40);
configParam(LVL_PARAMS + 2, 0.0, M_SQRT2, 1.0, "Channel 3 level", " dB", -10, 40);
configParam(LVL_PARAMS + 3, 0.0, M_SQRT2, 1.0, "Channel 4 level", " dB", -10, 40);
configInput(MIX_CV_INPUT, "Mix CV");
for (int i = 0; i < 4; i++)
configInput(CH_INPUTS + i, string::f("Channel %d", i + 1));


+ 2
- 2
src/VCO.cpp View File

@@ -430,8 +430,8 @@ struct VCO2 : Module {
configParam(FM_PARAM, 0.f, 1.f, 1.f, "Frequency modulation", "%", 0.f, 100.f);
configInput(FM_INPUT, "Frequency modulation");
configInput(SYNC_INPUT, "Sync");
configInput(WAVE_INPUT, "Wave");
configOutput(OUT_OUTPUT, "Out");
configInput(WAVE_INPUT, "Wave type");
configOutput(OUT_OUTPUT, "Audio");

lightDivider.setDivision(16);
}


+ 2
- 0
src/Viz.cpp View File

@@ -22,6 +22,8 @@ struct Viz : Module {

Viz() {
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
configInput(POLY_INPUT, "Polyphonic");

lightDivider.setDivision(16);
}



Loading…
Cancel
Save