I am interested in drawing a path of ducking from a limiter or compressor (for example). I am curious how I can smooth the path being drawn? I know I can add some smoothing within my scriptnode chain to get similar results, but in this particular case it comes with the drawback of loosing the information of the attacks. I was wondering if I could somehow use the Path.toQuadratic
here in order to smooth the graphics being drawn but I can't figure out how to accomplish this. Any ideas?
Content.makeFrontInterface(500, 300);
const var pnl_DuckingDisplay2 = Content.getComponent("pnl_DuckingDisplay2");
const var knb_PostDuck2 = Content.getComponent("knb_PostDuck2");
const var BUFFER_DUCK = Synth.getDisplayBufferSource("Limiter");
const var BUF_DUCKING = BUFFER_DUCK.getDisplayBuffer(1);
const var duckingTimer = Engine.createTimerObject();
namespace DuckingAnimation
{
inline function DuckPaintRoutine(g, panel)
{
local a = panel.getLocalBounds(0.0);
local h = this.getHeight();
local p = BUF_DUCKING.createPath(a, [0, 1, 0, 0], 0.0);
local duckScale = Math.max(knb_PostDuck2.getValue() / 101.0, 0.01);
// Invert the path vertically and scale by duck
p.scaleToFit(a[0], h , a[2], -h, false);
// Fill
g.fillAll(panel.get("bgColour"));
g.setColour(Colours.white);
g.drawPath(p, p.getBounds(1.0), {"Thickness": 2.0});
};
// Paint Routine
pnl_DuckingDisplay2.setPaintRoutine(function(g)
{
DuckPaintRoutine(g, this);
});
// Timer Callback
duckingTimer.setTimerCallback(function()
{
pnl_DuckingDisplay2.repaint();
});
duckingTimer.startTimer(30);
}
HiseSnippet 3519.3oc6azzbaabETRKkEschsiSSmo8.FM8.UqBC.HkHUS6XRIQFqHIKFQEk3ISGMffKIgEH.C.nDYx3oo25ul9av+.Z+OzicldoG5kdx8se.BrjfRTzxpwoByXYhce668122ukKq55Xf87bbkRj5nAcwRItGp1.a+1a0V2zVZmskRbWz18LNshYermzlC5p64gaHkHw7eFAfDKsfD84e8jM0szsMvgCIIcrioAdOyNl9giVs3tlVVUzafOxrSDnyUbGCG6sbrb5ALy7HEot5Fmp2B+LcBXygjdptWaoD+Zz5FarlRcrxZqUHW1B4xsdt0WSooR1l0Krdt5YymK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