but what if I want to do this with 2 sines?

I mean, for example  

Sineosc s1 that sounds and stop the same freq every 2 second, and another Sineosc thats sound at the same freq every 1 second I can use while true and put everthing in the bracklets. Right? Is it possible to do the same thing also with the For structure you mentioned?

And what about

sineosc s1  at 220 hz that goes on and off every 2 seconds
sineosc s2 that has a random frequency ( std.rand2f for example )
How could I manage this situation with while?  I need while ( true ) to make it in an infinite loop but I also need to make the random freq goes on!