<div>given...</div><div><br></div>Envelope e<div><br></div><div>e.last() should return the current value generated.  For Envelope class, it ought to be between 0-1 although for something like SinOsc, values range between -1 and 1.</div>
<div><br></div><div>You could do</div><div><br></div><div>e.last() * maxValue => float currentValue;</div><div><br></div><div>It's still a little hairy, but a lot less logic than what you're doing.  Also, in some circumstances you won't need the other shred.</div>
<div><br></div><div>-Mike<br clear="all"><div><br></div><a href="http://michaelclemow.com" target="_blank">http://michaelclemow.com</a><br><a href="http://semiotech.org" target="_blank">http://semiotech.org</a><br><br><br>

<br><br><div class="gmail_quote">On Fri, Jul 13, 2012 at 2:57 PM, Jordan Orelli <span dir="ltr"><<a href="mailto:jordanorelli@gmail.com" target="_blank">jordanorelli@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

                <div>
                    <span style="font-size:15px">there's no way to use this to ramp an arbitrary variable, like the frequency of a SinOsc, for example, is there?  Cause I do stuff like this and find it kinda annoying:</span>
                </div><div><span style="font-size:15px"><br></span></div><div><span style="font-size:15px"><div>SinOsc s => dac;</div><div>110 => float initial => s.freq;</div><div><br></div><div>fun void ramp() {</div>
<div>    880 => float final;</div><div>    1::ms => dur res;</div><div>    500::ms => dur width;</div><div>    (final - initial) / (width / res) => float delta;</div><div>    now => time start;</div><div>    while(now < start + width) {</div>
<div>        res => now;</div><div>        s.freq() + delta => s.freq;</div><div>    }</div><div>}</div><div>spork ~ ramp();</div><div><br></div><div>1::second => now;</div></span></div><div class="HOEnZb"><div class="h5">

                <div><div><span style="font-size:15px"><br></span></div><div><span style="font-size:15px"><br></span></div><div><span style="font-size:15px"><br></span></div></div>
                 
                <p style="color:#a0a0a8">On Friday, July 13, 2012 at 2:43 PM, Kassen wrote:</p>
                <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px">
                    <span><div><div><div>On 13 July 2012 20:17, George Locke <<a href="mailto:george.locke.maxmsp@gmail.com" target="_blank">george.locke.maxmsp@gmail.com</a>> wrote:</div><blockquote type="cite"><div>
sweet.  guess i might've figured that one out on my own...</div></blockquote><div><br></div><div>I understand the problem.</div><div>Like this I have been using it for quite a while, but the need for the</div><div>extra Step, unless it sets some sort of variable scaling, feels a bit</div>
<div>counter-intuitive. I seem to remember it was Perry who first proposed</div><div>that Envelope without any input should assume a input of 1. That would</div><div>bring it more closely in line with similar objects in other systems.</div>
<div><br></div><div>There is also no problem with asking questions if you looked around a</div><div>bit; the documentation is a bit scattered.</div><div><br></div><div>Happy ChucKing,</div><div>Kas.</div><div>_______________________________________________</div>
<div>chuck-users mailing list</div><div><a href="mailto:chuck-users@lists.cs.princeton.edu" target="_blank">chuck-users@lists.cs.princeton.edu</a></div><div><a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a></div>
</div></div></span>
                 
                 
                 
                 
                </blockquote>
                 
                <div>
                    <br>
                </div>
            </div></div><br>_______________________________________________<br>
chuck-users mailing list<br>
<a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a><br>
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
<br></blockquote></div><br></div>