| Author |
Message |
radarsat1

Joined: Mar 14, 2008 Posts: 85 Location: Montreal
|
Posted: Fri Oct 31, 2008 6:28 am Post subject:
UGen tutorial |
 |
|
Hello! I started writing a tutorial to show how to create a UGen from scratch. Feel free to help me improve it!
http://wiki.cs.princeton.edu/forums.html/ChucK/Dev/UGen_Tutorial
Hopefully this will make it easier for people to develop their own UGens. C/C++ knowledge is required. |
|
|
Back to top
|
|
 |
Inventor
Stream Operator

Joined: Oct 13, 2007 Posts: 6221 Location: near Austin, Tx, USA
Audio files: 270
|
Posted: Sat Nov 01, 2008 2:31 am Post subject:
|
 |
|
This is way cool, radarsat1, almost above my head, and way cool! _________________ "Let's make noise for peace." - Kijjaz |
|
|
Back to top
|
|
 |
Kassen
Janitor


Joined: Jul 06, 2004 Posts: 7678 Location: The Hague, NL
G2 patch files: 3
|
Posted: Sat Nov 01, 2008 4:59 am Post subject:
|
 |
|
This is clearly above my head but it does seem to put me in the "just barely enough to be dangerous" position so that's wonderful. Arguably that's the best situation anyone can be in ;¬).
There's some stuff in there that makes me go "hey where did that come from?" I'll see how I do with it in practice and report back with feedback.
There's a lot of other stuff I'll need to know for which only a decent C++ tutorial will do but ChucK-wise one thing I'm wondering about is how to do .left() and .right() and I'm wondering whether that structure could be used to also have extra inputs called -say- ."mod()" or perhaps ".sideChain()". That would be a topic for a future tutorial that I would be interested in.
At any rate this is already great and will already save people hours or days of figuring out what's going on where. Three cheers for Steve! _________________ Kassen |
|
|
Back to top
|
|
 |
radarsat1

Joined: Mar 14, 2008 Posts: 85 Location: Montreal
|
Posted: Sat Nov 01, 2008 11:01 am Post subject:
|
 |
|
| Kassen wrote: | | This is clearly above my head but it does seem to put me in the "just barely enough to be dangerous" position so that's wonderful. Arguably that's the best situation anyone can be in ;¬). |
wicked. my feeling is that even with experience in C++, the chuck code is quite hard enough to parse, so having a guide to the minimal steps necessary to get something going should at least help development along.
| Kassen wrote: | | There's some stuff in there that makes me go "hey where did that come from?" I'll see how I do with it in practice and report back with feedback. |
yeah, there are definitely some verbose, repetitive and non-obvious steps there. I think a lot of things about building UGens simply calls for an automatic generator of some kind. (actually i'm thinking about doing something... will post later)
| Kassen wrote: | | There's a lot of other stuff I'll need to know for which only a decent C++ tutorial will do but ChucK-wise one thing I'm wondering about is how to do .left() and .right() and I'm wondering whether that structure could be used to also have extra inputs called -say- ."mod()" or perhaps ".sideChain()". That would be a topic for a future tutorial that I would be interested in. |
Yeah I looked briefly at how dac gets away with having .left and .right inputs. Apparently there is a base class called "stereo" which adc and dac inherit from. All "stereo" classes have members which are actually UGens in themselves. So I'm hoping it'll be possible to give UGens signal inputs that are themselves UGens. .sidechain is a perfect example. At the moment I haven't looked hard enough to know whether this is possible yet..
Actually I wish it were possible to have members that are both settable as float variables *and* can be connected as UGens, but I think that's maybe not possible. |
|
|
Back to top
|
|
 |
Kassen
Janitor


Joined: Jul 06, 2004 Posts: 7678 Location: The Hague, NL
G2 patch files: 3
|
Posted: Sat Nov 01, 2008 3:41 pm Post subject:
|
 |
|
dac is the best example as dac (and adc) don't just have stereo.
| Code: |
SndBuf b => dac.chan(3); |
This is perfectly valid, as long as ChucK was started with enough output channels.... but adc and dac are the only ones that do this and they are rather specialised. It's also remarkable that Ge noted that adc and dac are lowercase as they aren't UGens but in some older documentation files they *are* called UGens. This isn't just me picking at semantics; it could be quite relevant to know what's going on there and how far the UGen model can be pushed currently.
.sideChain() would be good and I'm also thinking about applications like a state-variable filter with .lpf(), .bpf() and .hpf() outputs.
At least a XFade could be made with just .left() and .right() inputs, like a inverted version of Pan2. Both that one and Pan2 would seem like perfect candidates for a realtime .mod() input to me. That's the kind of thing we can already make out of Gain Ugens with the occasional offset made using a Step. This works very well but leads to hard to decipher code. For readability you can stuff such a cluster of UGens into a class... but then you have the issue that home-build classes can't be UGens which has it's own range of issues for readability. _________________ Kassen |
|
|
Back to top
|
|
 |
|