[chuck-users] order aspect when fun sharing things in main

Kassen signal.automatique at gmail.com
Thu Aug 9 06:21:00 EDT 2007


On 8/9/07, 2g <electriclightheads at gmail.com> wrote:


am happy with the result it gives
> but began to wonder why s2.freq() in the fun doesn't result into an
> error when activated


<snip>

gives some sort of default for .freq?



Yes, exactly. Everything has defaults. You can check this yourself by
running this;

--------
SinOsc s => dac;
second => now;
-------------

That should give you a one second beep, usefull for testing wether your
speakers are turned on.

If you'd like to know what the defaults are you can check them this way;
-------------
SinOsc s;
<<<s.freq()>>>
---------------
That will print the frequency it has to your schreen.

You will never get a error doing what you did because regardless of what the
frequency is, it is still a float so you can still multiply it. Of course,
if the frequency would be 0 the result of any multiplication with that will
also be 0. In that case you wouldn't hear anything but you wouldn't get a
error.

I hope that helps,
Happy ChucKing!
Kas.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20070809/4725d9c0/attachment.htm 


More information about the chuck-users mailing list