The BC Compressor plugin features a comprehensive real-time metering display that provides visual feedback for audio levels, gain reduction, and DSP activity. This guide documents the UI/UX implementation and how to interpret the meters.
- Default size: 700 × 400 pixels
- Responsive: Can be resized by the host
- Height: 50 pixels
- Background: Dark gray (#3a3a3a)
- Content: "BC COMPRESSOR" title in 24pt white font
- Purpose: Visual branding and window identification
-
Controls: 7 rotary sliders + 1 toggle button
-
Layout:
- Top Row (left-to-right): Threshold, Ratio, Attack, Release
- Bottom Row (left-to-right): Knee, Makeup, Mix
- Sidechain Button: Bottom-right corner
-
Slider Style: Rotary horizontal/vertical drag
-
Text Display: Below each slider (normalized value)
-
Label: Above each control
- Height: 80 pixels
- Background: Dark panel (#1a1a1a) with rounded corners
- Refresh Rate: 30 Hz (33ms update interval)
- Three Meters (left-to-right):
- Label: "INPUT"
- Range: -60 dB to 0 dB
- Bar Color (dynamic):
- Green (#00aa00): Normal levels (-60 to -12 dB)
- Orange (#ff8800): Warning zone (-12 to -3 dB)
- Red (#ff0000): Clipping risk (-3 dB and above)
- Display: Current dB value (1 decimal place)
- Purpose: Monitor pre-compression input levels
- Label: "GAIN REDUCTION"
- Range: -20 dB to 0 dB (shows compression amount)
- Bar Color: Green (indicates amount of dynamic compression active)
- Display: Current GR value in dB (1 decimal place)
- Purpose: Real-time compression monitoring—higher bar = more active compression
- Label: "OUTPUT"
- Range: -60 dB to 0 dB
- Bar Color (dynamic):
- Green (#00aa00): Normal levels (-60 to -12 dB)
- Orange (#ff8800): Warning zone (-12 to -3 dB)
- Red (#ff0000): Clipping risk (-3 dB and above)
- Display: Current dB value (1 decimal place)
- Purpose: Monitor post-compression output levels (after makeup gain and mix)
Input Level:
- Peak amplitude across all channels per processing block
- Converted to dB:
dB = 20 * log10(peakAmplitude) - Floor: -80 dB (silence)
Output Level:
- Peak amplitude after compression, makeup gain, and dry/wet mix
- Same dB conversion as input
- Reflects the actual audio leaving the plugin
Gain Reduction:
- Peak GR across the processing block
- Range: -20 dB to 0 dB
- 0 dB = no compression active
- -20 dB = maximum compression (hard limiting)
- Displayed as negative value to indicate reduction
- Algorithm: Exponential smoothing (70% hysteresis)
- Formula:
smoothed = 0.7 * smoothed_prev + 0.3 * current_value - Purpose: Reduce visual jitter and make meters easier to read
- Update Frequency: 30 Hz timer callback
The metering is thread-safe using std::atomic<float> for data exchange between audio thread and UI thread:
-
Audio Thread (CompressorModule):
- Calculates peak levels during
process() - Stores results in atomic members
- No blocking or allocations
- Calculates peak levels during
-
UI Thread (Editor):
- Reads atomic values in
timerCallback()(30 Hz) - Applies smoothing filter
- Triggers
repaint()
- Reads atomic values in
- ✅ Optimal levels
- Safe from clipping
- Good headroom
⚠️ Warning: approaching clipping- Consider reducing input gain or makeup gain
- May indicate aggressive compression
- 🔴 Danger: imminent clipping
- Immediate action recommended
- Audio may be distorted in DAW
- Sliders are linked to APVTS (Audio Processor Value Tree State)
- Changes are reflected in real-time
- Gain reduction meter updates to show compression response
- If lookahead is enabled (> 0 ms), the GR meter shows delayed response
- Latency compensation is automatic (host-aware)
- When sidechain is enabled, the input meter reflects sidechain signal
- Can be used to monitor external sidechain input
- Monitor Input Levels: Ensure input doesn't exceed -3 dB
- Set Threshold Appropriately: Peak signals should trigger compression (~5-10 dB above threshold)
- Watch Makeup Gain: Use to compensate for GR while maintaining dynamic punch
- Mix Control: Use for parallel compression (dry/wet blend)
- Lookahead: Enable for smooth, transparent compression on transients
Source/PluginEditor.h— Added meter state variablesSource/PluginEditor.cpp— Enhancedpaint()andtimerCallback()Source/DSP/CompressorModule.h— Added atomic level membersSource/DSP/CompressorModule.cpp— Implemented level tracking inprocess()Source/DSP/EffectModule.h— MeterData struct with input/output/GR
- CPU Overhead: Negligible (<0.1%)
- Memory: 12 bytes per compressor instance (3 × float atomics)
- Latency: Zero (non-blocking)
Potential improvements for future versions:
- Spectrum analyzer display
- Peak hold indicators
- RMS level display alongside peak
- Graphical GR visualization (curve)
- Automation curve recording display
- A/B bypass comparison meter