[chuck-users] confused about time/control
Peter Lutek
peter at peterlutek.com
Wed Oct 22 12:50:45 EDT 2014
greetings! a little help for a newbie?....
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.
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...)
////////////
dur beat;
now + 5::second => time later;
while( now < later ){
while( min.recv(msgin) ){
( msgin.data3 + 10 ) * 50::ms => beat;
<<<beat>>>;
}
}
<<<"done">>>;
///////////
thanks much, in advance... cheers!
.pltk.
--
Peter Lutek
improvising musician in Toronto, Canada
http://peterlutek.com
More information about the chuck-users
mailing list