[chuck-users] determining the type of an Object in code

Tiemen Meerman tiemen.meerman at phorm.com
Sun Sep 7 03:59:56 EDT 2008


Hmmm, after testing I found that sadly the following will run (without errors) but won't "fly";
===============
SawOsc s => UGen patchpoint => dac;

second => now;

new LPF @=> patchpoint;

second => now;
========================


It seems that asignment to a UGen doesn't affect the Ugen-graph?



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.

I was thinking of a class that achieves what you are aiming for: UGenRepatch - usage would look like:

UGenRepatch repatch;
repatch.ugen(LPF lpf);
repatch.addIn(SawOsc osc);
repatch.addOut(dac);

To setup the basic graph. After this you could repatch by saying:

repatch.ugen(HPF hpf);

Internally it would then unchuck the old LPF and place the HPF in the middle.

Obviously you could also write functions to remove/replace Ins or Outs from the central UGen.

This method adds yet another wrapper around the UGens, but might be worth it for the flexibility it provides.

-Tiemen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20080907/5d05efaa/attachment.html>


More information about the chuck-users mailing list