On 8/9/07, 2g <electriclightheads@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.