-
-
Notifications
You must be signed in to change notification settings - Fork 318
Add Spectrogram Control #1308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add Spectrogram Control #1308
Conversation
Analysis: With vs Without this Change
Without the change (old behavior)
When HasUI() returns false (headless plugins), the OnTimer() pump is completely skipped. This causes several problems:
1. Parameter change queue never drains
// IPlugAPIBase.cpp:169 (non-VST3 path)
while(mParamChangeFromProcessor.ElementsAvailable())
{
ParamTuple p;
mParamChangeFromProcessor.Pop(p);
SendParameterValueFromDelegate(p.idx, p.value, false); // triggers OnParamChangeUI()
}
- When DSP code calls SendParameterValueFromAPI(), values are pushed to mParamChangeFromProcessor
- Without pumping, this queue fills up indefinitely β memory grows, parameter changes are lost
2. MIDI messages from processor never forwarded
while (mMidiMsgsFromProcessor.ElementsAvailable())
{
IMidiMsg msg;
mMidiMsgsFromProcessor.Pop(msg);
SendMidiMsgFromDelegate(msg);
}
- MIDI output from DSP (e.g., arpeggiators, sequencers) never reaches the host β MIDI output broken
3. SysEx messages from processor never forwarded
while (mSysExDataFromProcessor.ElementsAvailable())
{
SysExData msg;
mSysExDataFromProcessor.Pop(msg);
SendSysexMsgFromDelegate({msg.mOffset, msg.mData, msg.mSize});
}
- SysEx output from DSP never reaches the host β SysEx output broken
4. AUv3: No parameter observer registered
- Host automation changes don't trigger OnParamChangeUI() β linked parameters, state updates broken
With the change (new behavior)
All pumps run unconditionally:
- Queues are drained properly (no memory leak)
- Parameter changes trigger OnParamChangeUI() even in headless plugins
- MIDI/SysEx output works regardless of UI presence
- AUv3 parameter observer always registered
Conclusion
1. The queues still need draining even without a UI
2. OnParamChangeUI() may be overridden for non-visual purposes
3. MIDI/SysEx forwarding to host is independent of UI
PR Review: Add Spectrogram ControlOverall this is a solid addition to the iPlug2 controls library. The spectrogram control is feature-rich with smooth scrolling, multiple colormaps, and cross-platform support. Below are my findings: Code Quality & Best Practices βStrengths:
Issues:
Potential Bugs π
Performance Considerations β‘
Memory Safety π
API Design π¨
Test Coverage π§ͺThe example usage in
Consider adding more comprehensive test/example code. Minor Issues
RecommendationsMust fix before merge:
Should fix:
Nice to have:
Great work overall! This is a well-implemented control that will be a valuable addition to the framework. The main concerns are the enum typo and missing header - everything else is polish. |
fc814b7 to
c7aef74
Compare
|
This is a comprehensive addition that brings a high-quality spectrogram visualization control to iPlug2. The implementation is solid with good attention to performance and cross-platform compatibility. Critical Issues to Fix Before Merge1. Clock Precision Bug (ISpectrogramControl.h:486, 497) 2. Division by Zero Risk (ISpectrogramControl.h:836) Minor Issues3. Missing Runtime Validation 4. Unused Parameters 5. Message Tag Inconsistency Performance Notes
Strengths
RecommendationApprove with minor fixes. Address issues #1 and #2 (critical bugs) before merging. Others are minor. Great addition to iPlug2! |
Finally add a cross-platform spectrogram control.