<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Thanks Adam,<DIV><BR class="khtml-block-placeholder"></DIV><DIV>What I wanted to do is to apply some distortion function to an audiofile. The step object you mentioned, gave me the idea to use impulse object. Would you also use this approach?</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>WaveLoop audiofile =&gt; blackhole;</DIV><DIV>"foo.wav" =&gt; audiofile.path;</DIV><DIV>impulse i =&gt; dac;</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>while(true)</DIV><DIV>{</DIV><DIV>    math.tanh( audiofile.last() ) =&gt; i.next; // i.value seems to have disappeared???</DIV><DIV>    1::samp =&gt; now</DIV><DIV>}</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Thanks again for your tip.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Eduard</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR><DIV><DIV>On 26 Nov 2005, at 04:54, Adam Tindale wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite">Hi, <DIV><BR class="khtml-block-placeholder"></DIV><DIV>Great question. There are a few things that you have to understand in order to do this. When you connect multiple ugens to the input of another ugen the get summed. So, if connect three sinoscs to the dac they will get summed. If they all have an amplitude of one and the same frequency and phase then they will oscillate between -3 and 3. Makes sense.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Alright, you probably want to scale these things you put them into a gain and then into the dac. Then you set the .gain parameter to .333333 and you will get -1 to 1. Fantastic. You probably already know this. But if you want to do ring modulation you can change the .op parameter of gain to 3, which is multiply, and the inputs will be multiplied against each other. </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>You can check the manual for the .op parameters of gain. They are:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">–</SPAN></FONT> <FONT class="Apple-style-span" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">-1 passthrough</SPAN></FONT> </DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">–</SPAN></FONT> <FONT class="Apple-style-span" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">0 no processing</SPAN></FONT> </DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">–</SPAN></FONT> <FONT class="Apple-style-span" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">1 adds inputs (default)</SPAN></FONT> </DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">–</SPAN></FONT> <FONT class="Apple-style-span" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">2 subtracts inputs</SPAN></FONT> </DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">–</SPAN></FONT> <FONT class="Apple-style-span" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">3 multiplies inputs</SPAN></FONT> </DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">–</SPAN></FONT> <FONT class="Apple-style-span" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">4 divides inputs</SPAN></FONT><FONT class="Apple-style-span" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;"> </SPAN></FONT></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>For the example you gave, the solution is to connect two ugens to a gain that has the .op set to 1 (default). You add the DC bias by using the step object and setting it to k. </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>ChucK has all sorts of effects you can use to put between your oscillator and the dac. You can also start doing different modulation techniques by exploiting the .op feature of gain. </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I hope this helps. </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>--art</DIV><DIV><BR><DIV><DIV>On 25-Nov-05, at 6:30 PM, eduard wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Hello all,</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">How<SPAN class="Apple-converted-space">  </SPAN>can one apply some transformation to the output of an UGen an connect it to dac?</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">For instance, if I want to add a constant k to the output of a sine oscillator and then send this to dac, how should I do it?</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">thanks,</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Eduard</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">chuck-users mailing list</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</A></DIV> </BLOCKQUOTE></DIV><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">chuck-users mailing list</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</A></DIV> <BR class="Apple-interchange-newline"></BLOCKQUOTE></DIV><BR></DIV></BODY></HTML>