improved performance patch for OS X + XP
Dear All, There is a new incremental version out (1.1.5.5) which: 1) fixes a bug under XP where chuck --loop uses 100% cpu (now it uses 0-5%) 2) improves stability under Mac OS X It is available now: http://chuck.cs.princeton.edu/release/ Best, Ge!
Hello ChucKers, Is there any way to go from an int or float value of a variable to a duration? e.g. 1 => int value; value::second => dur some_unknown_number_of_seconds; What I'm really trying to do is math with durations and numbers, 1::second => dur w; (w / 2) => dur h; Thank you, michael
On Wed, 16 Feb 2005, Michael Heuer wrote:
Hello ChucKers,
Is there any way to go from an int or float value of a variable to a duration? e.g.
1 => int value; value::second => dur some_unknown_number_of_seconds;
What I'm really trying to do is math with durations and numbers,
1::second => dur w; (w / 2) => dur h;
I have without problem gotten things like (100.0/3.0)::second => dur foo; to work. You may want to consider looking into typecasting as well -- I'm not certain, though, how that'd work...
Thank you,
michael
_______________________________________________ chuck mailing list chuck@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck
-- Mikael Johansson | To see the world in a grain of sand mikael@johanssons.org | And heaven in a wild flower http://www.mikael.johanssons.org | To hold infinity in the palm of your hand | And eternity for an hour
Micheal, math on durs is supported, but not completely ( some revision to dur handing is needed ) dur * float => dur ; should work. not sure about float * dur => dur; I don't believe that division is properly supported. this code would work -- 1::second => dur beat; beat * 0.5 => dur h; -or- beat * 0.5 => now; -- where it stands for now... Phil On Feb 16, 2005, at 5:43 PM, Michael Heuer wrote:
Hello ChucKers,
Is there any way to go from an int or float value of a variable to a duration? e.g.
1 => int value; value::second => dur some_unknown_number_of_seconds;
What I'm really trying to do is math with durations and numbers,
1::second => dur w; (w / 2) => dur h;
Thank you,
michael
_______________________________________________ chuck mailing list chuck@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck
Hi All, When you do division on two durs a float is returned. When you divide a dur by a float you get a dur as well. There are some examples on the reserved words page on the docs site. Here is how you can divide two durs to make a new dur. 10::second => dur a; 5::second => dur b; a/b => float g; g::second => dur newdur; Doing a/b::second => dur q; gives a parse error however. This works nicely though. 10::second => dur a; a/2. => dur b; Hope that helps. art On Feb 16, 2005, at 3:11 PM, Philip Davidson wrote:
Micheal,
math on durs is supported, but not completely ( some revision to dur handing is needed )
dur * float => dur ; should work. not sure about float * dur => dur; I don't believe that division is properly supported.
this code would work -- 1::second => dur beat; beat * 0.5 => dur h; -or- beat * 0.5 => now; --
where it stands for now...
Phil
On Feb 16, 2005, at 5:43 PM, Michael Heuer wrote:
Hello ChucKers,
Is there any way to go from an int or float value of a variable to a duration? e.g.
1 => int value; value::second => dur some_unknown_number_of_seconds;
What I'm really trying to do is math with durations and numbers,
1::second => dur w; (w / 2) => dur h;
Thank you,
michael
_______________________________________________ chuck mailing list chuck@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck
_______________________________________________ chuck mailing list chuck@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck
participants (5)
-
Adam R. Tindale
-
Ge Wang
-
Michael Heuer
-
Mikael Johansson
-
Philip Davidson