<div dir="ltr">In order to advance 'now' and make it eventually equal or higher than 'later' you should put inside your loop something like:<div><br></div><div>now + 5::second => time later;</div><div>while(now < later) {</div><div> ...</div><div> 1::second => now;</div><div>}</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2014-10-22 11:50 GMT-05:00 Peter Lutek <span dir="ltr"><<a href="mailto:peter@peterlutek.com" target="_blank">peter@peterlutek.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">greetings! a little help for a newbie?....<br>
<br>
when i run this bit of code, i would have expected the while loop to run for only 5 seconds, printing out a new value for "beat" whenever new data comes in from MIDI. then, it should print "done". instead, it just keeps printing the new "beat" values for as long as i let it run, never getting to the "done" line. i don't understand why the "while( now < later )" doesn't kill the loop after 5 seconds.<br>
<br>
also, xruns go through the roof and i have to kill it externally. i'm on linux, using jack. (all the setup of MIDI ports and variables happens before this, and i know it's functioning fine...)<br>
<br>
////////////<br>
<br>
dur beat;<br>
<br>
now + 5::second => time later;<br>
while( now < later ){<br>
while( min.recv(msgin) ){<br>
( msgin.data3 + 10 ) * 50::ms => beat;<br>
<<<beat>>>;<br>
}<br>
}<br>
<<<"done">>>;<br>
<br>
///////////<br>
<br>
thanks much, in advance... cheers!<br>
.pltk.<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Peter Lutek<br>
improvising musician in Toronto, Canada<br>
<a href="http://peterlutek.com" target="_blank">http://peterlutek.com</a><br>
______________________________<u></u>_________________<br>
chuck-users mailing list<br>
<a href="mailto:chuck-users@lists.cs.princeton.edu" target="_blank">chuck-users@lists.cs.<u></u>princeton.edu</a><br>
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" target="_blank">https://lists.cs.princeton.<u></u>edu/mailman/listinfo/chuck-<u></u>users</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>-Moisés
</div>