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

Veli-Pekka Tätilä vtatila at mail.student.oulu.fi
Thu Mar 8 01:21:41 EST 2007


joerg piringer wrote:
> 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.
Hmm, so it's the C++ route again. I thought I could create Ugens within 
chucK itself rather than merely connecting existing modules together and 
controlling patches. Although I do admit C++ is good for performance, I'd 
much prefer working with a Java-like high-level language, like ChucK would 
be, even for things that would be simple in C++.

> you'll have to rename the osc_query funktion. and call it in the
> load_internal_modules in the chuck_compile.cpp file.
Thanks  for the tips, I'll look into this.

>> 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.
Oh ok, how is sub-sample resolution handled in C++-code then?

-- 
With kind regards Veli-Pekka Tätilä (vtatila at mail.student.oulu.fi)
Accessibility, game music, synthesizers and programming:
http://www.student.oulu.fi/~vtatila/ 



More information about the chuck-users mailing list