theallelectricsmartgrid

Smart Grid One Visualizers

This document describes the visualizer system for the Smart Grid One display. Visualizers render DSP data (scopes, spectra, meters, etc.) in the 24×18 grid layout, driven by the selected encoder bank.

Architecture

Components

File Purpose
SmartGridOneMainVisualizerComponent.hpp Base class for all visualizers. Defines Draw() and optional OnClick().
SmartGridOneVisualizerMain.hpp Main container component. Owns visualizer instances, handles layout, dispatch, and metering.
ForEachSmartGridOneVisualizer.hpp X-macro list mapping (name, bank, block, constructor, source-machine flags) for each visualizer.
ForEachModulationVisualizer.hpp X-macro list mapping (name, slot, constructor, mode, color) for modulation visualizers.

Base Class: SmartGridOneMainVisualizerComponent

Visualizers are not JUCE Components. They are lightweight structs that implement:

Each visualizer also carries SourceMachineFlags, and SmartGridOneVisualizerMain only draws visualizers whose flags match at least one visible voice in the active track.

Layout

The grid is 24×18 cells. Block positions:

Block Grid position Description
0 (0, 0) Top-left 8×8
1 (0, 8) Left 8×8
2 (8, 8) Center 8×8
3 (16, 8) Right 8×8
-1 (0, 8), 24×8 Full-width strip (e.g. MelodyRoll)
slots 0-11 (x, 16), 2×2 Modulation panels drawn across the bottom row

Encoder regions at (8,0), (16,0), (8,3), (16,3) are excluded from paint and click handling.

Metering occupies (8, 5), 16×2 cells.

Bank-to-Visualizer Mapping

The selected encoder bank (SmartGridOneEncoders::Bank) determines which visualizers are drawn. Banks:

Data Sources

Visualizers read from:

Existing Visualizers

Component Bank(s) Block Data source
ScopeComponent Source, FilterAndAmp, VoiceLFOs 0–3 ScopeWriter, voice offset
AnalyserComponent Source, FilterAndAmp 3 WindowedFFT, voice filter UI state
PhysicalModelingFrequencyResponseComponent Source 0 PhysicalModelingSource::UIState transfer function
VoiceMeterComponent FilterAndAmp 0 m_voiceMeterReader
SoundStageComponent PanningAndSequencing 0 m_xPos, m_yPos, m_voiceMeterReader
MelodyRollComponent PanningAndSequencing -1 NonagonNoteWriter
QuadAnalyserComponent Delay, Reverb, TheoryOfTime 0 m_quadScopeWriter, delay/reverb UI state
QuadDelayEnvelopeVisualizerComponent Delay, TheoryOfTime 1 m_delayUIState envelope snapshots plus relative read/write head positions
TheoryOfTimeScopeComponent TheoryOfTime 2 m_monoScopeWriter
SourceMixerReductionComponent Mastering, Inputs, DeepVocoder 0–3 m_sourceMixerScopeWriter
SourceMixerFrequencyComponent Mastering, Inputs, DeepVocoder 1–3 m_sourceMixerScopeWriter
MultibandEQComponent Mastering, Inputs, DeepVocoder 2–3 m_quadScopeWriter
MultibandGainReductionComponent Mastering, Inputs, DeepVocoder 3 m_stereoMasteringChainUIState

QuadDelayEnvelopeVisualizerComponent is a non-FFT effect view. It renders min/max envelope snapshots derived from the quad delay’s movable-writer buffer and overlays the current relative read/write tape-head positions from m_delayUIState.