<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LeafLabs Garden &#187; Topic: Compressor Code</title>
		<link>http://forums.leaflabs.com/topic.php?id=13358</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:17:34 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=13358" rel="self" type="application/rss+xml" />

		<item>
			<title>pyrohaz on "Compressor Code"</title>
			<link>http://forums.leaflabs.com/topic.php?id=13358#post-28391</link>
			<pubDate>Sat, 10 Aug 2013 22:46:47 +0000</pubDate>
			<dc:creator>pyrohaz</dc:creator>
			<guid isPermaLink="false">28391@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hey guys,&#60;/p&#62;
&#60;p&#62;I'm looking to design a simple signal compressor. I've got the code for an envelope follower where the attack and decay rate of the follower can both be independently controlled (up to a point). What I'm looking to do now is convert this into a compressor, can anybody help me on this? My first assumption was to add 1 to the envelope signal and divide the input signal by this sum as a crude version of compression. Any help is appreciated! Btw, I've only currently simulated the envelope code in Matlab though I'm 99% sure it should work fine in C too.&#60;/p&#62;
&#60;p&#62;Code snippet:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#60;br /&#62;
 if(abs(In) &#38;gt; Env){&#60;br /&#62;
        Env = abs(In); //Peak detection&#60;br /&#62;
    }&#60;br /&#62;
    Env = Env - Env/Speed; //Envelope decay - &#34;Release&#34;&#60;br /&#62;
    EnvLP = EnvLP + (Env - EnvLP)/Smooth; //&#34;Attack&#34; portion (merely a low passed envelope)&#60;br /&#62;
&#60;/code&#62;
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
