<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>SystemVerilog Study Notes. FPGA ADSR envelope generator for sound synthesis (I)</title><link>/technologies/fpga-group/b/blog/posts/systemverilog-study-notes-adsr-envelope-generator-for-sound-synthesis</link><description>ADSR envelope generator for sound synthesis.
In the previous blog we implemented a Direct Digital Frequency Synthesis module (DDFS ) that can generate an unmodulated audio-frequency tone. In this blog we will implement an ADSR (attack-decay...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: SystemVerilog Study Notes. FPGA ADSR envelope generator for sound synthesis (I)</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/systemverilog-study-notes-adsr-envelope-generator-for-sound-synthesis</link><pubDate>Mon, 13 Mar 2023 09:56:47 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:e5e02f8a-aa1e-4f58-a23c-17399750b7c6</guid><dc:creator>michaelkellett</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Good stuff, thanks for posting.&lt;/p&gt;
&lt;p&gt;I think you are using linear against time increases and decreses of the amplitude.&lt;/p&gt;
&lt;p&gt;You would get different (and more natural sounding) effects if you used logarithmic amplitude steps.&lt;/p&gt;
&lt;p&gt;There are two ways (at least) that you could approach this.&lt;/p&gt;
&lt;p&gt;The simplest way to do this is: :&lt;/p&gt;
&lt;p&gt;envelope *= adsr step&lt;/p&gt;
&lt;p&gt;The adsr step is best imagined as 1 +/- k, where k is usually &amp;lt;&amp;lt;1&lt;/p&gt;
&lt;p&gt;If you want a long time constant you will end up with a very small value for k (with 96kHz sampling and 20dB amplitude change in 1 second, k = 0.000024). This can be handled very efficiently by fixed point multiplication and addition but takes some careful bit shifting and may need 64 bit or more arithmetic.&lt;/p&gt;
&lt;p&gt;To multiply x by 1.000024 you multiply x by 24 shift right by six places and add x. Works the same in binary but with more shifts and brain strain.&lt;/p&gt;
&lt;p&gt;You have to calculate a new envelope value for each sample otherwise you get horrible modulation effects.&lt;/p&gt;
&lt;p&gt;MK&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25300&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: SystemVerilog Study Notes. FPGA ADSR envelope generator for sound synthesis (I)</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/systemverilog-study-notes-adsr-envelope-generator-for-sound-synthesis</link><pubDate>Mon, 13 Mar 2023 02:59:16 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:e5e02f8a-aa1e-4f58-a23c-17399750b7c6</guid><dc:creator>dang74</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;I first came across the terms attack, decay and sustain as a kid back in the 80s when I was leafing through the Commodore 64 Reference Guide that was included with my C64.&amp;nbsp; Truth be told in those days it went right over my head.&amp;nbsp; Thank you Javagoza.&amp;nbsp; Your wonderful blog gave me a second opportunity to revisit the material and finally get a good grasp of the concepts some 35 years after the fact.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25300&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: SystemVerilog Study Notes. FPGA ADSR envelope generator for sound synthesis (I)</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/systemverilog-study-notes-adsr-envelope-generator-for-sound-synthesis</link><pubDate>Sun, 12 Mar 2023 16:32:09 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:e5e02f8a-aa1e-4f58-a23c-17399750b7c6</guid><dc:creator>genebren</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;Great blog!&amp;nbsp; I find this as all interesting and relevant as it tracks with my current synthesizer projects (analog/digital mix).&amp;nbsp; Keep up the good work!&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25300&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: SystemVerilog Study Notes. FPGA ADSR envelope generator for sound synthesis (I)</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/systemverilog-study-notes-adsr-envelope-generator-for-sound-synthesis</link><pubDate>Sun, 12 Mar 2023 14:29:13 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:e5e02f8a-aa1e-4f58-a23c-17399750b7c6</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;This is an impressive story. I have the same hardware. I&amp;#39;m going to try and replicate it first. Then maybe translate to VHDL &lt;br /&gt;I want to improve my VHDL skills, and porting will also improve my Verilog understanding.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25300&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: SystemVerilog Study Notes. FPGA ADSR envelope generator for sound synthesis (I)</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/systemverilog-study-notes-adsr-envelope-generator-for-sound-synthesis</link><pubDate>Sun, 12 Mar 2023 10:03:21 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:e5e02f8a-aa1e-4f58-a23c-17399750b7c6</guid><dc:creator>javagoza</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I have added a zip file with the sources and other project files.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25300&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>