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

George Locke george.locke.maxmsp at gmail.com
Sun Aug 26 14:28:34 EDT 2012


Hi,

I've got a chuck file called rand.ck that defines functions, and another
that machine.add's rand.ck, but can't find the functions

rand.ck
"
fun float rand_norm() { // Marsaglia polar method, wastes the second ind var
float s, x, y;
0 => s;
while (s == 0 || s >= 1) {
Std.randf() => x;
Std.randf() => y;
x*x + y*y => s;
}
return x * Math.sqrt(-2 * Math.log(s) / s);
}
"

test.ck
"Machine.add("/Users/George/Documents/chucko/util/rand.ck");
for (0 => int i; i<10; i++) {
    rand_norm() => float x;
    <<< x >>>;
}
"
I add test.ck to the miniAudicle VM and the following error
error: line(3): undefined variable 'rand_norm'...

Am noob. plz help. kthx.

 - George
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20120826/e4b562a9/attachment.html>


More information about the chuck-users mailing list