I cannot understand how the while structure has to be used. I mean, I understood that while ( true ) means infinite loop<div>and also that while ( n::second => now ) means an "n" second loop duration but...</div>
<div><br></div><div>If I just want to do a really stupid thing like a Sine at 220 Hz that sounds for 2 seconds and then stops for 2 seconds and then goes again.</div><div>How could I do? I thought that it was necessary just to do something like this</div>
<div><br></div><div>SinOsc s => dac;</div><div>.2 => s.gain;</div><div>220 => s.freq;</div><div>while ( 2::second => now)</div><div>0 =>s.gain </div><div><br></div><div>but I know that it's not the right way, also because in this method I would have to rewrite this thing an infinite ( whiletrue ahahah) number of times to have what I'm looking for.</div>
<div><br></div><div>And I don't actually understand {} . How am I supposed to use these? </div><div><br></div><div>Thanks</div>