I thought this would work, but, reading adsr.last() gives you nothing if no sound is going through that envelope, and the last value of the sound going into it if you have sound going into it.<br><br>&nbsp;It&#39;s got me beaten for now.
<br>I think this approach, having a seperate function ticking away in the background updating the filter is the way you&#39;d want to do it.<br><br>But, I&#39;m takin some time, and gettin me some dinner.<br><br>-Edward<br>
<br><br>// Filter Wooby Wooby Woo<br><br>BlitSaw bs;<br>LPF lpf;<br>ADSR amp;<br>ADSR filt;<br>Gain fg;<br>amp.set( 1::ms, 350::ms, .2, 500::ms );<br>filt.set( 15::ms, 550::ms, 0, 400::ms );<br><br>bs =&gt; amp =&gt; lpf =&gt; dac;
<br>filt =&gt; fg =&gt; blackhole;<br>10 =&gt; fg.gain;<br><br>500 =&gt; lpf.freq;<br>1 =&gt; lpf.Q;<br><br>spork ~ filteradsr ();<br><br>for (int l; l &lt; 32; l++)<br>{&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &lt;&lt;&lt;&quot;L;&quot;,l,&quot;&quot;&gt;&gt;&gt;;
<br>&nbsp;&nbsp;&nbsp; spork ~ playanote ( Std.rand2(30,60) );<br>&nbsp;&nbsp;&nbsp; 800::ms =&gt; now;<br>}<br>&nbsp;&nbsp;&nbsp; <br>fun void&nbsp; playanote (int nnum)<br>&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int mstodie;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;&lt;&lt;&quot;\n\n&quot;,nnum,&quot;&quot;&gt;&gt;&gt;;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nnum =&gt; Std.mtof =&gt; bs.freq;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;&lt;&lt;&quot;On&quot;,&quot;&quot;&gt;&gt;&gt;;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; amp.keyOn();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; filt.keyOn();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Std.rand2(150,300) =&gt; mstodie;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mstodie * 1::ms =&gt; now;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;&lt;&lt;&quot;Off&quot;,&quot;&quot;&gt;&gt;&gt;;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; amp.keyOff();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; filt.keyOff();<br>&nbsp;&nbsp;&nbsp; }<br><br>fun void filteradsr ()<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while (true)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; float currfilt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fg.last() * 1500 + 200 =&gt; currfilt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; currfilt =&gt; lpf.freq;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (maybe) &lt;&lt;&lt;filt.last(),currfilt&gt;&gt;&gt;;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 100::ms =&gt; now;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // lower value == realtime updated filter, you&#39;d want to comment out above line to avoid filling screen
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br><br><div><span class="gmail_quote">
On 6/3/07, <b class="gmail_sendername">Josh Lawrence</b> &lt;<a href="mailto:hardbop200@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">hardbop200@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

well, the trek continues...<br><br>I&#39;ve been copying and pasting, playing with, and generally screwing up<br>chuck code over the past week.&nbsp;&nbsp;with some help, I&#39;ve come up with this<br>simple synth patch:<br><br>// declare and connect chain of ugens
<br>Gain g =&gt; dac;<br>1 =&gt; g.gain;<br>SawOsc s =&gt; ADSR e =&gt;LPF f =&gt; g;<br>e.set( 1::ms, 5::ms, .8, 500::ms );<br>e.keyOn();<br>e.keyOff();<br>f.freq( 800 );<br><br>now what I would like to do with modulate the filter with adsr.&nbsp;&nbsp;I
<br>think this approach should work:<br><br>SawOsc s =&gt; ADSR e =&gt;LPF f =&gt; g;<br>ADSR e2 =&gt; f =&gt; g;<br><br>my thinking goes like this:&nbsp;&nbsp;I need to declare e2 to differientiate it<br>from my first adsr, which is defined as e.&nbsp;&nbsp;I have chucked e2 to my
<br>existing low pass filter, f.&nbsp;&nbsp;yet I&#39;m stumped as to where to define<br>how the adsr opens up the filter and closes it back down.&nbsp;&nbsp;can someone<br>help me understand where to go from here?<br><br>--<br>Josh Lawrence
<br><a href="http://www.hardbop200.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.hardbop200.com</a><br><a href="http://www.joshlawrencetrio.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.joshlawrencetrio.com</a><br>_______________________________________________<br>chuck-users mailing list
<br><a href="mailto:chuck-users@lists.cs.princeton.edu" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">chuck-users@lists.cs.princeton.edu</a><br><a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
</a><br></blockquote></div><br><br clear="all"><br>-- <br><a href="http://www.loscha.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">www.loscha.com</a>