change opacity of UI elements; use logarithmic volume knob curve

This commit is contained in:
Armin 2026-07-15 19:06:46 +02:00
commit ea6a70e090
2 changed files with 14 additions and 21 deletions

View file

@ -186,7 +186,7 @@ public:
keyTrack = kTrack; keyTrack = kTrack;
pan = p; pan = p;
drive = std::max(drv, 1.001f); drive = std::max(drv, 1.001f);
outputLevel = outLvl; outputLevel = outLvl * outLvl;
lfo1Depth = l1Depth; lfo1Depth = l1Depth;
lfo1Dest = static_cast<LFODest>(l1Dest); lfo1Dest = static_cast<LFODest>(l1Dest);

View file

@ -167,10 +167,9 @@ void VuMeter::paint(juce::Graphics& g) {
juce::Path clipPath; juce::Path clipPath;
clipPath.addRoundedRectangle(bounds, 9.0f); clipPath.addRoundedRectangle(bounds, 9.0f);
g.reduceClipRegion(clipPath); g.reduceClipRegion(clipPath);
g.setOpacity(0.7f);
juce::ColourGradient grad(juce::Colour(0xff00cc44), 0.0f, bounds.getBottom(), juce::ColourGradient grad(juce::Colour(0xff00cc44).withAlpha(0.4f), 0.0f, bounds.getBottom(),
juce::Colour(0xffcc2200), 0.0f, bounds.getY(), false); juce::Colour(0xffcc2200).withAlpha(0.4f), 0.0f, bounds.getY(), false);
g.setGradientFill(grad); g.setGradientFill(grad);
g.fillRoundedRectangle(innerBar, 2.0f); g.fillRoundedRectangle(innerBar, 2.0f);
} }
@ -230,15 +229,14 @@ void WaveformDisplay::paint(juce::Graphics& g) {
juce::Path clipPath; juce::Path clipPath;
clipPath.addRoundedRectangle(bounds, 9.0f); clipPath.addRoundedRectangle(bounds, 9.0f);
g.reduceClipRegion(clipPath); g.reduceClipRegion(clipPath);
g.setOpacity(0.7f);
juce::ColourGradient waveGrad(juce::Colour(0xff00ff88), 0.0f, bounds.getY(), juce::ColourGradient waveGrad(juce::Colour(0xff00ff88).withAlpha(0.33f), 0.0f, bounds.getY(),
juce::Colour(0xff005522), 0.0f, bounds.getBottom(), false); juce::Colour(0xff005522).withAlpha(0.12f), 0.0f, bounds.getBottom(), false);
g.setGradientFill(waveGrad); g.setGradientFill(waveGrad);
g.fillPath(filledPath); g.fillPath(filledPath);
g.setColour(juce::Colour(0xff00ff88).withAlpha(0.8f)); g.setColour(juce::Colour(0xff00ff88).withAlpha(0.7f));
g.strokePath(wavePath, juce::PathStrokeType(1.5f)); g.strokePath(wavePath, juce::PathStrokeType(0.7f));
} }
g.setColour(juce::Colour(0xffccaa44)); g.setColour(juce::Colour(0xffccaa44));
@ -248,7 +246,7 @@ void WaveformDisplay::paint(juce::Graphics& g) {
// --- Spectrum Analyzer --- // --- Spectrum Analyzer ---
void SpectrumAnalyzer::paint(juce::Graphics& g) { void SpectrumAnalyzer::paint(juce::Graphics& g) {
auto bounds = getLocalBounds().toFloat().reduced(0.5f); auto bounds = getLocalBounds().toFloat().reduced(0.7f);
juce::ColourGradient bgGrad(juce::Colour(0xBB222222), bounds.getCentreX(), bounds.getY(), juce::ColourGradient bgGrad(juce::Colour(0xBB222222), bounds.getCentreX(), bounds.getY(),
juce::Colour(0xBB111111), bounds.getCentreX(), bounds.getBottom(), false); juce::Colour(0xBB111111), bounds.getCentreX(), bounds.getBottom(), false);
@ -311,13 +309,8 @@ void SpectrumAnalyzer::paint(juce::Graphics& g) {
float bx = x + 1.0f; float bx = x + 1.0f;
float by = barBottom - barH; float by = barBottom - barH;
{ g.setColour(juce::Colour(0xff00ff88).withAlpha(0.3f));
juce::Graphics::ScopedSaveState saved(g); g.fillRect(bx, by, bw, barH);
g.setOpacity(0.7f);
g.setColour(juce::Colour(0xff00ff88));
g.fillRect(bx, by, bw, barH);
}
} }
g.setColour(juce::Colour(0xffccaa44)); g.setColour(juce::Colour(0xffccaa44));
@ -1081,7 +1074,7 @@ void PianoRollComponent::paint(juce::Graphics& g) {
whiteKeyWidth = keysWidth / numWhiteKeys; whiteKeyWidth = keysWidth / numWhiteKeys;
// Draw pitch bend strip background // Draw pitch bend strip background
g.setColour(juce::Colour(0xff222222)); g.setColour(juce::Colour(0xff222222).withAlpha(0.7f));
g.fillRect(10, 0, pbRight - 10, whiteKeyHeight); g.fillRect(10, 0, pbRight - 10, whiteKeyHeight);
// Right edge border to separate from keys // Right edge border to separate from keys
@ -1133,10 +1126,10 @@ void PianoRollComponent::paint(juce::Graphics& g) {
bool pressed = processor.isNoteActive(note); bool pressed = processor.isNoteActive(note);
if (pressed) { if (pressed) {
g.setColour(juce::Colour(0xffccaa44)); g.setColour(juce::Colour(0xffccaa44).withAlpha(0.8f));
} else { } else {
juce::ColourGradient grad(juce::Colour(0xffe4e4e4), static_cast<float>(kx), 0.0f, juce::ColourGradient grad(juce::Colour(0xffe4e4e4).withAlpha(0.7f), static_cast<float>(kx), 0.0f,
juce::Colour(0xffc8c8c8), static_cast<float>(kx), static_cast<float>(whiteKeyHeight), false); juce::Colour(0xffc8c8c8).withAlpha(0.7f), static_cast<float>(kx), static_cast<float>(whiteKeyHeight), false);
g.setGradientFill(grad); g.setGradientFill(grad);
} }
g.fillRect(rect); g.fillRect(rect);