[chuck-users] User-Module Fundamentals AKA Extending Ugen

joerg piringer joerg at piringer.net
Wed Mar 7 17:27:47 EST 2007

Veli-Pekka Tätilä wrote:

> I've been trying to grasp how a uGen operates, too, where is it documented 
> thoroughly? The manual says all uGens have certain common parameters. But 
> how should I implement something like:
> Quote manual:
> . .chan - (int) - returns a reference on a channel (0 ->N-1)
> End quote.
> For my class which should work like a uGen, i.e. what to return and where do 
> I get the object  I'm supposed to return? Ideally I'd like to create modules 
> that make no difference between event and audio signals as in a true 
> modular.

the best aproach is to take an existing file like ugen_osc.cpp rename it 
& the corresponding ugen_osc.h and try to modify it.
it is pretty straightforward i think.
you'll have to rename the osc_query funktion. and call it in the 
load_internal_modules in the chuck_compile.cpp file.
i started experimenting a little bit with the source yesterday and it 
was pretty simple to add new ugens.

> Howabout modules with multiple inputs. Another thing I'm thinking of 
> creating would be a simple multiplexer named OneOfN which has n inputs and a 
> selectN adress bus. It connects the input addressed by selectN to the 
> output. This is a generalization of the Reaktor modules audio switch 2, 4, 8 
> and event switch 2, 4, 8. Are such multi in/out modules currently feasible? 
> Do I have to advance time in such a module, as it is a 
> (stateless)combination circuit, not a state machine?

you have to calculate and return each tick/sample.

i am still guessing a lot of things but it is not that hard as i thought.



More information about the chuck-users mailing list