<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>Re: [chuck-users] determining the type of an Object in code</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<BR>

<P><FONT SIZE=2>Hmmm, after testing I found that sadly the following will run (without errors) but won't &quot;fly&quot;;<BR>
===============<BR>
SawOsc s =&gt; UGen patchpoint =&gt; dac;<BR>
<BR>
second =&gt; now;<BR>
<BR>
new LPF @=&gt; patchpoint;<BR>
<BR>
second =&gt; now;<BR>
========================<BR>
<BR>
<BR>
It seems that asignment to a UGen doesn't affect the Ugen-graph?<BR>
<BR>
<BR>
<BR>
That sounds like the correct behaviour, as you only change the memory address 'patchpoint' is pointing to. The actual graph will know nothing of this event.<BR>
<BR>
I was thinking of a class that achieves what you are aiming for: UGenRepatch - usage would look like:<BR>
<BR>
UGenRepatch repatch;<BR>
repatch.ugen(LPF lpf);<BR>
repatch.addIn(SawOsc osc);<BR>
repatch.addOut(dac);<BR>
<BR>
To setup the basic graph. After this you could repatch by saying:<BR>
<BR>
repatch.ugen(HPF hpf);<BR>
<BR>
Internally it would then unchuck the old LPF and place the HPF in the middle.<BR>
<BR>
Obviously you could also write functions to remove/replace Ins or Outs from the central UGen.<BR>
<BR>
This method adds yet another wrapper around the UGens, but might be worth it for the flexibility it provides.<BR>
<BR>
-Tiemen</FONT>
</P>

</BODY>
</HTML>