|
View previous topic :: View next topic
|
| Author |
Message |
JamesE banned
Joined: 05 Dec 2006
|
Posted: Fri Feb 09, 2007 5:24 am Post subject: Help me learn to code in CHUCK |
|
|
http://chuck.cs.princeton.edu/
I fucked around with basic when I was 10
how do I understand how to write in this? |
|
| Filter / Back to top |
|
 |
Mr. Business

Joined: 04 Dec 2006 Location: Hiding
|
Posted: Fri Feb 09, 2007 5:44 am |
|
|
If you've already got it installed and have compiled an example program to confirm that your installation works, then I advise reading through this in order until you get confused. Then you should write a program to play with the confusing concept until you finally understand it.
Anyway, that advice probably isn't very helpful if you're not a coder, because many of those concepts might be unfamiliar to you. I'll write more as I understand more.
edit: okay, the arithmetic syntax is very C-like. This shouldn't be too bad.
edit2: assignment statements in this are pretty odd.
edit3: okay, what exactly do you want to do with this language? _________________ Taking a break. |
|
| Filter / Back to top |
|
 |
JamesE banned
Joined: 05 Dec 2006
|
Posted: Fri Feb 09, 2007 6:00 am |
|
|
I'd like to make sex party music for depressed robots
or something that sounds dead 1970s sci-fi movie |
|
| Filter / Back to top |
|
 |
Mr. Business

Joined: 04 Dec 2006 Location: Hiding
|
Posted: Fri Feb 09, 2007 6:36 am |
|
|
Jeez, see, my inability to understand anything about sound or music puts me in an akward place here. _________________ Taking a break. |
|
| Filter / Back to top |
|
 |
JamesE banned
Joined: 05 Dec 2006
|
Posted: Fri Feb 09, 2007 7:04 am |
|
|
| I just want to know how this style of language works and what the basics are, really. I can't make head or tails of the structure. |
|
| Filter / Back to top |
|
 |
Mr. Business

Joined: 04 Dec 2006 Location: Hiding
|
Posted: Fri Feb 09, 2007 7:24 am |
|
|
Oh my, this looks very similar to C, but it's backwards.
Also, it seems that you need to learn all the uses for the "Chuck" operator, which is this: =>
For instance
Let's say we wanna make an integer number and give it an initial value of 0, we'd write
In C, this would be
Once we've made the variable, we can do a bit of math.
Here we've added 5 to our initial value of zero and boom, x now = 5.
Is this the sort of thing that you're looking for, or am I talking down to you? I don't wanna insult your intelligence, but damned if I don't find this business with the chuck operator mighty peculiar.
Also, what's with all this associative arrays shit lately? I saw that crap last week when I was looking at the D language with Decinoge!
The control structures, save for this "until" loop, are nearly identical to C control structures. By this I mean the while, for, and do/while loops, among others. Basically, you can generally assume that things that are followed by brackets are control structures:
Honestly man, I need to know how much of this shit already makes sense to you. Just look at the table of contents in the Language Specification and make me a short list of things that do and do not make sense to you.
Also, I am horribly suited for this. I apologize. _________________ Taking a break. |
|
| Filter / Back to top |
|
 |
Mr. Business

Joined: 04 Dec 2006 Location: Hiding
|
Posted: Fri Feb 09, 2007 7:37 am |
|
|
Shit, I understand what maybe two or three of the code examples do. Someone who understands both code and music should help this man, because I am out of my league. Music and sound are things that I know all of nothing about. _________________ Taking a break. |
|
| Filter / Back to top |
|
 |
!=

Joined: 04 Dec 2006 Location: the planet of leather moomins
|
Posted: Fri Feb 09, 2007 6:41 pm |
|
|
Mr Business, you are approaching it from the wrong side.
Chunk is not about variables or much about control structures. It's about building networks / circuits of signals, and controlling time.
The two main aspects of chuck are:
- The chuck operator connects sources, sinks and filters of signals of varying types.
- It let you write temporal events in a straightforward way. It's more straightforward because the loop that is inherent in all realtime/audio producing network is completely abstracted out.
The public of chuck is people who got fed up fidling with MAX/MSP, which presents those network of signals in a more blatant way: graphically. |
|
| Filter / Back to top |
|
 |
Toups tyranically banal

