From 7f0f08e9340f53d6cd7b0ce68f5a1f6c3ea308e0 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Fri, 4 Jun 2021 12:33:11 -0400 Subject: [PATCH] Clean up component names. Remove tinting for LED-like displays when rack brightness is decreased. --- src/LFO.cpp | 8 ++++++-- src/Mutes.cpp | 2 +- src/Octave.cpp | 7 +++++-- src/Pulses.cpp | 2 +- src/Quantizer.cpp | 4 ++++ src/Scope.cpp | 3 +++ src/SequentialSwitch.cpp | 10 +++++----- src/Unity.cpp | 14 +++++++------- src/VCA.cpp | 42 ++++++++++++++++++++++------------------ src/VCF.cpp | 2 +- src/VCMixer.cpp | 8 ++++---- src/VCO.cpp | 4 ++-- src/Viz.cpp | 2 ++ 13 files changed, 64 insertions(+), 44 deletions(-) diff --git a/src/LFO.cpp b/src/LFO.cpp index 8b13b25..5cd410c 100644 --- a/src/LFO.cpp +++ b/src/LFO.cpp @@ -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); } diff --git a/src/Mutes.cpp b/src/Mutes.cpp index 12f1ffd..0a994b4 100644 --- a/src/Mutes.cpp +++ b/src/Mutes.cpp @@ -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)); } diff --git a/src/Octave.cpp b/src/Octave.cpp index 9ddc93f..984df41 100644 --- a/src/Octave.cpp +++ b/src/Octave.cpp @@ -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); diff --git a/src/Pulses.cpp b/src/Pulses.cpp index f27fd1e..c01d4f7 100644 --- a/src/Pulses.cpp +++ b/src/Pulses.cpp @@ -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)); } diff --git a/src/Quantizer.cpp b/src/Quantizer.cpp index bafb9b4..2eeb504 100644 --- a/src/Quantizer.cpp +++ b/src/Quantizer.cpp @@ -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)) { diff --git a/src/Scope.cpp b/src/Scope.cpp index 602870b..77f95eb 100644 --- a/src/Scope.cpp +++ b/src/Scope.cpp @@ -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(); diff --git a/src/SequentialSwitch.cpp b/src/SequentialSwitch.cpp index 29fb1df..af76f92 100644 --- a/src/SequentialSwitch.cpp +++ b/src/SequentialSwitch.cpp @@ -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++) { diff --git a/src/Unity.cpp b/src/Unity.cpp index ff56597..09ea5ec 100644 --- a/src/Unity.cpp +++ b/src/Unity.cpp @@ -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); } diff --git a/src/VCA.cpp b/src/VCA.cpp index 9718565..8de9565 100644 --- a/src/VCA.cpp +++ b/src/VCA.cpp @@ -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); diff --git a/src/VCF.cpp b/src/VCF.cpp index 07a6a1c..40f546e 100644 --- a/src/VCF.cpp +++ b/src/VCF.cpp @@ -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); diff --git a/src/VCMixer.cpp b/src/VCMixer.cpp index 0ccfc57..b9a96d0 100644 --- a/src/VCMixer.cpp +++ b/src/VCMixer.cpp @@ -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)); diff --git a/src/VCO.cpp b/src/VCO.cpp index 6e76cd8..1ae6b4a 100644 --- a/src/VCO.cpp +++ b/src/VCO.cpp @@ -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); } diff --git a/src/Viz.cpp b/src/Viz.cpp index c957b27..a0d1efc 100644 --- a/src/Viz.cpp +++ b/src/Viz.cpp @@ -22,6 +22,8 @@ struct Viz : Module { Viz() { config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); + configInput(POLY_INPUT, "Polyphonic"); + lightDivider.setDivision(16); }