Browse Source

Updated lights

tags/v0.4.0
Andrew Belt 8 years ago
parent
commit
ae1ecae5cb
2 changed files with 10 additions and 10 deletions
  1. +6
    -6
      src/AudibleInstruments.hpp
  2. +4
    -4
      src/Shades.cpp

+ 6
- 6
src/AudibleInstruments.hpp View File

@@ -6,13 +6,13 @@ using namespace rack;

struct TripleModeLight : ValueLight {
void step() {
float v = roundf(getf(value));
if (v == 0.0)
color = colors[COLOR_CYAN];
else if (v == 1.0)
color = colors[COLOR_ORANGE];
int mode = (int)roundf(getf(value));
if (mode == 0)
color = nvgRGB(0x22, 0xe6, 0xef);
else if (mode == 1)
color = nvgRGB(0xf2, 0xb1, 0x20);
else
color = colors[COLOR_RED];
color = nvgRGB(0xed, 0x2c, 0x24);
}
};



+ 4
- 4
src/Shades.cpp View File

@@ -40,7 +40,7 @@ Shades::Shades() {

static float getChannelOutput(const float *in, float gain, float mode) {
float out = getf(in, 5.0);
if (roundf(mode) == 1) {
if ((int)roundf(mode) == 1) {
// attenuverter
out *= 2.0*gain - 1.0;
}
@@ -54,21 +54,21 @@ static float getChannelOutput(const float *in, float gain, float mode) {
void Shades::step() {
float out = 0.0;
out += getChannelOutput(inputs[IN1_INPUT], params[GAIN1_PARAM], params[MODE1_PARAM]);
lights[0] = out;
lights[0] = out / 5.0;
if (outputs[OUT1_OUTPUT]) {
*outputs[OUT1_OUTPUT] = out;
out = 0.0;
}

out += getChannelOutput(inputs[IN2_INPUT], params[GAIN2_PARAM], params[MODE2_PARAM]);
lights[1] = out;
lights[1] = out / 5.0;
if (outputs[OUT2_OUTPUT]) {
*outputs[OUT2_OUTPUT] = out;
out = 0.0;
}

out += getChannelOutput(inputs[IN3_INPUT], params[GAIN3_PARAM], params[MODE3_PARAM]);
lights[2] = out;
lights[2] = out / 5.0;
if (outputs[OUT3_OUTPUT]) {
*outputs[OUT3_OUTPUT] = out;
}


Loading…
Cancel
Save