Joined: 03 Dec 2006 Location: Ebon Keep
|
Posted: Fri Feb 09, 2007 7:01 pm |
|
|
I'm interested in this. Is this a difficult language to learn?
I used to sort of know C, once!
Sort of! _________________
 |
|
| Filter / Back to top |
|
 |
Mr. Business

Joined: 04 Dec 2006 Location: Hiding
|
Posted: Fri Feb 09, 2007 8:33 pm |
|
|
| != wrote: |
| Mr Business, you are approaching it from the wrong side. |
Yeah, that's why I gave up. When I don't even understand the basic necessity of the language, it's pretty much time to hang up the gloves. _________________ Taking a break. |
|
| Filter / Back to top |
|
 |
Hot Stott Bot banned
Joined: 05 Dec 2006
|
Posted: Fri Feb 09, 2007 11:59 pm |
|
|
| Mr. Business wrote: |
| != wrote: |
| Mr Business, you are approaching it from the wrong side. |
Yeah, that's why I gave up. When I don't even understand the basic necessity of the language, it's pretty much time to hang up the gloves. |
The idea is that it is like the way audio equipment works.
You plug stuff into boxes and run cables between things and turn it in and feed it some input and get some output. |
|
| Filter / Back to top |
|
 |
Broco

Joined: 05 Dec 2006 Location: Headquarters
|
Posted: Sat Feb 10, 2007 4:15 am |
|
|
This is pretty great. My elegance-meter is going to 11!
I would've used a different operator to advance time (unless there's a hidden symmetry with the normal usage I'm not seeing), but that's a quibble.
| Mr. Business wrote: |
| Oh my, this looks very similar to C, but it's backwards. |
This is actually extremely different from C. C's model is running algorithms on memory, Chuck's model is plugging streams into one another (and the C-like aspects are only as a help for secondary tasks). C is intrinsically single-threaded, but a Chuck program can potentially bring into existence a dozen threads at once (but you don't have to worry about it, that's all abstracted away for you).
It so happens that you can view a C-style variable as the fixed input or output of a stream, which is why they reused the => operator for them, but the streams are actually much more powerful than that. Instead of being fixed until you change it like in C, a "variable" can vary in time according to a mathematical function (like say a sine wave) or a predefined file of samples you load. Then you can stream several inputs into one output and use that as a new input for another thing.
Fuck, this is awesome. Now that I know about it, it seems like the totally simple and natural way to do sampling-related tasks; which is of course the mark of genius. |
|
| Filter / Back to top |
|
 |
Hot Stott Bot banned
Joined: 05 Dec 2006
|
Posted: Sat Feb 10, 2007 6:10 am |
|
|
Broco, calm down!
This is basically how most video and audio editing languages and such work. |
|
| Filter / Back to top |
|
 |
Broco

Joined: 05 Dec 2006 Location: Headquarters
|
Posted: Sat Feb 10, 2007 6:12 am |
|
|
Ah, I'd never seen one, I'm not really familiar with the field. But the thing did win a bunch of prizes at conferences, it must have some innovation to it.
EDIT: I'm looking into other popular sound design packages, but I'm still really impressed with Chuck. Other packages gain their power by expanding out into a complicated GUI, and any feature which is not explicitly provided isn't present; Chuck just unified everything into a dead simple text-based syntax and vast power and programmability emerge naturally from that. It's the difference between Visual Basic and Lisp.
Not to say that I think Chuck is "the best" and will take over (has Lisp taken over?), but it certainly appeals greatly to my sensibilities. I'm the sort who likes to do my word processing in Latex and my rendering in Pov-Ray, so... |
|
| Filter / Back to top |
|
 |
Hot Stott Bot banned
Joined: 05 Dec 2006
|
Posted: Sat Feb 10, 2007 8:36 pm |
|
|
Yeah it is probably a particularly good one... but well, hmm, "audio/video languages" are kind of a weird subfield. Most people who do actual audio/video use higher level programs that basically work on the same concepts (streaming, piping, input, output, etc., etc.) but are in big sophisticated GUIs.
Those are often designed in such languages, though!
Take, for instance, the fact that like half of the major video editing tools are written using AVISynth!
Still, it is a weird little subfield where a/v nerd meets computer nerd! |
|
| Filter / Back to top |
|
 |
!=

Joined: 04 Dec 2006 Location: the planet of leather moomins
|
|
| Filter / Back to top |
|
 |
|