<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div>Hi Andrew. There is a handy command in the Std library for doing exactly that, Std.atof. (That's short for ASCII to float.)</div><div><br></div><div>float harm;</div><div>string arg1;</div><div>me.arg(0) => arg1;</div><div>arg1 => Std.atof => harm;</div><div><br></div><div>or you can shorten it to:</div><div>me.arg(0) => Std.atof => harm;</div><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><br></div><div style="font-family:times new roman, new york, times, serif;font-size:12pt">Hope this helps!</div><div style="font-family:times new roman, new york, times, serif;font-size:12pt">Joel</div><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><br><div style="font-family:arial, helvetica, sans-serif;font-size:13px">----- Original
 Message ----<br>From: Andrew C. Smith &lt;acsmith@willamette.edu><br>To: chuck-users@lists.cs.princeton.edu<br>Sent: Wednesday, October 1, 2008 7:55:38 PM<br>Subject: [chuck-users] Evaluating an argument as anything but a string<br><br>
Hey all,<br>Long time listener, first time caller.  I'm a little bit new to this,<br>but I managed to write a program that uses LiSa to play a sample of a<br>piano harmonic at a specified rate, putting it at a specified partial.<br> Here's the deal:  I want to just do chuck harmonic.ck:4 for the 4th<br>partial, or chuck harmonic.ck:5 for the 5th, but it keeps telling me<br>that my arguments are strings, not floats.  Is there a way to do a<br>string-float conversion, or just even to read a particular argument as<br>a float?<br><br>float harm;<br>string arg1;<br>me.arg(0) => arg1;<br>...<br>arg1 => harm;<br><br>is all I have relating to the arguments.  Obviously, that doesn't<br>work, as you can't ChucK a string to a float.  There's probably a<br>simple answer to this, isn't there?<br><br>Andrew Smith<br>_______________________________________________<br>chuck-users mailing list<br><a ymailto="mailto:chuck-users@lists.cs.princeton.edu"
 href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a><br><a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br></div></div><div style="position:fixed"></div></div></body></html>