[chuck-users] Evaluating an argument as anything but a string

Andrew C. Smith acsmith at willamette.edu
Wed Oct 1 20:55:38 EDT 2008

Hey all,
Long time listener, first time caller.  I'm a little bit new to this,
but I managed to write a program that uses LiSa to play a sample of a
piano harmonic at a specified rate, putting it at a specified partial.
 Here's the deal:  I want to just do chuck harmonic.ck:4 for the 4th
partial, or chuck harmonic.ck:5 for the 5th, but it keeps telling me
that my arguments are strings, not floats.  Is there a way to do a
string-float conversion, or just even to read a particular argument as
a float?

float harm;
string arg1;
me.arg(0) => arg1;
arg1 => harm;

is all I have relating to the arguments.  Obviously, that doesn't
work, as you can't ChucK a string to a float.  There's probably a
simple answer to this, isn't there?

Andrew Smith

More information about the chuck-users mailing list