[chuck-users] Hello, some newbie questions

Mat Schaffer mat at schaffer.me
Tue Oct 5 09:35:34 EDT 2010


Hello everyone,

I've been playing with chuck for a couple weeks and am having a lot of fun
with it. Really cool environment and I was impressed how easy it was to set
up the MIDI stuff.

After reading over a lot of material though, I still couldn't answer a few
questions, so I thought I'd try the list.

- Is there any way to have a script load it's own dependencies? I tried
Machine.add which is listed on http://github.com/heuermh/lick/wiki, but it
doesn't seem to work. Here's the code I'm trying:
http://gist.github.com/611486

- Similar to the last question, when I do load both of the above files into
chuck at once, it seems like only the class ends up in the global space. Is
there any way share raw functions or variables between files? The reason I
want to do this is mostly to avoid having to do timing code like this
http://gist.github.com/611515, or note definitions (cs, Cs) in every file.
Something like a pre-processor include would probably do the trick.

- Is there a way to pass functions as arguments to another function or
return a function? Also, are fun's proper closures or am I just getting
lucky? I was thinking maybe I could use functional style programming to
build things like arpeggiations. If this is totally overkill let me know :)

- The SinOsc seems to click whenever I stop or disconnect it. I've tried
moving the gain to 0.1, then 0, but it still seems to click. Is there some
technique for avoiding this?

Thanks in advance for your help. Looking forward to spending more time with
ChucK in the future.
-Mat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20101005/140df41e/attachment.htm>


More information about the chuck-users mailing list