electro-music.org   Dedicated to experimental electro-acoustic
and electronic music
 
 Front Page  |  Radio  |  Forum  |  Media  |  Playlists  |  Wiki
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » ChucK programming language
UGen tutorial
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [5 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
radarsat1



Joined: Mar 14, 2008
Posts: 85
Location: Montreal

PostPosted: Fri Oct 31, 2008 6:28 am    Post subject: UGen tutorial Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 270

PostPosted: Sat Nov 01, 2008 2:31 am    Post subject: Reply with quote  Mark this post and the followings unread

This is way cool, radarsat1, almost above my head, and way cool!
_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Sat Nov 01, 2008 4:59 am    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Send e-mail Visit poster's website
radarsat1



Joined: Mar 14, 2008
Posts: 85
Location: Montreal

PostPosted: Sat Nov 01, 2008 11:01 am    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Sat Nov 01, 2008 3:41 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [5 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » ChucK programming language
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Log in
Username:     Password:      Log me on automatically each visit    


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2026 by electro-music.org