How to use asComplex with UGens


I’ve tried the the following code that doesn’t works within a SynthDef:

d = SynthDef('test', {, }); d.dumpUGens;

Fails because Complex has no rate. UGen documentation for asComplex says "Complex math support. Returns Complex(this, 0.0) " which is ok, but how is used in the graph?

Typically you would need only the real part for the final output. I guess you would put UGens into a Complex in order to do complex math operations on it (e.g. complex multiplication is probably easier to write using Complex than by trying to remember the formula), and then explicitly pull out the real or imaginary part as needed.

A UGen that expects a real valued input is unlikely to accept a Complex directly (as you found here with Out).

What’s the reason for using Complex here?


Somehow I thought it has to do multichannel expansion… And it doesn’t of course. Now I understand, is the same with Point. Thanks for the clarification!