<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hello Jack,<div class=""><br class=""></div><div class="">Ah, I see, I tried setting env.value but not reading from it, I was still reading env.last().<div class=""><br class=""></div><div class="">I would implement chugins or STK but alas, I do not C++ very much. &nbsp;;)</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp;michael</div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jan 30, 2020, at 10:32 AM, Jack Atherton &lt;<a href="mailto:lja@ccrma.stanford.edu" class="">lja@ccrma.stanford.edu</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">FYI, you should be able to avoid using the Step if you use env.value() instead of env.last(). Last is the output sample, and value is the amplitude of the envelope being applied to the input signal. It would probably be useful to implement those other envelope types as chugins -- go for it!<br class=""></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 30, 2020 at 8:22 AM Michael Heuer &lt;<a href="mailto:heuermh@gmail.com" class="">heuermh@gmail.com</a>&gt; wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;" class="">Hello ChucKers,<div class=""><br class=""></div><div class="">For the longest time I couldn't figure out how to get envelopes to work correctly as modulators</div><div class=""><br class=""></div><div class="">ADSR env =&gt; blackhole;</div><div class=""><br class=""></div><div class="">spork ~ updateAtSampleRate();</div><div class=""><br class=""></div><div class="">fun void updateAtSampleRate()</div><div class="">{</div><div class="">&nbsp; while (true)</div><div class="">&nbsp; {</div><div class="">&nbsp; &nbsp; 1::samp =&gt; now;</div><div class="">&nbsp; &nbsp; env.last() =&gt; // do something</div><div class="">&nbsp; }</div><div class="">}</div><div class=""><br class=""></div><div class="">It turns out they need a kick in the pants to work correctly, in other words</div><div class=""><br class=""></div><div class="">Step step =&gt; ADSR env =&gt; blackhole;</div><div class="">1.0 =&gt; step.next;</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Is this intentional?</div><div class=""><br class=""></div><div class="">Then is there any interest in implementing all the other envelope types (AD, AR, AHDSR, DADSR, DAHDSR)?&nbsp; I could probably do it in ChucK, but it might be better to implement them as chugins or upstream in STK.</div><div class=""><br class=""></div><div class="">In any case, now that I know how to make ADSR envelopes work, I have some pretty awful synthesized drums, just in time for the RPM challenge.</div><div class=""><br class=""></div><div class=""><a href="https://github.com/heuermh/lick/tree/master/lick/kick" target="_blank" class="">https://github.com/heuermh/lick/tree/master/lick/kick</a></div><div class=""><a href="https://github.com/heuermh/lick/tree/master/lick/snare" target="_blank" class="">https://github.com/heuermh/lick/tree/master/lick/snare</a></div><div class=""><br class=""></div><div class="">Cheers,</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp;michael</div></div>_______________________________________________<br class="">
chuck-users mailing list<br class="">
<a href="mailto:chuck-users@lists.cs.princeton.edu" target="_blank" class="">chuck-users@lists.cs.princeton.edu</a><br class="">
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" rel="noreferrer" target="_blank" class="">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br class="">
</blockquote></div>
_______________________________________________<br class="">chuck-users mailing list<br class=""><a href="mailto:chuck-users@lists.cs.princeton.edu" class="">chuck-users@lists.cs.princeton.edu</a><br class="">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users<br class=""></div></blockquote></div><br class=""></div></div></body></html>