[chuck-users] noob: machine.add but can't find function

Kassen signal.automatique at gmail.com
Sun Aug 26 15:29:25 EDT 2012


Hey George,

> I add test.ck to the miniAudicle VM and the following error
> error: line(3): undefined variable 'rand_norm'...
> 
> Am noob. plz help. kthx.

That is a simple one; the two files each have their own namespace.
This means that stuff defined (and named) in one file can only be read
or used from that file. If you put both functions in the same file it
should work.

Normally this is a good thing; this way we can use a name like "drum"
in a file and not worry about whether we already used that name
else-where so we don't get toms where we planned a snare.

Functions and classes also have their own namespace, for the same
reason. If this is not what you want or need you'll have to create a
public class and make your function a member of that. Public classes
can be accessed from anywhere in the VM.

Hope that helps and gets you a bit further.

Yours,
Kas,


More information about the chuck-users mailing list