<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Peak-based Action]]></title><description><![CDATA[<pre><code>const var TimPan = Content.getComponent("TimPan");

TimPan.setTimerCallback(function()
{
	var Peak = Engine.getMasterPeakLevel("L");
	
	if (Peak &gt; 0.1)
	{
		Sat1.set("visible", false);
		Sat2.set("visible", true);
	}
	else
	{
		Sat1.set("visible", true);
		Sat2.set("visible", false);
	}
});

TimPan.startTimer(50);
</code></pre>
<p dir="auto">I have written the code above, trying to switch between two graphics based on the output peak. I think it worked for oscillators in hise, but I want it to react to the sound coming from the DAW. (it's an effects-plugin)</p>
<p dir="auto">Any ideas if and how I could achieve something like that.<br />
ps. it would be good if something like that would be possible with low performance cost</p>
]]></description><link>https://forum.hise.audio/topic/14666/peak-based-action</link><generator>RSS for Node</generator><lastBuildDate>Sat, 25 Apr 2026 23:27:05 GMT</lastBuildDate><atom:link href="https://forum.hise.audio/topic/14666.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 25 Apr 2026 14:59:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Peak-based Action on Sat, 25 Apr 2026 20:15:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.hise.audio/uid/2757">@VorosMusic</a> I would go for a glibal_cable instead of a timer so the callback only fires when the value changed.<br />
Even better, it allows you to place the logic on the DSP side so the script callback we really just fire when necessary.</p>
<p dir="auto">That been said this is still a lightweight job for the script, but when I can prevent a timer for running all the time, I do…</p>
]]></description><link>https://forum.hise.audio/post/119820</link><guid isPermaLink="true">https://forum.hise.audio/post/119820</guid><dc:creator><![CDATA[ustk]]></dc:creator><pubDate>Sat, 25 Apr 2026 20:15:17 GMT</pubDate></item><item><title><![CDATA[Reply to Peak-based Action on Sat, 25 Apr 2026 15:05:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.hise.audio/uid/2757">@VorosMusic</a> That code looks like it should work. You could reduce it a bit</p>
<pre><code>TimPan.setTimerCallback(function()
{
	var state = Engine.getMasterPeakLevel("L") &gt; 0.1;

	Sat1.set("visible", !state);
	Sat2.set("visible", state);
});
</code></pre>
]]></description><link>https://forum.hise.audio/post/119819</link><guid isPermaLink="true">https://forum.hise.audio/post/119819</guid><dc:creator><![CDATA[David Healey]]></dc:creator><pubDate>Sat, 25 Apr 2026 15:05:33 GMT</pubDate></item></channel></rss>