<?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[About a Waveshaper in SNEX]]></title><description><![CDATA[<p dir="auto">Hello guys</p>
<p dir="auto">I have 2 arrays that I measured before from a wave shaper function.</p>
<p dir="auto">I need a wave shaper that analyses input sample and match/calculate to these lookup tables with interpolation.</p>
<p dir="auto">For example if the input sample is between -1.0 and -0.7 (<code>SigInData[0] &amp; SigInData[1]</code>), then the output will be calculated between -0.8 &amp; -0.43 (<code>SigOutData[0] &amp; SigOutData[1]</code>).</p>
<p dir="auto">How can I integrate this to SNEX, please help?</p>
<pre><code>const SigInData = [-1.0f, -0.7f, -0.65f, -0.5f, 0.0f, 0.5f, 0.89f, 0.96f, 1.0f];

const SigOutData = [-0.8f, -0.43f, -0.35f, -0.3f, 0.0f, 0.24f, 0.4f, 0.5f, 0.9f];

</code></pre>
]]></description><link>https://forum.hise.audio/topic/6309/about-a-waveshaper-in-snex</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Jul 2026 18:33:41 GMT</lastBuildDate><atom:link href="https://forum.hise.audio/topic/6309.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 13 Sep 2022 10:23:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to About a Waveshaper in SNEX on Tue, 13 Sep 2022 11:23:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.hise.audio/uid/274">@orange</a> <a class="plugin-mentions-user plugin-mentions-a" href="https://forum.hise.audio/uid/1">@Christoph-Hart</a></p>
<p dir="auto">Thank you so much guys, really appreciate your help! <img src="https://forum.hise.audio/assets/plugins/nodebb-plugin-emoji/emoji/android/1f44d.png?v=fba14f4754a" class="not-responsive emoji emoji-android emoji--+1" style="height:23px;width:auto;vertical-align:middle" title=":+1:" alt="👍" /></p>
]]></description><link>https://forum.hise.audio/post/54668</link><guid isPermaLink="true">https://forum.hise.audio/post/54668</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Tue, 13 Sep 2022 11:23:09 GMT</pubDate></item><item><title><![CDATA[Reply to About a Waveshaper in SNEX on Tue, 13 Sep 2022 11:09:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.hise.audio/uid/1">@Christoph-Hart</a> Looks very useful, thanks.</p>
]]></description><link>https://forum.hise.audio/post/54665</link><guid isPermaLink="true">https://forum.hise.audio/post/54665</guid><dc:creator><![CDATA[orange]]></dc:creator><pubDate>Tue, 13 Sep 2022 11:09:25 GMT</pubDate></item><item><title><![CDATA[Reply to About a Waveshaper in SNEX on Tue, 13 Sep 2022 11:08:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.hise.audio/uid/274">@orange</a> This test:</p>
<p dir="auto"><a href="https://github.com/christophhart/HISE/blob/develop/tools/snex_playground/test_files/index/index11.h" rel="nofollow ugc">https://github.com/christophhart/HISE/blob/develop/tools/snex_playground/test_files/index/index11.h</a></p>
<p dir="auto">And this C++ file has a pretty comprehensive documentation:</p>
<p dir="auto"><a href="https://github.com/christophhart/HISE/blob/develop/hi_dsp_library/snex_basics/snex_IndexTypes.h" rel="nofollow ugc">https://github.com/christophhart/HISE/blob/develop/hi_dsp_library/snex_basics/snex_IndexTypes.h</a></p>
<p dir="auto">Although I haven't setup the doc building process to include it to the HISE docs yet.</p>
]]></description><link>https://forum.hise.audio/post/54664</link><guid isPermaLink="true">https://forum.hise.audio/post/54664</guid><dc:creator><![CDATA[Christoph Hart]]></dc:creator><pubDate>Tue, 13 Sep 2022 11:08:32 GMT</pubDate></item><item><title><![CDATA[Reply to About a Waveshaper in SNEX on Tue, 13 Sep 2022 11:07:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.hise.audio/uid/1">@Christoph-Hart</a> said in <a href="/post/54657">About a Waveshaper in SNEX</a>:</p>
<blockquote>
<p dir="auto">If you've done that, you can use a special index type in SNEX that already does the interpolation for you, but that's just syntactic sugar.</p>
</blockquote>
<p dir="auto">Interesting, is there any example for this interpolation for the above example?</p>
]]></description><link>https://forum.hise.audio/post/54662</link><guid isPermaLink="true">https://forum.hise.audio/post/54662</guid><dc:creator><![CDATA[orange]]></dc:creator><pubDate>Tue, 13 Sep 2022 11:07:55 GMT</pubDate></item><item><title><![CDATA[Reply to About a Waveshaper in SNEX on Tue, 13 Sep 2022 10:52:49 GMT]]></title><description><![CDATA[<p dir="auto">From SNEX specific things aside, you shouldn't carry around two lookup tables, just transform them into one where you can just run the signal through. Mathematically there is no reason for two separate lookup tables and using one will heavily reduce the performance.</p>
<p dir="auto">If you've done that, you can use a special index type in SNEX that already does the interpolation for you, but that's just syntactic sugar.</p>
]]></description><link>https://forum.hise.audio/post/54657</link><guid isPermaLink="true">https://forum.hise.audio/post/54657</guid><dc:creator><![CDATA[Christoph Hart]]></dc:creator><pubDate>Tue, 13 Sep 2022 10:52:49 GMT</pubDate></item><item><title><![CDATA[Reply to About a Waveshaper in SNEX on Tue, 13 Sep 2022 10:42:22 GMT]]></title><description><![CDATA[<p dir="auto">@harris-rosendahl The SNEX uses C++ language. For the arrays, use <code>span</code> with the corresponding variable precision. For more examples on SNEX you can compile Hise &gt; Tools &gt; snex_playground project and see the tons of examples.</p>
<p dir="auto">The below example will make a linear interpolation between the data. BTW, since you haven't defined  any data for &gt; 1.0 and &lt; -1.0 statements in your lookup table, this will shape between -1.0 &amp; 1.0. Here you go ;)</p>
<pre><code>span&lt;float, 9&gt; SigInData = { -10.0f, -0.7f, -0.65f, -0.5f, 0.0f, 0.5f, 0.89f, 0.96f, 10.0f};

span&lt;float, 9&gt; SigOutData = { -0.8f, -0.43f, -0.35f, -0.3f, 0.0f, 0.24f, 0.4f, 0.5f, 0.9f};
 		

float getSamples(float input)
{	
	for(int i = 0; i &lt; 9; i++)
	{
		if(input &gt;= SigOutData[i] &amp;&amp; input &lt; SigOutData[i+1])	
		{
		  input = ((SigOutData[i+1] - SigOutData[i]) * (input - SigInData[i]) / (SigInData[i] - SigInData[i])) + SigOutData[i];			
		}		
	}
	
	return input;		
}

</code></pre>
]]></description><link>https://forum.hise.audio/post/54653</link><guid isPermaLink="true">https://forum.hise.audio/post/54653</guid><dc:creator><![CDATA[orange]]></dc:creator><pubDate>Tue, 13 Sep 2022 10:42:22 GMT</pubDate></item></channel></rss>